Skip to content
Snippets Groups Projects
  1. Feb 28, 2025
    • Jakub Jelinek's avatar
      c++: Adjust #embed support for P1967R14 · b510c53b
      Jakub Jelinek authored
      Now that the #embed paper has been voted in, the following patch
      removes the pedwarn for C++26 on it (and adjusts pedwarn warning for
      older C++ versions) and predefines __cpp_pp_embed FTM.
      
      Also, the patch changes cpp_error to cpp_pedwarning with for C++
      -Wc++26-extensions guarding, and for C add -Wc11-c23-compat warning
      about #embed.
      
      I believe we otherwise implement everything in the paper already,
      except I'm really confused by the
       [Example:
      
       #embed <data.dat> limit(__has_include("a.h"))
      
       #if __has_embed(<data.dat> limit(__has_include("a.h")))
       // ill-formed: __has_include [cpp.cond] cannot appear here
       #endif
      
       — end example]
      part.  My reading of both C23 and C++ with the P1967R14 paper in
      is that the first case (#embed with __has_include or __has_embed in its
      clauses) is what is clearly invalid and so the ill-formed note should be
      for #embed.  And the __has_include/__has_embed in __has_embed is actually
      questionable.
      Both C and C++ have something like
      "The identifiers __has_include, __has_embed, and __has_c_attribute
      shall not appear in any context not mentioned in this subclause."
      or
      "The identifiers __has_include and __has_cpp_attribute shall not appear
      in any context not mentioned in this subclause."
      (into which P1967R14 adds __has_embed) in the conditional inclusion
      subclause.  #embed is defined in a different one, so using those in there
      is invalid (unless "using the rules specified for conditional inclusion"
      wording e.g. in limit clause overrides that).
      The reason why I think it is fuzzy for __has_embed is that __has_embed
      is actually defined in the Conditional inclusion subclause (so that
      would mean one can use __has_include, __has_embed and __has_*attribute
      in there) but its clauses are described in a different one.
      
      GCC currently accepts
       #embed __FILE__ limit (__has_include (<stdarg.h>))
       #if __has_embed (__FILE__ limit (__has_include (<stdarg.h>)))
       #endif
       #embed __FILE__ limit (__has_embed (__FILE__))
       #if __has_embed (__FILE__ limit (__has_embed (__FILE__)))
       #endif
      Note, it isn't just about limit clause, but also about
      prefix/suffix/if_empty, except that in those cases the "using the rules
      specified for conditional inclusion" doesn't apply.
      
      In any case, I'd hope that can be dealt with incrementally (and should
      be handled the same for both C and C++).
      
      2025-02-28  Jakub Jelinek  <jakub@redhat.com>
      
      libcpp/
      	* include/cpplib.h (enum cpp_warning_reason): Add
      	CPP_W_CXX26_EXTENSIONS enumerator.
      	* init.cc (lang_defaults): Set embed for GNUCXX26 and CXX26.
      	* directives.cc (do_embed): Adjust pedwarn wording for embed in C++,
      	use cpp_pedwarning instead of cpp_error and add CPP_W_C11_C23_COMPAT
      	warning of cpp_pedwarning hasn't diagnosed anything.
      gcc/c-family/
      	* c.opt (Wc++26-extensions): Add CppReason(CPP_W_CXX26_EXTENSIONS).
      	* c-cppbuiltin.cc (c_cpp_builtins): Predefine __cpp_pp_embed=202502
      	for C++26.
      gcc/testsuite/
      	* g++.dg/cpp/embed-1.C: Adjust for pedwarn wording change and don't
      	expect any error for C++26.
      	* g++.dg/cpp/embed-2.C: Adjust for pedwarn wording change and don't
      	expect any warning for C++26.
      	* g++.dg/cpp26/feat-cxx26.C: Test __cpp_pp_embed value.
      	* gcc.dg/cpp/embed-17.c: New test.
      b510c53b
    • Richard Biener's avatar
      lto/91299 - weak definition inlined with LTO · bc34db5b
      Richard Biener authored
      The following fixes a thinko in the handling of interposed weak
      definitions which confused the interposition check in
      get_availability by setting DECL_EXTERNAL too early.
      
      	PR lto/91299
      gcc/lto/
      	* lto-symtab.cc (lto_symtab_merge_symbols): Set DECL_EXTERNAL
      	only after calling get_availability.
      
      gcc/testsuite/
      	* gcc.dg/lto/pr91299_0.c: New testcase.
      	* gcc.dg/lto/pr91299_1.c: Likewise.
      bc34db5b
    • Richard Biener's avatar
      ipa/111245 - bogus modref analysis for store in call that might throw · e6037af6
      Richard Biener authored
      We currently record a kill for
      
        *x_4(D) = always_throws ();
      
      because we consider the store always executing since the appropriate
      check for whether the stmt could throw is guarded by
      !cfun->can_throw_non_call_exceptions.
      
      	PR ipa/111245
      	* ipa-modref.cc (modref_access_analysis::analyze_store): Do
      	not guard the check of whether the stmt could throw by
      	cfun->can_throw_non_call_exceptions.
      
      	* g++.dg/torture/pr111245.C: New testcase.
      e6037af6
    • Jakub Jelinek's avatar
      ifcvt: Fix ICE with (fix:SI (fix:DF (reg:DF))) [PR117712] · 26e4783c
      Jakub Jelinek authored
      As documented in the manual, FIX/UNSIGNED_FIX from floating point
      mode to integral mode has unspecified rounding and FIX from floating point
      mode to the same floating point mode is expressing rounding toward zero.
      So, some targets (arc, arm, csky, m68k, mmix, nds32, pdp11, sparc and
      visium) use
      (fix:SI (fix:SF (match_operand:SF 1 "..._operand")))
      etc. to express the rounding toward zero during conversion to integer.
      For some reason other targets don't use that.
      
      Anyway, the 2 FIXes (or inner FIX with outer UNSIGNED_FIX) cause problems
      since the r15-2890 which removed some strict checks in ifcvt.cc on what
      SET_SRC can be actually conditionalized (I must say I'm still worried
      about the change, don't know why one can't get e.g. inline asm or
      something with UNSPEC or some complex backend specific RTLs that
      force_operand can't handle), force_operand just ICEs on it, it can only
      handle (through expand_fix) conversions from floating point to integral.
      
      The following patch fixes this by detecting this case and just pretend
      the inner FIX isn't there, i.e. call expand_fix with the inner FIX's
      operand instead, which works and on targets like arm it will just
      create the nested FIXes again.
      
      2025-02-28  Jakub Jelinek  <jakub@redhat.com>
      
      	PR rtl-optimization/117712
      	* expr.cc (force_operand): Handle {,UNSIGNED_}FIX with
      	FIX operand using expand_fix on the inner FIX operand.
      
      	* gcc.dg/pr117712.c: New test.
      26e4783c
    • Richard Biener's avatar
      tree-optimization/87984 - hard register assignments not preserved · 535115ca
      Richard Biener authored
      The following disables redundant store elimination to hard register
      variables which isn't valid.
      
      	PR tree-optimization/87984
      	* tree-ssa-dom.cc (dom_opt_dom_walker::optimize_stmt): Do
      	not perform redundant store elimination to hard register
      	variables.
      	* tree-ssa-sccvn.cc (eliminate_dom_walker::eliminate_stmt):
      	Likewise.
      
      	* gcc.target/i386/pr87984.c: New testcase.
      535115ca
    • Richard Biener's avatar
      middle-end/66279 - gimplification clobbers shared asm constraints · 95f5d6cc
      Richard Biener authored
      When the C++ frontend clones a CTOR we do not copy ASM_EXPR constraints
      fully as walk_tree does not recurse to TREE_PURPOSE of TREE_LIST nodes.
      At this point doing that seems too dangerous so the following instead
      avoids gimplification of ASM_EXPRs to clobber the shared constraints
      and unshares it there, like it also unshares TREE_VALUE when it
      re-writes a "+" output constraint to separate "=" output and matching
      input constraint.
      
      	PR middle-end/66279
      	* gimplify.cc (gimplify_asm_expr): Copy TREE_PURPOSE before
      	rewriting it for "+" processing.
      
      	* g++.dg/pr66279.C: New testcase.
      95f5d6cc
    • Jakub Jelinek's avatar
      testsuite: Remove -m32 from another i386/ test · 616d1bd1
      Jakub Jelinek authored
      I found another test which uses -m32 in gcc.target/i386/ .  Similarly
      to the previously posted test, the test ought to be tested during i686-linux
      testing or x86_64-linux test with --target_board=unix\{-m32,-m64\}
      There is nothing ia32 specific on the test, so I've just dropped the -m32.
      
      2025-02-28  Jakub Jelinek  <jakub@redhat.com>
      
      	* gcc.target/i386/strub-pr118006.c: Remove -m32 from dg-options.
      616d1bd1
    • Jakub Jelinek's avatar
      testsuite: Fix up gcc.target/i386/pr118940.c test [PR118940] · 146cb828
      Jakub Jelinek authored
      The testcase uses -m32 in dg-options, something we try hard not to do,
      if something should be tested only for -m32, it is { target ia32 } test,
      if it can be tested for -m64/-mx32 too, just some extra options are
      needed for ia32, it should have dg-additional-options with ia32 target.
      
      Also, the test wasn't reduced, so I've reduced it using cvise and manual
      tweaks and verified the test still FAILs before r15-7700 and succeeds
      with current trunk.
      
      2025-02-28  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/118940
      	* gcc.target/i386/pr118940.c: Drop -w, -g and -m32 from dg-options, move
      	-march=i386 -mregparm=3 to dg-additional-options for ia32 and -fno-pie
      	to dg-additional-options for pie.  Reduce the test.
      146cb828
    • Andre Vehreschild's avatar
      Fortran: Ensure finalizer is called for unreferenced variable [PR118730] · c1606e38
      Andre Vehreschild authored
      	PR fortran/118730
      
      gcc/fortran/ChangeLog:
      
      	* resolve.cc: Mark unused derived type variable with finalizers
      	referenced to execute finalizer when leaving scope.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/class_array_15.f03: Remove unused variable.
      	* gfortran.dg/coarray_poly_7.f90: Adapt scan-tree-dump expr.
      	* gfortran.dg/coarray_poly_8.f90: Same.
      	* gfortran.dg/finalize_60.f90: New test.
      c1606e38
    • Giuseppe D'Angelo's avatar
      MAINTAINERS: add myself to write after approval and DCO · a3f77f25
      Giuseppe D'Angelo authored
      ChangeLog:
      
      	* MAINTAINERS: Added myself as write after approval and DCO.
      a3f77f25
    • H.J. Lu's avatar
      x86: Move TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P to i386.cc · 075611b6
      H.J. Lu authored
      
      Move the TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P target hook from
      i386.h to i386.cc.
      
      	* config/i386/i386.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P):
      	Moved to ...
      	* config/i386/i386.cc (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P):
      	Here.
      
      Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      075611b6
    • GCC Administrator's avatar
      Daily bump. · d880cb46
      GCC Administrator authored
      d880cb46
  2. Feb 27, 2025
    • Pan Li's avatar
      RISC-V: Fix bug for expand_const_vector interleave [PR118931] · e7287cbb
      Pan Li authored
      
      This patch would like to fix one bug when expanding const vector for the
      interleave case.  For example, we have:
      
      base1 = 151
      step = 121
      
      For vec_series, we will generate vector in format of v[i] = base + i * step.
      Then the vec_series will have below result for HImode, and we can find
      that the result overflow to the highest 8 bits of HImode.
      
      v1.b = {151, 255, 7,  0, 119,  0, 231,  0, 87,  1, 199,  1, 55,   2, 167,   2}
      
      Aka we expect v1.b should be:
      
      v1.b = {151, 0, 7,  0, 119,  0, 231,  0, 87,  0, 199,  0, 55,   0, 167,   0}
      
      After that it will perform the IOR with v2 for the base2(aka another series).
      
      v2.b =  {0,  17, 0, 33,   0, 49,   0, 65,  0, 81,   0, 97,  0, 113,   0, 129}
      
      Unfortunately, the base1 + i * step1 in HImode may overflow to the high
      8 bits, and the high 8 bits will pollute the v2 and result in incorrect
      value in const_vector.
      
      This patch would like to perform the overflow to smode check before the
      optimized interleave code generation.  If overflow or VLA, it will fall
      back to the default merge approach.
      
      The below test suites are passed for this patch.
      * The rv64gcv fully regression test.
      
      	PR target/118931
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-v.cc (expand_const_vector): Add overflow to
      	smode check and clean up highest bits if overflow.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/pr118931-run-1.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      e7287cbb
    • Iain Buclaw's avatar
      libphobos: Run unittest tests with dg-runtest. · 955de373
      Iain Buclaw authored
      Use `dg-runtest' test driver rather than `dg-test' to run the libphobos
      unittest testsuite, same as all other libphobos tests.  This prevents
      the tests from being ran multiple times when parallelized.
      
      Set `libphobos_test_name' as well so that all tests get a unique name.
      
      libphobos/ChangeLog:
      
      	* testsuite/libphobos.unittest/unittest.exp: Use `dg-runtest' rather
      	than `dg-test'.  Set `libphobos_test_name'.
      955de373
    • Jonathan Wakely's avatar
      libstdc++: Fix outdated comment in <stacktrace> · e8302282
      Jonathan Wakely authored
      My r15-998-g2a83084ce55363 change replaced the use of nothrow
      operator new with a call to __get_temporary_buffer, so update the
      comment to match.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/stacktrace (_Impl::_M_allocate): Fix outdated
      	comment.
      e8302282
    • Jakub Jelinek's avatar
      gimple-fold: Fix a pasto in fold_truth_andor_for_ifcombine [PR119030] · 8371e7f2
      Jakub Jelinek authored
      The following testcase is miscompiled since r15-7597.
      The left comparison is unsigned (x & 0x8000U) != 0) while the
      right one is signed (x >> 16) >= 0 and is actually a signbit test,
      so rsignbit is 64.
      After debugging this and reading the r15-7597 change, I believe there
      is just a pasto, the if (lsignbit) and if (rsignbit) blocks are pretty
      much identical with just the first l on all variables starting with l
      replaced with r (the only difference is that if (lsignbit) has a comment
      explaining the sign <<= 1; stuff, while it isn't repeated in the second one.
      Except the second one was using ll_unsignedp instead of rl_unsignedp
      in one spot.  I think it should use the latter, the signedness of the left
      comparison doesn't affect the other one, they are basically independent
      with the exception that we check that after transformations they are both
      EQ or both NE and later on we try to merge them together.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/119030
      	* gimple-fold.cc (fold_truth_andor_for_ifcombine): Fix a pasto,
      	ll_unsignedp -> rl_unsignedp.
      
      	* gcc.c-torture/execute/pr119030.c: New test.
      8371e7f2
    • Jakub Jelinek's avatar
      input: Fix up ICEs with --param=file-cache-files=N for N > 16 [PR118860] · 518def14
      Jakub Jelinek authored
      The following testcase ICEs, because we first construct file_cache object
      inside of *global_dc, then process options and then call file_cache::tune.
      The earlier construction allocates the m_file_slots array (using new)
      based on the static data member file_cache::num_file_slots, but then tune
      changes it, without actually reallocating all m_file_slots arrays in already
      constructed file_cache objects.
      
      I think it is just weird to have the count be a static data member and
      the pointer be non-static data member, that is just asking for issues like
      this.
      
      So, this patch changes num_file_slots into m_num_file_slots and turns tune
      into a non-static member function and changes toplev.cc to call it on the
      global_gc->get_file_cache () object.  And let's the tune just delete the
      array and allocate it freshly if there is a change in the number of slots
      or lines.
      
      Note, file_cache_slot has similar problem, but because there are many, I
      haven't moved the count into those objects; I just hope that when tune
      is called there is exactly one file_cache constructed and all the
      file_cache_slot objects constructed are pointed by its m_file_slots member,
      so also on lines change it just deletes it and allocates again.  I think
      it should be unlikely that the cache actually has any used slots by the time
      it is called.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/118860
      	* input.h (file_cache::tune): No longer static.  Rename argument
      	from num_file_slots_ to num_file_slots.  Formatting fix.
      	(file_cache::num_file_slots): Renamed to ...
      	(file_cache::m_num_file_slots): ... this.  No longer static.
      	* input.cc (file_cache_slot::tune): Change return type from void to
      	size_t, return previous file_cache_slot::line_record_size value.
      	Formatting fixes.
      	(file_cache::tune): Rename argument from num_file_slots_ to
      	num_file_slots.  Set m_num_file_slots rather than num_file_slots.
      	If m_num_file_slots or file_cache_slot::line_record_size changes,
      	delete[] m_file_slots and new it again.
      	(file_cache::num_file_slots): Remove definition.
      	(file_cache::lookup_file): Use m_num_file_slots rather than
      	num_file_slots.
      	(file_cache::evicted_cache_tab_entry): Likewise.
      	(file_cache::file_cache): Likewise.  Initialize m_num_file_slots
      	to 16.
      	(file_cache::dump): Use m_num_file_slots rather than num_file_slots.
      	(file_cache_slot::get_next_line): Formatting fixes.
      	(file_cache_slot::read_line_num): Likewise.
      	(get_source_text_between): Likewise.
      	* toplev.cc (toplev::main): Call global_dc->get_file_cache ().tune
      	rather than file_cache::tune.
      
      	* gcc.dg/pr118860.c: New test.
      518def14
    • Thomas Schwinge's avatar
      nvptx: '#define MAX_FIXED_MODE_SIZE 128' · e333ad4e
      Thomas Schwinge authored
      ... instead of 64 via 'gcc/defaults.h':
      
          MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
      
      This fixes ICEs:
      
          [-FAIL: c-c++-common/pr111309-1.c  -Wc++-compat  (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} c-c++-common/pr111309-1.c  -Wc++-compat  (test for excess errors)
          [-UNRESOLVED:-]{+PASS:+} c-c++-common/pr111309-1.c  -Wc++-compat  [-compilation failed to produce executable-]{+execution test+}
      
          [-FAIL: c-c++-common/pr111309-1.c  -std=gnu++17 (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++17 (test for excess errors)
          [-UNRESOLVED:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++17 [-compilation failed to produce executable-]{+execution test+}
          [-FAIL: c-c++-common/pr111309-1.c  -std=gnu++26 (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++26 (test for excess errors)
          [-UNRESOLVED:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++26 [-compilation failed to produce executable-]{+execution test+}
          [-FAIL: c-c++-common/pr111309-1.c  -std=gnu++98 (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++98 (test for excess errors)
          [-UNRESOLVED:-]{+PASS:+} c-c++-common/pr111309-1.c  -std=gnu++98 [-compilation failed to produce executable-]{+execution test+}
      
          [-FAIL: gcc.dg/torture/pr116480-1.c   -O0  (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} gcc.dg/torture/pr116480-1.c   -O0  (test for excess errors)
          [-FAIL: gcc.dg/torture/pr116480-1.c   -O1  (internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268)-]
          [-FAIL:-]{+PASS:+} gcc.dg/torture/pr116480-1.c   -O1  (test for excess errors)
          PASS: gcc.dg/torture/pr116480-1.c   -O2  (test for excess errors)
          PASS: gcc.dg/torture/pr116480-1.c   -O3 -g  (test for excess errors)
          PASS: gcc.dg/torture/pr116480-1.c   -Os  (test for excess errors)
      
      ..., where we ran into 'gcc_assert (icode != CODE_FOR_nothing);' in
      'gcc/internal-fn.cc:expand_fn_using_insn' for '__int128' '__builtin_clzg' etc.:
      
          during RTL pass: expand
          [...]/c-c++-common/pr111309-1.c: In function 'clzI':
          [...]/c-c++-common/pr111309-1.c:69:10: internal compiler error: in expand_fn_using_insn, at internal-fn.cc:268
          0x120ec2cf internal_error(char const*, ...)
                  [...]/gcc/diagnostic-global-context.cc:517
          0x102c7c5b fancy_abort(char const*, int, char const*)
                  [...]/gcc/diagnostic.cc:1722
          0x109708eb expand_fn_using_insn
                  [...]/gcc/internal-fn.cc:268
          0x1098114f expand_internal_call(internal_fn, gcall*)
                  [...]/gcc/internal-fn.cc:5273
          0x1098114f expand_internal_call(gcall*)
                  [...]/gcc/internal-fn.cc:5281
          0x10594fc7 expand_call_stmt
                  [...]/gcc/cfgexpand.cc:3049
          [...]
      
      Likewise, as of commit e8ad697a
      "libstdc++: Use new type-generic built-ins in <bit> [PR118855]",
      the libstdc++ target library build ICEd in the same way.
      
      Additionally, this change fixes:
      
          [-FAIL:-]{+PASS:+} gcc.dg/pr105094.c (test for excess errors)
      
      ..., which was:
      
          [...]/gcc.dg/pr105094.c: In function 'foo':
          [...]/gcc.dg/pr105094.c:11:12: error: size of variable 's' is too large
      
      And, finally, regarding 'gcc.target/nvptx/stack_frame-1.c'.  Before, in
      'gcc/cfgexpand.cc': 'expand_used_vars' -> 'expand_used_vars_for_block' ->
      'expand_one_var' for 'ww' -> 'gcc/function.cc:use_register_for_decl' due to
      'DECL_MODE (decl) == BLKmode' did 'return false;', thus -> 'add_stack_var'
      (even if 'ww' wasn't then actually living on the stack).  Now, 'ww' has
      'TImode' and 'use_register_for_decl' does 'return true;', thus ->
      'expand_one_register_var', and therefore no unused stack frame emitted.
      
      	gcc/
      	* config/nvptx/nvptx.h (MAX_FIXED_MODE_SIZE): '#define'.
      	gcc/testsuite/
      	* gcc.target/nvptx/stack_frame-1.c: Adjust.
      e333ad4e
    • Thomas Schwinge's avatar
      Add 'gcc.target/nvptx/stack_frame-1.c' · 39e1ec22
      Thomas Schwinge authored
      	gcc/testsuite/
      	* gcc.target/nvptx/stack_frame-1.c: New.
      39e1ec22
    • Thomas Schwinge's avatar
      nvptx: Build libgfortran with '-mfake-ptx-alloca' [PR107635] · bac2d8a2
      Thomas Schwinge authored
      As of recent commit 8bf0ee8d
      "Fortran: Add transfer_between_remotes [PR107635]", we've got 'alloca' usage
      in 'libgfortran/caf/single.c:_gfortran_caf_transfer_between_remotes', and
      the libgfortran target library fails to build for legacy configurations where
      PTX 'alloca' is not available:
      
          ../../../../source-gcc/libgfortran/caf/single.c: In function ‘_gfortran_caf_transfer_between_remotes’:
          ../../../../source-gcc/libgfortran/caf/single.c:675:23: sorry, unimplemented: dynamic stack allocation not supported
            675 |       transfer_desc = __builtin_alloca (desc_size);
                |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ../../../../source-gcc/libgfortran/caf/single.c:680:20: sorry, unimplemented: dynamic stack allocation not supported
            680 |     transfer_ptr = __builtin_alloca (*opt_dst_charlen * src_size);
                |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          make[6]: *** [Makefile:4675: caf/single.lo] Error 1
      
      With '-mfake-ptx-alloca', libgfortran again succeeds to build, and compared
      to before, we've got only a small number of regressions due to nvptx 'ld'
      complaining about 'unresolved symbol __GCC_nvptx__PTX_alloca_not_supported':
      
          [-PASS:-]{+FAIL:+} gfortran.dg/coarray/codimension_2.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
      
          [-PASS:-]{+FAIL:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
          [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/event_4.f08 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}
      
          [-PASS:-]{+FAIL:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
          [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/fail_image_2.f08 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}
      
          [-PASS:-]{+FAIL:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single (test for excess errors)
          [-PASS:-]{+UNRESOLVED:+} gfortran.dg/coarray/proc_pointer_assign_1.f90 -fcoarray=lib  -O2  -lcaf_single [-execution test-]{+compilation failed to produce executable+}
      
          [-PASS:-]{+FAIL:+} gfortran.dg/coarray_43.f90   -O  (test for excess errors)
      
      That's acceptable for such legacy PTX configurations.
      
      	PR target/107635
      	libgfortran/
      	* config/t-nvptx: New.
      	* configure.host [nvptx] (tmake_file): Add it.
      bac2d8a2
    • Thomas Schwinge's avatar
      nvptx: Support '-mfake-ptx-alloca' · 1146410c
      Thomas Schwinge authored
      With '-mfake-ptx-alloca' enabled, the user-visible behavior changes only
      for configurations where PTX 'alloca' is not available.  Rather than a
      compile-time 'sorry, unimplemented: dynamic stack allocation not supported'
      in presence of dynamic stack allocation, compilation and assembly then
      succeeds.  However, attempting to link in such '*.o' files then fails due
      to unresolved symbol '__GCC_nvptx__PTX_alloca_not_supported'.
      
      This is meant to be used in scenarios where large volumes of code are
      compiled, a small fraction of which runs into dynamic stack allocation, but
      these parts are not important for specific use cases, and we'd thus like the
      build to succeed, and error out just upon actual, very rare use of the
      offending '*.o' files.
      
      	gcc/
      	* config/nvptx/nvptx.opt (-mfake-ptx-alloca): New.
      	* config/nvptx/nvptx-protos.h (nvptx_output_fake_ptx_alloca):
      	Declare.
      	* config/nvptx/nvptx.cc (nvptx_output_fake_ptx_alloca): New.
      	* config/nvptx/nvptx.md (define_insn "@nvptx_alloca_<mode>")
      	[!(TARGET_PTX_7_3 && TARGET_SM52)]: Use it for
      	'-mfake-ptx-alloca'.
      	gcc/testsuite/
      	* gcc.target/nvptx/alloca-1-O0_-mfake-ptx-alloca.c: New.
      	* gcc.target/nvptx/alloca-2-O0_-mfake-ptx-alloca.c: Likewise.
      	* gcc.target/nvptx/alloca-4-O3_-mfake-ptx-alloca.c: Likewise.
      	* gcc.target/nvptx/vla-1-O0_-mfake-ptx-alloca.c: Likewise.
      	* gcc.target/nvptx/alloca-4-O3.c:
      	'dg-additional-options -mfake-ptx-alloca'.
      1146410c
    • Thomas Schwinge's avatar
      nvptx: Delay 'sorry, unimplemented: dynamic stack allocation not supported'... · 22e76700
      Thomas Schwinge authored
      nvptx: Delay 'sorry, unimplemented: dynamic stack allocation not supported' from expansion time to code generation
      
      This gives the back end a chance to clean out a few more unnecessary instances
      of dynamic stack allocation.  This progresses:
      
          PASS: gcc.dg/pr78902.c  (test for warnings, line 7)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 8)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 9)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 10)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 11)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 12)
          PASS: gcc.dg/pr78902.c  (test for warnings, line 13)
          PASS: gcc.dg/pr78902.c strndup excessive bound at line 14 (test for warnings, line 13)
          [-UNSUPPORTED: gcc.dg/pr78902.c: dynamic stack allocation not supported-]
          {+PASS: gcc.dg/pr78902.c (test for excess errors)+}
      
          UNSUPPORTED: gcc.dg/torture/pr71901.c   -O0 : dynamic stack allocation not supported
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr71901.c   -O1  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
          UNSUPPORTED: gcc.dg/torture/pr71901.c   -O2 : dynamic stack allocation not supported
          UNSUPPORTED: gcc.dg/torture/pr71901.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions : dynamic stack allocation not supported
          UNSUPPORTED: gcc.dg/torture/pr71901.c   -O3 -g : dynamic stack allocation not supported
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr71901.c   -Os  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
      
          UNSUPPORTED: gcc.dg/torture/pr78742.c   -O0 : dynamic stack allocation not supported
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr78742.c   -O1  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr78742.c   -O2  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr78742.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
          [-UNSUPPORTED:-]{+PASS:+} gcc.dg/torture/pr78742.c   -O3 -g  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
          UNSUPPORTED: gcc.dg/torture/pr78742.c   -Os : dynamic stack allocation not supported
      
          [-UNSUPPORTED:-]{+PASS:+} gfortran.dg/pr101267.f90   -O  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
      
          [-UNSUPPORTED:-]{+PASS:+} gfortran.dg/pr112404.f90   -O  [-: dynamic stack allocation not supported-]{+(test for excess errors)+}
      
      	gcc/
      	* config/nvptx/nvptx.md (define_expand "allocate_stack")
      	[!TARGET_SOFT_STACK]: Move
      	'sorry ("dynamic stack allocation not supported");'...
      	(define_insn "@nvptx_alloca_<mode>"): ... here.
      	gcc/testsuite/
      	* gcc.target/nvptx/alloca-1-unused-O0-sm_30.c: Adjust.
      22e76700
    • Thomas Schwinge's avatar
      nvptx: Add test cases for dead/unused 'alloca'/VLA · 5c9ef3bd
      Thomas Schwinge authored
      	gcc/testsuite/
      	* gcc.target/nvptx/alloca-1-dead-O0-sm_30.c: New.
      	* gcc.target/nvptx/alloca-1-dead-O0.c: Likewise.
      	* gcc.target/nvptx/alloca-1-dead-O1-sm_30.c: Likewise.
      	* gcc.target/nvptx/alloca-1-dead-O1.c: Likewise.
      	* gcc.target/nvptx/alloca-1-unused-O0-sm_30.c: Likewise.
      	* gcc.target/nvptx/alloca-1-unused-O0.c: Likewise.
      	* gcc.target/nvptx/alloca-1-unused-O1-sm_30.c: Likewise.
      	* gcc.target/nvptx/alloca-1-unused-O1.c: Likewise.
      	* gcc.target/nvptx/vla-1-dead-O0-sm_30.c: Likewise.
      	* gcc.target/nvptx/vla-1-dead-O0.c: Likewise.
      	* gcc.target/nvptx/vla-1-dead-O1-sm_30.c: Likewise.
      	* gcc.target/nvptx/vla-1-dead-O1.c: Likewise.
      	* gcc.target/nvptx/vla-1-unused-O0-sm_30.c: Likewise.
      	* gcc.target/nvptx/vla-1-unused-O0.c: Likewise.
      	* gcc.target/nvptx/vla-1-unused-O1-sm_30.c: Likewise.
      	* gcc.target/nvptx/vla-1-unused-O1.c: Likewise.
      5c9ef3bd
    • Jerry DeLisle's avatar
      GCC: Documentation of -x option · cfc9f421
      Jerry DeLisle authored
      This change updates information about the -x option to clarify
      that it does not ensure standards compliance. Sparked by
      discussions in the following PR.
      
      	PR fortran/108369
      
      gcc/ChangeLog:
      
      	* doc/invoke.texi: Add a note to clarify. Adjust some wording.
      cfc9f421
    • Marek Polacek's avatar
      c++: ICE with GOTO_EXPR [PR118928] · 9792126a
      Marek Polacek authored
      
      In this PR we crash in cxx_eval_constant_expression/GOTO_EXPR on:
      
        gcc_assert (cxx_dialect >= cxx23);
      
      The code obviously doesn't expect to see a goto pre-C++23.  But we can
      get here with the new prvalue optimization.  In this test we found
      ourselves in synthesize_method for X::X().  This function calls:
      
       a) finish_function, which does cp_genericize -> ... -> genericize_c_loops,
          which creates the GOTO_EXPR;
       b) expand_or_defer_fn -> maybe_clone_body -> ... -> cp_fold_function
          where we reach the new maybe_constant_init call and crash on the
          goto.
      
      Since we can validly get to that assert, I think we should just remove
      it.  I don't see other similar asserts like this one.
      
      	PR c++/118928
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (cxx_eval_constant_expression) <case GOTO_EXPR>: Remove
      	an assert.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/constexpr-prvalue5.C: New test.
      
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      9792126a
    • Vladimir N. Makarov's avatar
      [PR118940][LRA]: Add a test · 3071eb28
      Vladimir N. Makarov authored
      PR115458 also solves given PR.  So the patch adds only a
      test case which can be used for testing LRA work aspects different from
      PR115458 test case.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/118940
      	* gcc.target/i386/pr118940.c: New test.
      3071eb28
    • Vladimir N. Makarov's avatar
      [PR116336][LRA]: Add a test · e59dd301
      Vladimir N. Makarov authored
        Patch for PR116234 solves given PR116366.  So the patch adds only the test
      case which is very different from PR116234 one.
      
      gcc/testsuite/ChangeLog:
      
      	PR rtl-optimization/116336
      	* gcc.dg/pr116336.c: New test.
      e59dd301
    • Marek Polacek's avatar
      c++: too many errors with sneaky template [PR118516] · 3605e057
      Marek Polacek authored
      Since C++20 P0846, a name followed by a < can be treated as a template-name
      even though name lookup did not find a template-name.  That happens
      in this test with "i < foo ()":
      
        for (int id = 0; i < foo(); ++id);
      
      and results in a raft of errors about non-constant foo().  The problem
      is that the require_potential_constant_expression call in
      cp_parser_template_argument emits errors even when we're parsing
      tentatively.  So we repeat the error when we're trying to parse
      as a nested-name-specifier, type-name, etc.
      
      Guarding the call with !cp_parser_uncommitted_to_tentative_parse_p would
      mean that require_potential_constant_expression never gets called.  But
      we don't need the call at all as far as I can tell.  Stuff like
      
        template<int N> struct S { };
        int foo () { return 4; }
        void
        g ()
        {
          S<foo()> s;
        }
      
      gets diagnosed in convert_nontype_argument.  In fact, with this patch,
      we only emit "call to non-constexpr function" once.  (That is, in C++17
      only; C++14 uses a different path.)
      
      	PR c++/118516
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (cp_parser_template_argument): Don't call
      	require_potential_constant_expression.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/fn-template11.C:
      	* g++.dg/template/fn-template1.C: New test.
      	* g++.dg/template/fn-template2.C: New test.
      3605e057
    • Richard Earnshaw's avatar
      testsuite: arm: Avoid incremental link warnings in pr61123-enum-size · 767a7a06
      Richard Earnshaw authored
      This test uses incremental linking, but that can generate warnings if
      the LTO step contains a mix of LTO and non-LTO object files (this can
      happen when there's a testglue file that is normally included during
      linking).
      
      We don't care about the testglue, though, so just tell the LTO
      optimizer to generate nolto-rel output, which is what it is falling
      back to anyway.
      
      gcc/testsuite:
      	* gcc.target/arm/lto/pr61123-enum-size_0.c: (dg-lto-options) Move
      	linker related options to ...
      	(dg-extra-ld-options): ... here.  Add -flinker-output=nolto-rel.
      767a7a06
    • Andre Vehreschild's avatar
      Fortran: Fix ICE on associate of pointer [PR118789] · 0fc1abcc
      Andre Vehreschild authored
      Fix ICE when associating a pointer to void (c_ptr) by looking at the
      compatibility of the type hierarchy.
      
      	PR fortran/118789
      
      gcc/fortran/ChangeLog:
      
      	* trans-stmt.cc (trans_associate_var): Compare pointed to types when
      	expr to associate is already a pointer.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/associate_73.f90: New test.
      0fc1abcc
    • Haochen Jiang's avatar
      i386: Treat Granite Rapids/Granite Rapids-D/Diamond Rapids similar as Sapphire... · 44c4a720
      Haochen Jiang authored
      i386: Treat Granite Rapids/Granite Rapids-D/Diamond Rapids similar as Sapphire Rapids in x86-tune.def
      
      Since GNR, GNR-D, DMR are both P-core based, we should treat them
      just like SPR for now.
      
      gcc/ChangeLog:
      
      	* config/i386/x86-tune.def
      	(X86_TUNE_DEST_FALSE_DEP_FOR_GLC): Add GNR, GNR-D, DMR.
      	(X86_TUNE_AVOID_256FMA_CHAINS): Ditto.
      	(X86_TUNE_AVX512_MOVE_BY_PIECES): Ditto.
      	(X86_TUNE_AVX512_STORE_BY_PIECES): Ditto.
      44c4a720
    • Jakub Jelinek's avatar
      gimple-range-phi: Fix comment typo · fc605b05
      Jakub Jelinek authored
      During reading of this file I've noticed a typo in the comment, which
      this patch fixes.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	* gimple-range-phi.cc (phi_analyzer::process_phi): Fix comment typo,
      	dpoesn;t -> doesn't.
      fc605b05
    • Jakub Jelinek's avatar
      Makefile: Link in {simple,lazy}-diagnostic-path.o [PR116143] · fb684f16
      Jakub Jelinek authored
      Some of the plugin.exp tests FAIL in --enable-checking=release builds while
      they succeed in --enable-checking=yes builds.
      Initially I've changed some small simple out of line methods into inline ones
      in the header, but the tests kept failing, just with different symbols.
      
      The _ZN22simple_diagnostic_path9add_eventEmP9tree_nodeiPKcz symbol (and the
      others too) are normally emitted in simple-diagnostic-path.o, it isn't some
      fancy C++ optimization of classes with final method or LTO optimization.
      
      The problem is that simple-diagnostic-path.o is like most objects added into
      libbackend.a and we then link libbackend.a without -Wl,--whole-archive ...
      -Wl,--no-whole-archive around it (and can't easily, not all system compilers
      and linkers will support that).
      With --enable-checking=yes simple-diagnostic-path.o is pulled in, because
      selftest-run-tests.o calls simple_diagnostic_path_cc_tests and so
      simple-diagnostic-path.o is linked in.
      With --enable-checking=release self-tests aren't done and nothing links in
      simple-diagnostic-path.o, because nothing in the compiler proper needs
      anything from it, only the plugin tests.
      
      Using -Wl,-M on cc1 linking, I see that in --enable-checking=release
      build
      analyzer/analyzer-selftests.o
      digraph.o
      dwarf2codeview.o
      fibonacci_heap.o
      function-tests.o
      hash-map-tests.o
      hash-set-tests.o
      hw-doloop.o
      insn-peep.o
      lazy-diagnostic-path.o
      options-urls.o
      ordered-hash-map-tests.o
      pair-fusion.o
      print-rtl-function.o
      resource.o
      rtl-tests.o
      selftest-rtl.o
      selftest-run-tests.o
      simple-diagnostic-path.o
      splay-tree-utils.o
      typed-splay-tree.o
      vmsdbgout.o
      aren't linked into cc1 (the *test* for obvious reasons of not doing
      selftests, pair-fusion.o because it is aarch64 specific, hw-doloop.o because
      x86 doesn't have doloop opts, vmsdbgout.o because not on VMS).
      
      So, the question is if and what from digraph.o, fibinacci_heap.o,
      hw-doloop.o, insn-peep.o, lazy-diagnostic-path.o, options-urls.o,
      pair-fusion.o, print-rtl-function.o, resource.o, simple-diagnostic-path.o,
      splay-tree-utils.o, typed-splay-tree.o are supposed to be part of the
      plugin API if anything and how we arrange for those to be linked in when
      plugins are enabled.
      
      The following patch just adds unconditionally the
      {simple,lazy}-diagnostic-path.o objects to the link lines before libbackend.a
      so that their content is available to plugin users.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR testsuite/116143
      	* Makefile.in (EXTRA_BACKEND_OBJS): New variable.
      	(BACKEND): Use it before libbackend.a.
      fb684f16
    • Jakub Jelinek's avatar
      alias: Perform offset arithmetics in poly_offset_int rather than poly_int64 [PR118819] · b570f48c
      Jakub Jelinek authored
      This PR is about ubsan error on the c - cx1 + cy1 evaluation in the first
      hunk.
      
      The following patch hopefully fixes that by doing the additions/subtractions
      in poly_offset_int rather than poly_int64 and then converting back to poly_int64.
      If it doesn't fit, -1 is returned (which means it is unknown if there is a conflict
      or not).
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/118819
      	* alias.cc (memrefs_conflict_p): Perform arithmetics on c, xsize and
      	ysize in poly_offset_int and return -1 if it is not representable in
      	poly_int64.
      b570f48c
    • GCC Administrator's avatar
      Daily bump. · edd9ad2a
      GCC Administrator authored
      edd9ad2a
  3. Feb 26, 2025
    • Patrick Palka's avatar
      libstdc++: Add code comment documenting LWG 4027 change [PR118083] · 640697f7
      Patrick Palka authored
      	PR libstdc++/118083
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_base.h
      	(ranges::__access::__possibly_const_range): Mention LWG 4027.
      640697f7
    • Jakub Jelinek's avatar
      c: Assorted fixes for flexible array members in unions [PR119001] · ad2908ed
      Jakub Jelinek authored
      r15-209 allowed flexible array members inside of unions, but as the
      following testcase shows, not everything has been adjusted for that.
      Unlike structures, in unions flexible array member (as an extension)
      can be any of the members, not just the last one, as in union all
      members are effectively last.
      The first hunk is about an ICE on the initialization of the FAM
      in union which is not the last FIELD_DECL with a string literal,
      the second hunk just formatting fix, third hunk fixes a bug in which
      we were just throwing away the initializers (except for with string literal)
      of FAMs in unions which aren't the last FIELD_DECL, and the last hunk
      is to diagnose FAM errors in unions the same as for structures, in
      particular trying to initialize a FAM with non-constant or initialization
      in nested context.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/119001
      gcc/
      	* varasm.cc (output_constructor_regular_field): Don't fail
      	assertion if next is non-NULL and FIELD_DECL if
      	TREE_CODE (local->type) is UNION_TYPE.
      gcc/c/
      	* c-typeck.cc (pop_init_level): Don't clear constructor_type
      	if DECL_CHAIN of constructor_fields is NULL but p->type is UNION_TYPE.
      	Formatting fix.
      	(process_init_element): Diagnose non-static initialization of flexible
      	array member in union or FAM in union initialization in nested context.
      gcc/testsuite/
      	* gcc.dg/pr119001-1.c: New test.
      	* gcc.dg/pr119001-2.c: New test.
      ad2908ed
    • Jakub Jelinek's avatar
      c: stddef.h C23 fixes [PR114870] · 8d22474a
      Jakub Jelinek authored
      The stddef.h header for C23 defines __STDC_VERSION_STDDEF_H__ and
      unreachable macros multiple times in some cases.
      The header doesn't have normal multiple inclusion guard, because it supports
      for glibc inclusion with __need_{size_t,wchar_t,ptrdiff_t,wint_t,NULL}.
      While the definition of __STDC_VERSION_STDDEF_H__ and unreachable is done
      solely in the #ifdef _STDDEF_H part, so they are defined only if stddef.h
      is included without those __need_* macros defined.  But actually once
      stddef.h is included without the __need_* macros, _STDDEF_H is then defined
      and while further stddef.h includes without __need_* macros don't do
      anything:
       #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
            && !defined(__STDDEF_H__)) \
           || defined(__need_wchar_t) || defined(__need_size_t) \
           || defined(__need_ptrdiff_t) || defined(__need_NULL) \
           || defined(__need_wint_t)
      if one includes whole stddef.h first and then stddef.h with some of the
      __need_* macros defined, the #ifdef _STDDEF_H part is used again.
      It isn't that big deal for most cases, as it uses extra guarding macros
      like:
       #ifndef _GCC_MAX_ALIGN_T
       #define _GCC_MAX_ALIGN_T
       ...
       #endif
      etc., but for __STDC_VERSION_STDDEF_H__/unreachable nothing like that is
      used.
      
      So, either we do what the following patch does and just don't define
      __STDC_VERSION_STDDEF_H__/unreachable second time, or use #ifndef
      unreachable separately for the #define unreachable() case, or use
      new _GCC_STDC_VERSION_STDDEF_H macro to guard this (or two, one for
      __STDC_VERSION_STDDEF_H__ and one for unreachable), or rework the initial
      condition to be just
       #if !defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
           && !defined(__STDDEF_H__)
      - I really don't understand why the header should do anything at all after
      it has been included once without __need_* macros.  But changing how this
      behaves after 35 years might be risky for various OS/libc combinations.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/114870
      	* ginclude/stddef.h (__STDC_VERSION_STDDEF_H__, unreachable): Don't
      	redefine multiple times if stddef.h is first included without __need_*
      	defines and later with them.  Move nullptr_t and unreachable and
      	__STDC_VERSION_STDDEF_H__ definitions into the same
      	defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L #if block.
      
      	* gcc.dg/c23-stddef-2.c: New test.
      8d22474a
    • Jakub Jelinek's avatar
      arm: Fix up REVERSE_CONDITION macro [PR119002] · 40bf0770
      Jakub Jelinek authored
      The linaro CI found my PR119002 patch broke bootstrap on arm.
      Seems the problem is that it has incorrect REVERSE_CONDITION macro
      definition.
      All other target's REVERSE_CONDITION definitions and the default one
      just use the macro's arguments, while arm.h definition uses the MODE
      argument but uses code instead of CODE (the first argument).
      This happens to work because before my patch the only use of the
      macro was in jump.cc with
        /* First see if machine description supplies us way to reverse the
           comparison.  Give it priority over everything else to allow
           machine description to do tricks.  */
        if (GET_MODE_CLASS (mode) == MODE_CC
            && REVERSIBLE_CC_MODE (mode))
          return REVERSE_CONDITION (code, mode);
      but in my patch it is used with GT rather than code.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR rtl-optimization/119002
      	* config/arm/arm.h (REVERSE_CONDITION): Use CODE - the macro
      	argument - in the macro rather than code.
      40bf0770
    • Vladimir N. Makarov's avatar
      [PR119021][LRA]: Fix rtl correctness check failure in LRA. · 7ce3a8e8
      Vladimir N. Makarov authored
        Patch to fix PR115458 contained a code change in dealing with asm
      errors to avoid cycling in reporting the error for asm gotos.  This
      code was wrong and resulted in checking RTL correctness failure.  This
      patch reverts the code change and solves cycling in asm error
      reporting in a different way.
      
      gcc/ChangeLog:
      
      	PR middle-end/119021
      	* lra.cc (lra_asm_insn_error): Use lra_invalidate_insn_data
      	instead of lra_update_insn_regno_info.
      	* lra-assigns.cc (lra_split_hard_reg_for): Restore old code.
      7ce3a8e8
Loading