Skip to content
Snippets Groups Projects
  1. Apr 26, 2024
    • Jakub Jelinek's avatar
      Update crontab and git_update_version.py · 036aad9d
      Jakub Jelinek authored
      2024-04-26  Jakub Jelinek  <jakub@redhat.com>
      
      maintainer-scripts/
      	* crontab: Snapshots from trunk are now GCC 15 related.
      	Add GCC 14 snapshots from the respective branch.
      contrib/
      	* gcc-changelog/git_update_version.py (active_refs): Add
      	releases/gcc-14.
      036aad9d
    • Jakub Jelinek's avatar
      Bump BASE-VER. · 48a320a1
      Jakub Jelinek authored
      2024-04-26  Jakub Jelinek  <jakub@redhat.com>
      
      	* BASE-VER: Set to 15.0.0.
      48a320a1
    • Frederik Harwath's avatar
      amdgcn: Add gfx90c target · b8e9fd53
      Frederik Harwath authored
      
      Add support for gfx90c GCN5 APU integrated graphics devices.
      The LLVM AMDGPU documentation does not list those devices as supported
      by rocm-amdhsa, but it passes most libgomp offloading tests.
      Although they are constrainted compared to dGPUs, they might be
      interesting for learning, experimentation, and testing.
      
      gcc/ChangeLog:
      
      	* config.gcc: Add gfx90c.
      	* config/gcn/gcn-hsa.h (NO_SRAM_ECC): Likewise.
      	* config/gcn/gcn-opts.h (enum processor_type): Likewise.
      	(TARGET_GFX90c): New macro.
      	* config/gcn/gcn.cc (gcn_option_override): Handle gfx90c.
      	(gcn_omp_device_kind_arch_isa): Likewise.
      	(output_file_start): Likewise.
      	* config/gcn/gcn.h: Add gfx90c.
      	* config/gcn/gcn.opt: Likewise.
      	* config/gcn/mkoffload.cc (EF_AMDGPU_MACH_AMDGCN_GFX90c): New macro.
      	(get_arch): Handle gfx90c.
      	(main): Handle EF_AMDGPU_MACH_AMDGCN_GFX90c
      	* config/gcn/t-omp-device: Add gfx90c.
      	* doc/install.texi: Likewise.
      	* doc/invoke.texi: Likewise.
      
      libgomp/ChangeLog:
      
      	* plugin/plugin-gcn.c (isa_hsa_name): Handle EF_AMDGPU_MACH_AMDGCN_GFX90c.
      	(isa_code): Handle gfx90c.
      	(max_isa_vgprs): Handle EF_AMDGPU_MACH_AMDGCN_GFX90c.
      
      Signed-off-by: default avatarFrederik Harwath <frederik@harwath.name>
      b8e9fd53
    • Haochen Jiang's avatar
      i386: Fix array index overflow in pr105354-2.c · 4a2e55b3
      Haochen Jiang authored
      The array index should not be over 8 for v8hi, or it will fail
      under -O0 or using -fstack-protector.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/110621
      	* gcc.target/i386/pr105354-2.c: As mentioned.
      4a2e55b3
    • GCC Administrator's avatar
      Daily bump. · 9353f6f4
      GCC Administrator authored
      9353f6f4
  2. Apr 25, 2024
    • David Faust's avatar
      bpf: set PREFERRED_DEBUGGING_TYPE to BTF_DEBUG · 1604f7ce
      David Faust authored
      BTF is the standard debug info used with BPF programs, so it makes sense
      to default to BTF rather than DWARF.
      
      gcc/
      	* config/bpf/bpf.h (PREFERRED_DEBUGGING_TYPE): Set to BTF_DEBUG.
      
      gcc/testsuite/
      	* gcc.target/bpf/bpf-debug-options-1.c: New test.
      	* gcc.target/bpf/bpf-debug-options-2.c: Likewise.
      	* gcc.target/bpf/bpf-debug-options-3.c: Likewise.
      	* gcc.target/bpf/core-options-4.c: Likewise.
      1604f7ce
    • Jakub Jelinek's avatar
      c++: Fix constexpr evaluation of parameters passed by invisible reference [PR111284] · f541757b
      Jakub Jelinek authored
      My r9-6136 changes to make a copy of constexpr function bodies before
      genericization modifies it broke the constant evaluation of non-POD
      arguments passed by value.
      In the callers such arguments are passed as reference to usually a
      TARGET_EXPR, but on the callee side until genericization they are just
      direct uses of a PARM_DECL with some class type.
      In cxx_bind_parameters_in_call I've used convert_from_reference to
      pretend it is passed by value and then cxx_eval_constant_expression
      is called there and evaluates that as an rvalue, followed by
      adjust_temp_type if the types don't match exactly (e.g. const Foo
      argument and passing to it reference to Foo TARGET_EXPR).
      
      The reason this doesn't work is that when the TARGET_EXPR in the caller
      is constant initialized, this for it is the address of the TARGET_EXPR_SLOT,
      but if the code later on pretends the PARM_DECL is just initialized to the
      rvalue of the constant evaluation of the TARGET_EXPR, it is as if there
      is a bitwise copy of the TARGET_EXPR to the callee, so this in the callee
      is then address of the PARM_DECL in the callee.
      
      The following patch attempts to fix that by constexpr evaluation of such
      arguments in the caller as an lvalue instead of rvalue, and on the callee
      side when seeing such a PARM_DECL, if we want an lvalue, lookup the value
      (lvalue) saved in ctx->globals (if any), and if wanting an rvalue,
      recursing with vc_prvalue on the looked up value (because it is there
      as an lvalue, nor rvalue).
      
      adjust_temp_type doesn't work for lvalues of non-scalarish types, for
      such types it relies on changing the type of a CONSTRUCTOR, but on the
      other side we know what we pass to the argument is addressable, so
      the patch on type mismatch takes address of the argument value, casts
      to reference to the desired type and dereferences it.
      
      2024-04-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/111284
      	* constexpr.cc (cxx_bind_parameters_in_call): For PARM_DECLs with
      	TREE_ADDRESSABLE types use vc_glvalue rather than vc_prvalue for
      	cxx_eval_constant_expression and if it doesn't have the same
      	type as it should, cast the reference type to reference to type
      	before convert_from_reference and instead of adjust_temp_type
      	take address of the arg, cast to reference to type and then
      	convert_from_reference.
      	(cxx_eval_constant_expression) <case PARM_DECL>: For lval case
      	on parameters with TREE_ADDRESSABLE types lookup result in
      	ctx->globals if possible.  Otherwise if lookup in ctx->globals
      	was successful for parameter with TREE_ADDRESSABLE type,
      	recurse with vc_prvalue on the returned value.
      
      	* g++.dg/cpp1z/constexpr-111284.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime7.C: Expect one error on a different
      	line.
      f541757b
    • Jakub Jelinek's avatar
      libgcc: Don't use weakrefs for glibc 2.34 · fe02f6ca
      Jakub Jelinek authored
      glibc 2.34 and later doesn't have separate libpthread (libpthread.so.0 is a
      dummy shared library with just some symbol versions for compatibility, but
      all the pthread_* APIs are in libc.so.6).
      So, we don't need to do the .weakref dances to check whether a program
      has been linked with -lpthread or not, in dynamically linked apps those
      will be always true anyway.
      In -static linking, this fixes various issues people had when only linking
      some parts of libpthread.a and getting weird crashes.  A hack for that was
      what e.g. some Fedora glibcs used, where libpthread.a was a library
      containing just one giant *.o file which had all the normal libpthread.a
      *.o files linked with -r together.
      
      libstdc++-v3 actually does something like this already since r10-10928,
      the following patch is meant to fix it even for libgfortran, libobjc and
      whatever else uses gthr.h.
      
      2024-04-25  Jakub Jelinek  <jakub@redhat.com>
      
      	* gthr.h (GTHREAD_USE_WEAK): Redefine to 0 for GLIBC 2.34 or later.
      fe02f6ca
    • Jakub Jelinek's avatar
      c++: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208] · c39654e7
      Jakub Jelinek authored
      When expand_or_defer_fn is called at_eof time, it calls import_export_decl
      and then maybe_clone_body, which uses DECL_ONE_ONLY and comdat name in a
      couple of places to try to optimize cdtors which are known to have the
      same body by making the complete cdtor an alias to base cdtor (and in
      that case also uses *[CD]5* as comdat group name instead of the normal
      comdat group names specific to each mangled name).
      Now, this optimization depends on DECL_ONE_ONLY and DECL_INTERFACE_KNOWN,
      maybe_clone_body and can_alias_cdtor use:
            if (DECL_ONE_ONLY (fn))
              cgraph_node::get_create (clone)->set_comdat_group (cxx_comdat_group (clone));
      ...
        bool can_alias = can_alias_cdtor (fn);
      ...
            /* Tell cgraph if both ctors or both dtors are known to have
               the same body.  */
            if (can_alias
                && fns[0]
                && idx == 1
                && cgraph_node::get_create (fns[0])->create_same_body_alias
                     (clone, fns[0]))
              {
                alias = true;
                if (DECL_ONE_ONLY (fns[0]))
                  {
                    /* For comdat base and complete cdtors put them
                       into the same, *[CD]5* comdat group instead of
                       *[CD][12]*.  */
                    comdat_group = cdtor_comdat_group (fns[1], fns[0]);
                    cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group);
                    if (symtab_node::get (clone)->same_comdat_group)
                      symtab_node::get (clone)->remove_from_same_comdat_group ();
                    symtab_node::get (clone)->add_to_same_comdat_group
                      (symtab_node::get (fns[0]));
                  }
              }
      and
        /* Don't use aliases for weak/linkonce definitions unless we can put both
           symbols in the same COMDAT group.  */
        return (DECL_INTERFACE_KNOWN (fn)
                && (SUPPORTS_ONE_ONLY || !DECL_WEAK (fn))
                && (!DECL_ONE_ONLY (fn)
                    || (HAVE_COMDAT_GROUP && DECL_WEAK (fn))));
      The following testcase regressed with Marek's r14-5979 change,
      when pr113208_0.C is compiled where the ctor is marked constexpr,
      we no longer perform this optimization, where
      _ZN6vectorI12QualityValueEC2ERKS1_ was emitted in the
      _ZN6vectorI12QualityValueEC5ERKS1_ comdat group and
      _ZN6vectorI12QualityValueEC1ERKS1_ was made an alias to it,
      instead we emit _ZN6vectorI12QualityValueEC2ERKS1_ in
      _ZN6vectorI12QualityValueEC2ERKS1_ comdat group and the same
      content _ZN6vectorI12QualityValueEC1ERKS1_ as separate symbol in
      _ZN6vectorI12QualityValueEC1ERKS1_ comdat group.
      Now, the linker seems to somehow cope with that, eventhough it
      probably keeps both copies of the ctor, but seems LTO can't cope
      with that and Honza doesn't know what it should do in that case
      (linker decides that the prevailing symbol is
      _ZN6vectorI12QualityValueEC2ERKS1_ (from the
      _ZN6vectorI12QualityValueEC2ERKS1_ comdat group) and
      _ZN6vectorI12QualityValueEC1ERKS1_ alias (from the other TU,
      from _ZN6vectorI12QualityValueEC5ERKS1_ comdat group)).
      
      Note, the case where some constructor is marked constexpr in one
      TU and not in another one happens pretty often in libstdc++ when
      one mixes -std= flags used to compile different compilation units.
      
      The reason the optimization doesn't trigger when the constructor is
      constexpr is that expand_or_defer_fn is called in that case much earlier
      than when it is not constexpr; in the former case it is called when we
      try to constant evaluate that constructor.  But DECL_INTERFACE_KNOWN
      is false in that case and comdat_linkage hasn't been called either
      (I think it is desirable, because comdat group is stored in the cgraph
      node and am not sure it is a good idea to create cgraph nodes for
      something that might not be needed later on at all), so maybe_clone_body
      clones the bodies, but doesn't make them as aliases.
      
      The following patch is an attempt to redo this optimization when
      import_export_decl is called at_eof time on the base/complete cdtor
      (or deleting dtor).  It will not do anything if maybe_clone_body
      hasn't been called uyet (the TREE_ASM_WRITTEN check on the
      DECL_MAYBE_IN_CHARGE_CDTOR_P), or when one or both of the base/complete
      cdtors have been lowered already, or when maybe_clone_body called
      maybe_thunk_body and it was successful.  Otherwise retries the
      can_alias_cdtor check and makes the complete cdtor alias to the
      base cdtor with adjustments to the comdat group.
      
      2024-04-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR lto/113208
      	* cp-tree.h (maybe_optimize_cdtor): Declare.
      	* decl2.cc (import_export_decl): Call it for cloned cdtors.
      	* optimize.cc (maybe_optimize_cdtor): New function.
      
      	* g++.dg/abi/comdat2.C: New test.
      	* g++.dg/abi/comdat5.C: New test.
      	* g++.dg/lto/pr113208_0.C: New test.
      	* g++.dg/lto/pr113208_1.C: New file.
      	* g++.dg/lto/pr113208.h: New file.
      c39654e7
    • David Faust's avatar
      bpf: avoid issues with CO-RE and -gtoggle · f175622d
      David Faust authored
      Compiling a BPF program with CO-RE relocations (and BTF) while also
      passing -gtoggle led to an inconsistent state where CO-RE support was
      enabled but BTF would not be generated, and this was not caught by the
      existing option parsing.  This led to an ICE when generating the CO-RE
      relocation info, since BTF is required for CO-RE.
      
      Update bpf_option_override to avoid this case, and add a few tests for
      the interactions of these options.
      
      gcc/
      	* config/bpf/bpf.cc (bpf_option_override): Improve handling of CO-RE
      	options to avoid issues with -gtoggle.
      
      gcc/testsuite/
      	* gcc.target/bpf/core-options-1.c: New test.
      	* gcc.target/bpf/core-options-2.c: Likewise.
      	* gcc.target/bpf/core-options-3.c: Likewise.
      f175622d
    • Jakub Jelinek's avatar
      openmp: Copy DECL_LANG_SPECIFIC and DECL_LANG_FLAG_? to tree-nested decl copy [PR114825] · 14d48516
      Jakub Jelinek authored
      tree-nested.cc creates in 2 spots artificial VAR_DECLs, one of them is used
      both for debug info and OpenMP/OpenACC lowering purposes, the other solely for
      OpenMP/OpenACC lowering purposes.
      When the decls are used in OpenMP/OpenACC lowering, the OMP langhooks (mostly
      Fortran, C just a little and C++ doesn't have nested functions) then inspect
      the flags on the vars and based on that decide how to lower the corresponding
      clauses.
      
      Unfortunately we weren't copying DECL_LANG_SPECIFIC and DECL_LANG_FLAG_?, so
      the langhooks made decisions on the default flags on those instead.
      As the original decl isn't necessarily a VAR_DECL, could be e.g. PARM_DECL,
      using copy_node wouldn't work properly, so this patch just copies those
      flags in addition to other flags it was copying already.  And I've removed
      code duplication by introducing a helper function which does copying common
      to both uses.
      
      2024-04-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR fortran/114825
      	* tree-nested.cc (get_debug_decl): New function.
      	(get_nonlocal_debug_decl): Use it.
      	(get_local_debug_decl): Likewise.
      
      	* gfortran.dg/gomp/pr114825.f90: New test.
      14d48516
    • Jonathan Wakely's avatar
      libstdc++: Rename man pages to use '::' instead of '_' · 8d80e3c5
      Jonathan Wakely authored
      The Doxygen-generated man pages for some new types need to be renamed to
      use '::' instead of '_' in the filenames.
      
      libstdc++-v3/ChangeLog:
      
      	* scripts/run_doxygen: Rename man pages for nested types.
      Unverified
      8d80e3c5
    • Jonathan Wakely's avatar
      libstdc++: Fix typo in Doxygen comment · 6391cf8b
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/chrono (tzdb_list): Fix typo in Doxygen comment.
      Unverified
      6391cf8b
    • Jonathan Wakely's avatar
      libstdc++: Fix run_doxygen for Doxygen 1.10 man page format · c9cc1c85
      Jonathan Wakely authored
      Doxygen switched from \fC to \fR in its man page output:
      https://github.com/doxygen/doxygen/pull/10497
      
      This breaks our script that expects \fC so change the regaulr expression
      to work with either style.
      
      libstdc++-v3/ChangeLog:
      
      	* scripts/run_doxygen: Adjust sed pattern to match '\fR' for
      	new man output that Doxygen 1.10 generates.
      Unverified
      c9cc1c85
    • Jonathan Wakely's avatar
      libstdc++: Update Doxygen config for new headers · d5b2c6b3
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* doc/doxygen/stdheader.cc (init_map): Add missing headers.
      	* doc/doxygen/user.cfg.in (EXCLUDE): Exclude generated files for
      	std::format and std::text_encoding.
      Unverified
      d5b2c6b3
    • Jonathan Wakely's avatar
      libstdc++: Add comment to #include in <variant> · f3021e6e
      Jonathan Wakely authored
      It's not obvious why <variant> needs <bits/parse_numbers.h> so add a
      comment to it.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/variant: Add comment to #include.
      Unverified
      f3021e6e
    • Gaius Mulley's avatar
      PR modula2/114836 Avoid concatenation of error strings to aid error locale translation · d0e1e129
      Gaius Mulley authored
      
      This patch avoids a concatenation of error strings making locale
      translation of the error message easier.
      
      gcc/m2/ChangeLog:
      
      	PR modula2/114836
      	* gm2-compiler/M2Range.mod (FoldTypeAssign): Avoid error
      	string concatenation.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      d0e1e129
    • Jose E. Marchesi's avatar
      bpf: default to using pseudo-C assembly syntax by default · c96c2a30
      Jose E. Marchesi authored
      At this point the kernel headers that almost all BPF programs use
      contain pseudo-C inline assembly and having the GNU toolchain using
      the conventional assembly syntax by default would force users to
      specify the command-line option explicitly almost all of the time,
      which is very inconvenient.
      
      This patch changes GCC in order to recognize and generate the pseudo-C
      assembly syntax of BPF by default.  The ASM_SPEC is adapted
      accordingly, and in a way that the current release of the BPF
      assembler (which still expects conventional assembler syntax by
      default) does the right thing.
      
      Tested in bpf-unknown-none-bpf target and x86_64-linux-gnu host.
      No regressions.
      
      gcc/ChangeLog
      
      	* config/bpf/bpf.opt: Use ASM_PSEUDOC for the default value of
      	-masm.
      	* config/bpf/bpf.h (ASM_SPEC): Adapt accordingly.
      	* doc/invoke.texi (eBPF Options): Update.
      
      gcc/testsuite/ChangeLog
      
      	* gcc.target/bpf/alu-1.c: Specify conventional asm dialect.
      	* gcc.target/bpf/xbpf-indirect-call-1.c: Likewise.
      	* gcc.target/bpf/sync-fetch-and-add.c: Likewise.
      	* gcc.target/bpf/smov-2.c: Likewise.
      	* gcc.target/bpf/smov-1.c: Likewise.
      	* gcc.target/bpf/smod-1.c: Likewise.
      	* gcc.target/bpf/sload-1.c: Likewise.
      	* gcc.target/bpf/sdiv-1.c: Likewise.
      	* gcc.target/bpf/nop-1.c: Likewise.
      	* gcc.target/bpf/neg-1.c: Likewise.
      	* gcc.target/bpf/ldxdw.c: Likewise.
      	* gcc.target/bpf/jmp-1.c: Likewise.
      	* gcc.target/bpf/inline-memops-threshold-1.c: Likewise.
      	* gcc.target/bpf/float-1.c: Likewise.
      	* gcc.target/bpf/double-2.c: Likewise.
      	* gcc.target/bpf/double-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-type-id.c: Likewise.
      	* gcc.target/bpf/core-builtin-type-based.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-size-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-sign-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-sign-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-rshift-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-rshift-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-offset-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-lshift-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-lshift-1-le.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-lshift-1-be.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-existence-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-errors-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-errors-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-fieldinfo-const-elimination.c:
      	Likewise.
      	* gcc.target/bpf/core-builtin-exprlist-4.c: Likewise.
      	* gcc.target/bpf/core-builtin-exprlist-3.c: Likewise.
      	* gcc.target/bpf/core-builtin-exprlist-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-exprlist-1.c: Likewise.
      	* gcc.target/bpf/core-builtin-enumvalue-opt.c: Likewise.
      	* gcc.target/bpf/core-builtin-enumvalue-errors.c: Likewise.
      	* gcc.target/bpf/core-builtin-enumvalue.c: Likewise.
      	* gcc.target/bpf/core-builtin-3.c: Likewise.
      	* gcc.target/bpf/core-builtin-2.c: Likewise.
      	* gcc.target/bpf/core-builtin-1.c: Likewise.
      	* gcc.target/bpf/core-attr-struct-as-array.c: Likewise.
      	* gcc.target/bpf/core-attr-6.c: Likewise.
      	* gcc.target/bpf/core-attr-5.c: Likewise.
      	* gcc.target/bpf/core-attr-4.c: Likewise.
      	* gcc.target/bpf/core-attr-3.c: Likewise.
      	* gcc.target/bpf/core-attr-2.c: Likewise.
      	* gcc.target/bpf/core-attr-1.c: Likewise.
      	* gcc.target/bpf/builtin-load.c: Likewise.
      	* gcc.target/bpf/btfext-funcinfo-nocore.c: Likewise.
      	* gcc.target/bpf/btfext-funcinfo.c: Likewise.
      	* gcc.target/bpf/bswap-1.c: Likewise.
      	* gcc.target/bpf/bswap-2.c: Likewise.
      	* gcc.target/bpf/attr-kernel-helper.c: Likewise.
      	* gcc.target/bpf/atomic-xchg-2.c: Likewise.
      	* gcc.target/bpf/atomic-xchg-1.c: Likewise.
      	* gcc.target/bpf/atomic-op-3.c: Likewise.
      	* gcc.target/bpf/atomic-op-2.c: Likewise.
      	* gcc.target/bpf/atomic-op-1.c: Likewise.
      	* gcc.target/bpf/atomic-fetch-op-3.c: Likewise.
      	* gcc.target/bpf/atomic-fetch-op-2.c: Likewise.
      	* gcc.target/bpf/atomic-fetch-op-1.c: Likewise.
      	* gcc.target/bpf/atomic-cmpxchg-2.c: Likewise.
      	* gcc.target/bpf/atomic-cmpxchg-1.c: Likewise.
      	* gcc.target/bpf/alu-2.c: Likewise.
      c96c2a30
    • Richard Ball's avatar
      arm: Zero/Sign extends for CMSE security · ad450861
      Richard Ball authored
      Co-Authored by: Andre Simoes Dias Vieira <Andre.SimoesDiasVieira@arm.com>
      
      This patch makes the following changes:
      
      1) When calling a secure function from non-secure code then any arguments
         smaller than 32-bits that are passed in registers are zero- or sign-extended.
      2) After a non-secure function returns into secure code then any return value
         smaller than 32-bits that is passed in a register is  zero- or sign-extended.
      
      This patch addresses the following CVE-2024-0151.
      
      gcc/ChangeLog:
      	PR target/114837
      	* config/arm/arm.cc (cmse_nonsecure_call_inline_register_clear):
      	Add zero/sign extend.
      	(arm_expand_prologue): Add zero/sign extend.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/arm/cmse/extend-param.c: New test.
      	* gcc.target/arm/cmse/extend-return.c: New test.
      ad450861
    • Gaius Mulley's avatar
      modula2: issue the parameter incompatibility error message based on dialect · 070dd5c8
      Gaius Mulley authored
      
      This tiny patch improves the parameter incompatibility error message by
      having a different message for the dialect chosen mentioning the specific
      violation.  PIM uses assignment rules for pass by value and expression
      rules for pass by reference.  ISO uses expression type checking for
      pass by value and pass by reference.
      
      gcc/m2/ChangeLog:
      
      	* gm2-compiler/M2FileName.def (CalculateFileName): Remove
      	quoted string in comment.
      	* gm2-compiler/M2Range.mod (FoldTypeParam): Generate dialect
      	specific parameter incompatibility error message.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      070dd5c8
    • Richard Biener's avatar
      tree-optimization/114792 - order loops to unloops in CH · 59ff8183
      Richard Biener authored
      When we use unloop_loops we have to make sure to have loops ordered
      inner to outer as otherwise we can wreck inner loop structure where
      unlooping relies on that being intact.  The following re-sorts the
      vector of to unloop loops after copy-header as that adds to the
      vector in two places and the wrong order.
      
      	PR tree-optimization/114792
      	* tree-ssa-loop-ch.cc (ch_order_loops): New function.
      	(ch_base::copy_headers): Sort loops to unloop inner-to-outer.
      
      	* gcc.dg/torture/pr114792.c: New testcase.
      59ff8183
    • Eric Botcazou's avatar
      Fix calling convention incompatibility with vendor compiler · 1d238c84
      Eric Botcazou authored
      For the 20th anniversary of https://gcc.gnu.org/gcc-3.4/sparc-abi.html,
      a new calling convention incompatibility with the vendor compiler (and
      the ABI) has been discovered in 64-bit mode, affecting small structures
      containing arrays of floating-point components.  The decision has been
      made to fix it on Solaris only at this point.
      
      gcc/
      	PR target/114416
      	* config/sparc/sparc.h (SUN_V9_ABI_COMPATIBILITY): New macro.
      	* config/sparc/sol2.h (SUN_V9_ABI_COMPATIBILITY): Redefine it.
      	* config/sparc/sparc.cc (fp_type_for_abi): New predicate.
      	(traverse_record_type): Use it to spot floating-point types.
      	(compute_fp_layout): Also deal with array types.
      
      gcc/testsuite/
      	* gcc.target/sparc/small-struct-1.c: New test.
      	* gcc.target/sparc/pr105573.c: Rename to...
      	* gcc.target/sparc/20230425-1.c: ...this.
      	* gcc.target/sparc/pr109541.c: Rename to...
      	* gcc.target/sparc/20230607-1.c: ...this
      1d238c84
    • Pan Li's avatar
      RISC-V: Add test cases for insn does not satisfy its constraints [PR114714] · af7d981b
      Pan Li authored
      
      We have one ICE when RVV register overlap is enabled.  We reverted this
      feature as it is in stage 4 and there is no much time to figure a better
      solution for this.  Thus, for now add the related test cases which will
      trigger ICE when register overlap enabled.
      
      This will gate the RVV register overlap support in GCC-15.
      
      	PR target/114714
      
      gcc/testsuite/ChangeLog:
      
      	* g++.target/riscv/rvv/base/pr114714-1.C: New test.
      	* g++.target/riscv/rvv/base/pr114714-2.C: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      Co-Authored-by: default avatarKito Cheng <kito.cheng@sifive.com>
      af7d981b
    • Pan Li's avatar
      RISC-V: Add early clobber to the dest of vwsll · 10ad46bc
      Pan Li authored
      
      We missed the existing early clobber for the dest operand of vwsll
      pattern when resolve the conflict of revert register overlap.  Thus
      add it back to the pattern.  Unfortunately, we have no test to cover
      this part and will improve this after GCC-15 open.
      
      The below tests are passed for this patch:
      * The rv64gcv fully regression test with isl build.
      
      gcc/ChangeLog:
      
      	* config/riscv/vector-crypto.md: Add early clobber to the
      	dest operand of vwsll.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      10ad46bc
    • Paul Thomas's avatar
      Fortran: Fix ICE in gfc_trans_create_temp_array from bad type [PR93678] · c058105b
      Paul Thomas authored
      2024-04-25  Paul Thomas  <pault@gcc.gnu.org>
      
      gcc/fortran
      	PR fortran/93678
      	* trans-expr.cc (gfc_conv_procedure_call): Use the interface,
      	where possible, to obtain the type of character procedure
      	pointers of class entities.
      
      gcc/testsuite/
      	PR fortran/93678
      	* gfortran.dg/pr93678.f90: New test.
      c058105b
    • Paul Thomas's avatar
      Fortran: Generate new charlens for shared symbol typespecs [PR89462] · 1fd5a074
      Paul Thomas authored
      2024-04-25  Paul Thomas  <pault@gcc.gnu.org>
      	    Jakub Jelinek  <jakub@gcc.gnu.org>
      
      gcc/fortran
      	PR fortran/89462
      	* decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
      	is greater than 1, gfc_new_charlen is called to generate a new
      	charlen, registered in the symbol namespace.
      	(variable_decl, enumerator_decl): Set the new argument in the
      	calls to build_sym.
      
      gcc/testsuite/
      	PR fortran/89462
      	* gfortran.dg/pr89462.f90: New test.
      1fd5a074
    • Haochen Gui's avatar
      rs6000: Use bcdsub. instead of bcdadd. for bcd invalid number checking · 09680e3e
      Haochen Gui authored
      bcdadd. might causes overflow which also set the overflow/invalid bit.
      bcdsub. doesn't have the issue when do subtracting on two same bcd number.
      
      gcc/
      	* config/rs6000/altivec.md (*bcdinvalid_<mode>): Replace bcdadd
      	with bcdsub.
      	(bcdinvalid_<mode>): Likewise.
      
      gcc/testsuite/
      	* gcc.target/powerpc/bcd-4.c: Adjust the number of bcdadd and
      	bcdsub.
      09680e3e
    • Pan Li's avatar
      RISC-V: Add xfail test case for highpart register overlap of vwcvt · d44c2052
      Pan Li authored
      
      We reverted below patch for register group overlap, add the related
      insn test and mark it as xfail.  And we will remove the xfail
      after we support the register overlap in GCC-15.
      
      bdad036d RISC-V: Support highpart register overlap for vwcvt
      
      The below test suites are passed for this patch
      * The rv64gcv fully regression test with isl build.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/pr112431-1.c: New test.
      	* gcc.target/riscv/rvv/base/pr112431-2.c: New test.
      	* gcc.target/riscv/rvv/base/pr112431-3.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      d44c2052
    • GCC Administrator's avatar
      Daily bump. · 5123cfa6
      GCC Administrator authored
      5123cfa6
  3. Apr 24, 2024
    • Patrick Palka's avatar
      c++/modules testsuite: restrict expensive pr99023 test · 26a3edbe
      Patrick Palka authored
      
      The pr99023 testcase uses --param=ggc-min-expand=0 which forces a GC
      during every collection point and consequently is very slow to run,
      and ends up being the main bottleneck of the modules.exp testsuite.
      
      So this patch restricts this test to run once, in C++20 mode, instead of
      multiple times (C++17, C++20 and C++23 mode by default).  After this
      patch the modules.exp testsuite finishes in 3m instead of 3m40s with -j8
      on my machine.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/modules/pr99023_a.X: Run only in C++20 mode.
      	* g++.dg/modules/pr99023_b.X: Likewise.
      
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      26a3edbe
    • Patrick Palka's avatar
      c++: constexpr union member access folding [PR114709] · 0844170e
      Patrick Palka authored
      
      The object/offset canonicalization performed in cxx_fold_indirect_ref
      is undesirable for union member accesses because it loses information
      about the member being accessed which we may later need to diagnose an
      inactive-member access.  So this patch restricts the canonicalization
      accordingly.
      
      	PR c++/114709
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
      	canonicalization to RECORD_TYPE member accesses.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/constexpr-union8.C: New test.
      
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      0844170e
    • Jakub Jelinek's avatar
      v2: DOCUMENTATION_ROOT_URL vs. release branches [PR114738] · 97a54c05
      Jakub Jelinek authored
      This patch moves the documentation root URL infix for release branches
      from get_option_url/make_doc_url to configure, such that only the default
      changes and when users specify a custom documentation root URL, they don't
      have to add gcc-MAJOR.MINOR.0 subdirectories for release branches.
      
      Tested by checking
      ../configure --disable-bootstrap --enable-languages=c --disable-multilib
      built trunk on
      void
      foo (int x)
      {
        __builtin_printf ("%ld\n", x);
      }
      testcase and looking for the URL in there, then repeating that after
      changing gcc/BASE-VER to 14.1.0 and again after changing it to 14.1.1,
      plus normal bootstrap/regtest.
      
      2024-04-24  Jakub Jelinek  <jakub@redhat.com>
      
      	PR other/114738
      	* opts.cc (get_option_url): Revert 2024-04-17 changes.
      	* gcc-urlifier.cc: Don't include diagnostic-core.h.
      	(gcc_urlifier::make_doc_url): Revert 2024-04-17 changes.
      	* configure.ac (documentation-root-url): On release branches
      	append gcc-MAJOR.MINOR.0/ to the default DOCUMENTATION_ROOT_URL.
      	* doc/install.texi (--with-documentation-root-url=): Document
      	the change of the default.
      	* configure: Regenerate.
      97a54c05
    • Pan Li's avatar
      Revert "RISC-V: Support highpart register overlap for vwcvt" · bc17a923
      Pan Li authored
      This reverts commit bdad036d.
      bc17a923
    • Jose E. Marchesi's avatar
      bpf: define BPF feature pre-processor macros · 152d945d
      Jose E. Marchesi authored
      This commit makes the BPF backend to define the following macros for
      c-family languages:
      
        __BPF_CPU_VERSION__
      
          This is a numeric value identifying the version of the BPF "cpu"
          for which GCC is generating code.
      
        __BPF_FEATURE_ALU32
        __BPF_FEATURE_JMP32
        __BPF_FEATURE_JMP_EXT
        __BPF_FEATURE_BSWAP
        __BPF_FEATURE_SDIV_SMOD
        __BPF_FEATURE_MOVSX
        __BPF_FEATURE_LDSX
        __BPF_FEATURE_GOTOL
        __BPF_FEATURE_ST
      
          These are defines if the corresponding "feature" is enabled.  The
          features are implicitly enabled by the BPF CPU version enabled,
          and most of them can also be enabled/disabled using
          target-specific -m[no-]FEATURE command line switches.
      
      Note that this patch moves the definition of bpf_target_macros, that
      implements TARGET_CPU_CPP_BUILTINS in the BPF backend, to a bpf-c.cc
      file.  This is because we are now using facilities from c-family/* and
      these features are not available in compilers like lto1.
      
      A couple of tests are also added.
      Tested in target bpf-unknown-none-gcc and host x86_64-linux-gnu.
      No regressions.
      
      gcc/ChangeLog
      
      	* config.gcc: Add bpf-c.o as a target object for C and C++.
      	* config/bpf/bpf.cc (bpf_target_macros): Move to bpf-c.cc.
      	* config/bpf/bpf-c.cc: New file.
      	(bpf_target_macros): Move from bpf.cc and define BPF CPU
      	feature	macros.
      	* config/bpf/t-bpf: Add rules to build bpf-c.o.
      
      gcc/testsuite/ChangeLog
      
      	* gcc.target/bpf/feature-macro-1.c: New test.
      	* gcc.target/bpf/feature-macro-2.c: Likewise.
      152d945d
    • Richard Biener's avatar
      tree-optimization/114787 - more careful loop update with CFG cleanup · cc48418c
      Richard Biener authored
      When CFG cleanup removes a backedge we have to be more careful with
      loop update.  In particular we need to clear niter info and estimates
      and if we remove the last backedge of a loop we have to also mark
      it for removal to prevent a following basic block merging to associate
      loop info with an unrelated header.
      
      	PR tree-optimization/114787
      	* tree-cfg.cc (remove_edge_and_dominated_blocks): When
      	removing a loop backedge clear niter info and when removing
      	the last backedge of a loop mark that loop for removal.
      
      	* gcc.dg/torture/pr114787.c: New testcase.
      cc48418c
    • Richard Biener's avatar
      tree-optimization/114832 - wrong dominator info with vect peeling · e28e8ab1
      Richard Biener authored
      When we update the dominator of the redirected exit after peeling
      we check whether the immediate dominator was the loop header rather
      than the exit source when we later want to just update it to the
      new source.  The following fixes this oversight.
      
      	PR tree-optimization/114832
      	* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
      	Fix dominance check.
      
      	* gcc.dg/vect/pr114832.c: New testcase.
      e28e8ab1
    • Haochen Jiang's avatar
      i386: Fix behavior for both using AVX10.1-256 in options and function attribute · d279c9d8
      Haochen Jiang authored
      When we are using -mavx10.1-256 in command line and avx10.1-256 in
      target attribute together, zmm should never be generated. But current
      GCC will generate zmm since it wrongly enables EVEX512 for non-explicitly
      set AVX512. This patch will fix that issue.
      
      gcc/ChangeLog:
      
      	* config/i386/i386-options.cc (ix86_valid_target_attribute_tree):
      	Check whether AVX512F is explicitly enabled.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/avx10_1-24.c: New test.
      d279c9d8
    • Pan Li's avatar
      RISC-V: Add xfail test case for highpart overlap of vext.vf · f9527459
      Pan Li authored
      
      We reverted below patch for register group overlap, add the related
      insn test and mark it as xfail.  And we will remove the xfail
      after we support the register overlap in GCC-15.
      
      62685890 RISC-V: Support highpart overlap for vext.vf
      
      The below test suites are passed for this patch
      * The rv64gcv fully regression test with isl build.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/unop_v_constraint-2.c: Adjust asm
      	check cond.
      	* gcc.target/riscv/rvv/base/pr112431-4.c: New test.
      	* gcc.target/riscv/rvv/base/pr112431-5.c: New test.
      	* gcc.target/riscv/rvv/base/pr112431-6.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      f9527459
    • Pan Li's avatar
      Revert "RISC-V: Support highpart overlap for vext.vf" · 8bcefc2d
      Pan Li authored
      This reverts commit 62685890.
      8bcefc2d
    • GCC Administrator's avatar
      Daily bump. · 3091f1df
      GCC Administrator authored
      3091f1df
Loading