aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2025-04-30Always reflect lower bits from mask in subranges.Andrew MacLeod6-41/+61
During intersection, we expand the subranges to exclude the lower values from a bitmask with trailing zeros. This leads to inconsistant evaluations and in this case of this PR, that lead to an infinite cycle. Always expand the lower subranges in set_range_from_bitmask instead. PR tree-optimization/119712 gcc/ * value-range.cc (range_bitmask::adjust_range): Delete. (irange::set_range_from_bitmask): Integrate adjust_range. (irange::update_bitmask): Do nothing if bitmask doesnt change. (irange:intersect_bitmask): Do not call adjust_range. Exit if there is no second bitmask. * value-range.h (adjust_range): Remove prototype. gcc/testsuite/ * gcc.dg/pr119712.c: New. * gcc.dg/pr83072-2.c: Adjust. * gcc.dg/tree-ssa/phi-opt-value-5.c: Adjust. * gcc.dg/tree-ssa/vrp122.c: Adjust
2025-04-30testsuite: Force -mcmodel=small for gcc.target/aarch64/pr115258.cRichard Sandiford1-1/+1
The test implicitly assumed the default code model and so failed for -mcmodel=tiny. gcc/testsuite/ * gcc.target/aarch64/pr115258.c: Add -mcmodel=small. (cherry picked from commit 3584aab37f54bcd220c7061568af777e37f4f6ed)
2025-04-30c++: UNBOUND_CLASS_TEMPLATE context substitution [PR119981]Patrick Palka2-7/+30
In r15-123 and r14-11434 we unconditionally set processing_template_decl when substituting the context of an UNBOUND_CLASS_TEMPLATE, in order to handle instantiation of the dependently scoped friend declaration template<int N> template<class T> friend class A<N>::B; where the scope A<N> remains dependent after instantiation. But this turns out to misbehave for the UNBOUND_CLASS_TEMPLATE in the below testcase representing g<[]{}>::template fn since with the flag set substituting the args of test3 into the lambda causes us to defer the substitution and yield a lambda that still looks dependent, which in turn makes g<[]{}> still dependent and not suitable for qualified name lookup. This patch restricts setting processing_template_decl during UNBOUND_CLASS_TEMPLATE substitution to the case where there are multiple levels of introduced template parameters, as in the friend declaration. (This means we need to substitute the template parameter list(s) first, which makes sense since they lexically appear first.) PR c++/119981 PR c++/119378 gcc/cp/ChangeLog: * pt.cc (tsubst) <case UNBOUND_CLASS_TEMPLATE>: Substitute into template parameter list first. When substituting the context, only set processing_template_decl if there's more than one level of introduced template parameters. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/lambda-targ15.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com> (cherry picked from commit 05ea8baf6ff96c77a9a2467d5c45b1ed575fca92)
2025-04-30Fix GNAT build failure for x86/FreeBSDEric Botcazou2-0/+173
gcc/ada/ PR ada/112958 * Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x86 FreeBSD]: Add specific version of s-dorepr.adb. * libgnat/s-dorepr__freebsd.adb: New file.
2025-04-30AVR: fxload_<mode>_libgcc: Use REG_ prefix.Georg-Johann Lay1-3/+3
gcc/ * config/avr/avr.md (fxload_<mode>_libgcc): Use REG_ prefix for magix register numbers (aligns with trunk).
2025-04-30AVR: target/119989 - Add missing clobbers to xload_<mode>_libgcc.Georg-Johann Lay10-1/+98
libgcc's __xload_1...4 is clobbering Z (and also R21 is some cases), but avr.md had clobbers of respective GPRs only up to reload. Outcome was that code reading from the same __memx address twice could be wrong. This patch adds respective clobbers. Forward-port from 2025-04-30 r14-11703 PR target/119989 gcc/ * config/avr/avr.md (xload_<mode>_libgcc): Clobber R21, Z. gcc/testsuite/ * gcc.target/avr/torture/pr119989.h: New file. * gcc.target/avr/torture/pr119989-memx-1.c: New test. * gcc.target/avr/torture/pr119989-memx-2.c: New test. * gcc.target/avr/torture/pr119989-memx-3.c: New test. * gcc.target/avr/torture/pr119989-memx-4.c: New test. * gcc.target/avr/torture/pr119989-flashx-1.c: New test. * gcc.target/avr/torture/pr119989-flashx-2.c: New test. * gcc.target/avr/torture/pr119989-flashx-3.c: New test. * gcc.target/avr/torture/pr119989-flashx-4.c: New test. (cherry picked from commit 1ca1c1fc3b58ae5e1d3db4f5a2014132fe69f82a)
2025-04-30Fix compilation failure on FreeBSDEric Botcazou1-1/+1
[changelog] PR ada/112958 * init.c (__gnat_error_handler) [__FreeBSD__]: Fix typo.
2025-04-30Daily bump.GCC Administrator3-1/+33
2025-04-29aarch64: Fix CFA offsets in non-initial stack probes [PR119610]Richard Sandiford3-26/+78
PR119610 is about incorrect CFI output for a stack probe when that probe is not the initial allocation. The main aarch64 stack probe function, aarch64_allocate_and_probe_stack_space, implicitly assumed that the incoming stack pointer pointed to the top of the frame, and thus held the CFA. aarch64_save_callee_saves and aarch64_restore_callee_saves use a parameter called bytes_below_sp to track how far the stack pointer is above the base of the static frame. This patch does the same thing for aarch64_allocate_and_probe_stack_space. Also, I noticed that the SVE path was attaching the first CFA note to the wrong instruction: it was attaching the note to the calculation of the stack size, rather than to the r11<-sp copy. gcc/ PR target/119610 * config/aarch64/aarch64.cc (aarch64_allocate_and_probe_stack_space): Add a bytes_below_sp parameter and use it to calculate the CFA offsets. Attach the first SVE CFA note to the move into the associated temporary register. (aarch64_allocate_and_probe_stack_space): Update calls accordingly. Start out with bytes_per_sp set to the frame size and decrement it after each allocation. gcc/testsuite/ PR target/119610 * g++.dg/torture/pr119610.C: New test. * g++.target/aarch64/sve/pr119610-sve.C: Likewise. (cherry picked from commit fa61afef18a8566d1907a5ae0e7754e1eac207d9)
2025-04-29Remove other processors from X86_TUNE_DEST_FALSE_DEP_FOR_GLC except GLCliuhongt1-3/+1
Since the tune if only for GLC(sapphirerapids and alderlake-P). gcc/ChangeLog: * config/i386/x86-tune.def (X86_TUNE_DEST_FALSE_DEP_FOR_GLC): Remove other processor except for GLC since this one is only for GLC. (cherry picked from commit 1ad6e171b126a82f38b1e8cbfd207f1d91c58a59)
2025-04-29Daily bump.GCC Administrator1-1/+1
2025-04-28Daily bump.GCC Administrator3-1/+41
2025-04-27c++/modules: Ensure DECL_FRIEND_CONTEXT is streamed [PR119939]Nathaniel Shead3-2/+20
An instantiated friend function relies on DECL_FRIEND_CONTEXT being set to be able to recover the template arguments of the class that instantiated it, despite not being a template itself. This patch ensures that this data is streamed even when DECL_CLASS_SCOPE_P is not true. PR c++/119939 gcc/cp/ChangeLog: * module.cc (trees_out::lang_decl_vals): Also stream lang->u.fn.context when DECL_UNIQUE_FRIEND_P. (trees_in::lang_decl_vals): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/concept-11_a.H: New test. * g++.dg/modules/concept-11_b.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> (cherry picked from commit 1c5cf7cc82d3a2afa5d4fb90049456be408c2a7a)
2025-04-27c++/modules: Find non-exported reachable decls when instantiating friend ↵Nathaniel Shead4-20/+67
classes [PR119863] In r15-9029-geb26b667518c95, we started checking for conflicting declarations with any reachable decl attached to the same originating module. This exposed the issue in the PR, where we would always create a new type even if a matching type existed in the original module. This patch reworks lookup_imported_hidden_friend to handle this case better, by first checking for any reachable decl in the attached module before looking in the mergeable decl slots. PR c++/119863 gcc/cp/ChangeLog: * name-lookup.cc (get_mergeable_namespace_binding): Remove no-longer-used function. (lookup_imported_hidden_friend): Also look for hidden imported decls in an attached decl's module. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-friend-18_a.C: New test. * g++.dg/modules/tpl-friend-18_b.C: New test. * g++.dg/modules/tpl-friend-18_c.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> (cherry picked from commit 948ea8766780f7e44f39ccde3f2436ac2fec80da)
2025-04-27Daily bump.GCC Administrator1-1/+1
2025-04-26Daily bump.GCC Administrator3-1/+60
2025-04-25s390: Allow 5+ argument tail-calls in some -m31 -mzarch special cases [PR119873]Jakub Jelinek2-1/+23
Here is a patch to handle the PARALLEL case too. I think we can just use rtx_equal_p there, because it will always use SImode in the EXPR_LIST REGs in that case. 2025-04-25 Jakub Jelinek <jakub@redhat.com> PR target/119873 * config/s390/s390.cc (s390_call_saved_register_used): Don't return true if default definition of PARM_DECL SSA_NAME of the same register is passed in call saved register in the PARALLEL case either. * gcc.target/s390/pr119873-5.c: New test. (cherry picked from commit 3d156c9e9bdaf351f77e3348b7d0d75e08f65580)
2025-04-25s390: Allow 5+ argument tail-calls in some special cases [PR119873]Jakub Jelinek5-3/+101
protobuf (and therefore firefox too) currently doesn't build on s390*-linux. The problem is that it uses [[clang::musttail]] attribute heavily, and in llvm (IMHO llvm bug) [[clang::musttail]] calls with 5+ arguments on s390*-linux are silently accepted and result in a normal non-tail call. In GCC we just reject those because the target hook refuses to tail call it (IMHO the right behavior). Now, the reason why that happens is as s390_function_ok_for_sibcall attempts to explain, the 5th argument (assuming normal <= wordsize integer or pointer arguments, nothing that needs 2+ registers) is passed in %r6 which is not call clobbered, so we can't do tail call when we'd have to change content of that register and then caller would assume %r6 content didn't change and use it again. In the protobuf case though, the 5th argument is always passed through from the caller to the musttail callee unmodified, so one can actually emit just jg tail_called_function or perhaps tweak some registers but keep %r6 untouched, and in that case I think it is just fine to tail call it (at least unless the stack slots used for 6+ argument can't be modified by the callee in the ABI and nothing checks for that). So, the following patch checks for this special case, where the argument which uses %r6 is passed in a single register and it is passed default definition of SSA_NAME of a PARM_DECL with the same DECL_INCOMING_RTL. It won't really work at -O0 but should work for -O1 and above, at least when one doesn't really try to modify the parameter conditionally and hope it will be optimized away in the end. 2025-04-24 Jakub Jelinek <jakub@redhat.com> Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org> PR target/119873 * config/s390/s390.cc (s390_call_saved_register_used): Don't return true if default definition of PARM_DECL SSA_NAME of the same register is passed in call saved register. (s390_function_ok_for_sibcall): Adjust comment. * gcc.target/s390/pr119873-1.c: New test. * gcc.target/s390/pr119873-2.c: New test. * gcc.target/s390/pr119873-3.c: New test. * gcc.target/s390/pr119873-4.c: New test. (cherry picked from commit 567684733e0c4f28158e19b72f4e7f660ad81561)
2025-04-25rs6000: Ignore OPTION_MASK_SAVE_TOC_INDIRECT differences in inlining ↵Jakub Jelinek2-4/+23
decisions [PR119327] The following testcase FAILs because the always_inline function can't be inlined. The rs6000 backend has similarly to other targets a hook which rejects inlining which would bring in new ISAs which aren't there in the caller. And this hook rejects this because of OPTION_MASK_SAVE_TOC_INDIRECT differences. This flag is set if explicitly requested or by default depending on whether the current function looks hot (or at least not cold): if ((rs6000_isa_flags_explicit & OPTION_MASK_SAVE_TOC_INDIRECT) == 0 && flag_shrink_wrap_separate && optimize_function_for_speed_p (cfun)) rs6000_isa_flags |= OPTION_MASK_SAVE_TOC_INDIRECT; The target nodes that are being compared here are actually the default target node (which was created when cfun was NULL) vs. one that was created for the always_inline function when it wasn't NULL, so one doesn't have it, the other does. In any case, this flag feels like a tuning decision rather than hard ISA requirement and I see no problems why we couldn't inline even explicit -msave-toc-indirect function into -mno-save-toc-indirect or vice versa. We already ignore OPTION_MASK_P{8,10}_FUSION which are also more like tuning flags. 2025-04-22 Jakub Jelinek <jakub@redhat.com> PR target/119327 * config/rs6000/rs6000.cc (rs6000_can_inline_p): Ignore also OPTION_MASK_SAVE_TOC_INDIRECT differences. * g++.dg/opt/pr119327.C: New test. (cherry picked from commit 4b62cf555b5446cb02fc471519cf1afa09e1a108)
2025-04-25Bump BASE-VERJakub Jelinek1-1/+1
2025-04-25 Jakub Jelinek <jakub@redhat.com> * BASE-VER: Set to 15.1.1.
2025-04-25Update ChangeLog and version files for releasereleases/gcc-15.1.0Jakub Jelinek20-2/+73
2025-04-25Daily bump.GCC Administrator5-1/+68
2025-04-24opts.cc: Use opts rather than opts_set for validating -fipa-reorder-for-localityKyrylo Tkachov1-4/+5
This ensures -fno-ipa-reorder-for-locality doesn't complain with an explicit -flto-partition=. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> * opts.cc (validate_ipa_reorder_locality_lto_partition): Check opts instead of opts_set for x_flag_ipa_reorder_for_locality. (finish_options): Update call site. (cherry picked from commit fbf8443961f484ed7fb7e953206af1ee60558a24)
2025-04-24opts.cc Simplify handling of explicit -flto-partition= and ↵Kyrylo Tkachov4-14/+6
-fipa-reorder-for-locality The handling of an explicit -flto-partition= and -fipa-reorder-for-locality should be simpler. No need to have a new default option. We can use opts_set to check if -flto-partition is explicitly set and use that information in the error handling. Remove -flto-partition=default and update accordingly. Bootstrapped and tested on aarch64-none-linux-gnu. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> gcc/ * common.opt (LTO_PARTITION_DEFAULT): Delete. (flto-partition=): Change default back to balanced. * flag-types.h (lto_partition_model): Remove LTO_PARTITION_DEFAULT. * opts.cc (validate_ipa_reorder_locality_lto_partition): Check opts_set->x_flag_lto_partition instead of LTO_PARTITION_DEFAULT. (finish_options): Remove handling of LTO_PARTITION_DEFAULT. gcc/testsuite/ * gcc.dg/completion-2.c: Remove check for default. (cherry picked from commit 040f94d1f63c3607a2f3faf5c329c3b2b6bf7d1e)
2025-04-23Regenerate gcc.potJoseph Myers1-4597/+4785
* gcc.pot: Regenerate.
2025-04-23Fortran: Fix checking for IMPURE in DO CONCURRENT.Steven G. Kargl6-11/+139
PR fortran/119836 gcc/fortran/ChangeLog: * resolve.cc (check_pure_function): Fix checking for an impure subprogram within a DO CONCURRENT construct. (pure_subroutine): Ditto. gcc/testsuite/ChangeLog: * gfortran.dg/do_concurrent_all_clauses.f90: Remove invalid dg-error test. * gfortran.dg/pr119836_1.f90: New test. * gfortran.dg/pr119836_2.f90: New test. * gfortran.dg/pr119836_3.f90: New test. * gfortran.dg/pr119836_4.f90: New test. (cherry picked from commit f9ea46d946887a05d7ecbca5aeeb99fd868f6e70)
2025-04-23Update gcc sv.poJoseph Myers1-230/+162
* sv.po: Update.
2025-04-23testsuite: AMDGCN test for vect-early-break_38.c as well to consistent ↵Tamar Christina1-0/+1
architecture [PR119286] I had missed this one during the AMDGCN test failures. Like vect-early-break_18.c this test is also scalaring the loads and thus leading to unexpected vectorization for this testcase. gcc/testsuite/ChangeLog: PR target/119286 * gcc.dg/vect/vect-early-break_38.c: Force -march=gfx908 for amdgcn. (cherry picked from commit 50a747215e45783de4fd64e47d0851f07d3a44df)
2025-04-23Daily bump.GCC Administrator3-1/+47
2025-04-22aarch64: Define __ARM_FEATURE_FAMINMAXRichard Sandiford2-0/+16
We implemented FAMINMAX ACLE support but failed to define the associated feature macro. gcc/ * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define __ARM_FEATURE_FAMINMAX. gcc/testsuite/ * gcc.target/aarch64/pragma_cpp_predefs_4.c: Test __ARM_FEATURE_FAMINMAX. (cherry picked from commit a544a9c5bbfce013ab020f82acd2470d610fb3c8)
2025-04-22aarch64: Update FP8 dependencies for -mcpu=olympusKyrylo Tkachov1-1/+1
We had not noticed that after g:299a8e2dc667e795991bc439d2cad5ea5bd379e2 the FP8FMA and FP8DOT4 features aren't implied by FP8FMA. The intent is for -mcpu=olympus to support all of them. Fix the definition to include the relevant sub-features explicitly. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> gcc/ * config/aarch64/aarch64-cores.def (olympus): Add fp8fma, fp8dot4 explicitly. (cherry picked from commit 5d5e8e87a42af8c0d962fa16dc9835fb71778250)
2025-04-22testsuite: XFAIL predcom-8.c on aarch64 [PR118407]Richard Sandiford1-1/+1
gcc.dg/tree-ssa/predcom-8.c fails on aarch64 for the reasons discussed in the PR trail. The fix didn't make it into GCC 15, so this patch XFAILs the test instead. Other targets might benefit from an XFAIL too, but people who work on those targets would be better placed to know the right conditions. gcc/testsuite/ PR tree-optimization/118407 * gcc.dg/tree-ssa/predcom-8.c: Add XFAIL for aarch64.
2025-04-22Document locality partitioning params in invoke.texiKyrylo Tkachov1-0/+13
Filip Kastl pointed out that contrib/check-params-in-docs.py complains about params not documented in invoke.texi, so this patch adds the short explanation from params.opt for these to the invoke.texi section. Thanks for the reminder. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> gcc/ * doc/invoke.texi (lto-partition-locality-frequency-cutoff, lto-partition-locality-size-cutoff, lto-max-locality-partition): Document. (cherry picked from commit b7fb18dcf79476aa30ed2ad6cc2eaeab1f266107)
2025-04-22testsuite: Use sigsetjmp in gcc.misc-tests/gcov-31.cRainer Orth1-1/+1
The gcc.misc-tests/gcov-31.c test FAILs on Solaris and Darwin: FAIL: gcc.misc-tests/gcov-31.c (test for excess errors) Excess errors: /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.misc-tests/gcov-31.c:23:5: error: implicit declaration of function '__sigsetjmp'; did you mean 'sigsetjmp'? [-Wimplicit-function-declaration] __sigsetjmp is a Linux/glibc implementation detail. Other tests just use sigsetjmp directly, so this patch follows suit. Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, x86_64-pc-linux-gnu, and x86_64-apple-darwin24.4.0. 2025-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/testsuite: * gcc.misc-tests/gcov-31.c (run_pending_traps): Use sigsetjmp instead of __sigsetjmp. (cherry picked from commit ab41f146cf077b89cff8d86e2f698ed0fabd12d9)
2025-04-22Daily bump.GCC Administrator1-1/+1
2025-04-21Daily bump.GCC Administrator1-1/+1
2025-04-20Daily bump.GCC Administrator1-1/+1
2025-04-19Daily bump.GCC Administrator3-1/+15
2025-04-18tree-optimization/119858 - type mismatch with POINTER_PLUSRichard Biener1-2/+6
The recent PFA early-break vectorization fix left us with a POINTER_PLUS and non-sizetype offset. PR tree-optimization/119858 * tree-vect-loop.cc (vectorizable_live_operation): Convert pointer offset to sizetype.
2025-04-18LoongArch: Change {dg-do-what-default} save and restore logical.Xing Li1-2/+4
The set of {dg-do-what-default} to 'run' may lead some test hang during make check. gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/loongarch-vector.exp: Change {dg-do-what-default} save and restore logical. (cherry picked from commit dd982198656d914a4958bf86356a4c996c728b9d)
2025-04-18Daily bump.GCC Administrator5-1/+65
2025-04-17Set DEV-PHASE to prerelease.Jakub Jelinek1-1/+1
2025-04-17 Jakub Jelinek <jakub@redhat.com> * DEV-PHASE: Set to prerelease.
2025-04-17middle-end: fix masking for partial vectors and early break [PR119351]Tamar Christina3-24/+99
The following testcase shows an incorrect masked codegen: #define N 512 #define START 1 #define END 505 int x[N] __attribute__((aligned(32))); int __attribute__((noipa)) foo (void) { int z = 0; for (unsigned int i = START; i < END; ++i) { z++; if (x[i] > 0) continue; return z; } return -1; } notice how there's a continue there instead of a break. This means we generate a control flow where success stays within the loop iteration: mask_patt_9.12_46 = vect__1.11_45 > { 0, 0, 0, 0 }; vec_mask_and_47 = mask_patt_9.12_46 & loop_mask_41; if (vec_mask_and_47 == { -1, -1, -1, -1 }) goto <bb 4>; [41.48%] else goto <bb 15>; [58.52%] However when loop_mask_41 is a partial mask this comparison can lead to an incorrect match. In this case the mask is: # loop_mask_41 = PHI <next_mask_63(6), { 0, -1, -1, -1 }(2)> due to peeling for alignment with masking and compiling with -msve-vector-bits=128. At codegen time we generate: ptrue p15.s, vl4 ptrue p7.b, vl1 not p7.b, p15/z, p7.b .L5: ld1w z29.s, p7/z, [x1, x0, lsl 2] cmpgt p7.s, p7/z, z29.s, #0 not p7.b, p15/z, p7.b ptest p15, p7.b b.none .L2 ...<early exit>... Here the basic blocks are rotated and a not is generated. But the generated not is unmasked (or predicated over an ALL true mask in this case). This has the unintended side-effect of flipping the results of the inactive lanes (which were zero'd by the cmpgt) into -1. Which then incorrectly causes us to not take the branch to .L2. This is happening because we're not comparing against the right value for the forall case. This patch gets rid of the forall case by rewriting the if(all(mask)) into if (!all(mask)) which is the same as if (any(~mask)) by negating the masks and flipping the branches. 1. For unmasked loops we simply reduce the ~mask. 2. For masked loops we reduce (~mask & loop_mask) which is the same as doing (mask & loop_mask) ^ loop_mask. For the above we now generate: .L5: ld1w z28.s, p7/z, [x1, x0, lsl 2] cmple p7.s, p7/z, z28.s, #0 ptest p15, p7.b b.none .L2 This fixes gromacs with > 1 OpenMP threads and improves performance. gcc/ChangeLog: PR tree-optimization/119351 * tree-vect-stmts.cc (vectorizable_early_exit): Mask both operands of the gcond for partial masking support. gcc/testsuite/ChangeLog: PR tree-optimization/119351 * gcc.target/aarch64/sve/pr119351.c: New test. * gcc.target/aarch64/sve/pr119351_run.c: New test.
2025-04-17s390: Use match_scratch instead of scratch in define_split [PR119834]Jakub Jelinek2-11/+87
The following testcase ICEs since r15-1579 (addition of late combiner), because *clrmem_short can't be split. The problem is that the define_insn uses (use (match_operand 1 "nonmemory_operand" "n,a,a,a")) (use (match_operand 2 "immediate_operand" "X,R,X,X")) (clobber (match_scratch:P 3 "=X,X,X,&a")) and define_split assumed that if operands[1] is const_int_operand, match_scratch will be always scratch, and it will be reg only if it was the last alternative where operands[1] is a reg. The pattern doesn't guarantee it though, of course RA will not try to uselessly assign a reg there if it is not needed, but during RA on the testcase below we match the last alternative, but then comes late combiner and propagates const_int 3 into operands[1]. And that matches fine, match_scratch matches either scratch or reg and the constraint in that case is X for the first variant, so still just fine. But we won't split that because the splitters only expect scratch. The following patch fixes it by using match_scratch instead of scratch, so that it accepts either. 2025-04-17 Jakub Jelinek <jakub@redhat.com> PR target/119834 * config/s390/s390.md (define_split after *cpymem_short): Use (clobber (match_scratch N)) instead of (clobber (scratch)). Use (match_dup 4) and operands[4] instead of (match_dup 3) and operands[3] in the last of those. (define_split after *clrmem_short): Use (clobber (match_scratch N)) instead of (clobber (scratch)). (define_split after *cmpmem_short): Likewise. * g++.target/s390/pr119834.C: New test.
2025-04-17nvptx: Remove 'TARGET_ASM_NEED_VAR_DECL_BEFORE_USE'Thomas Schwinge1-2/+0
Unused; remnant of an (internal) experiment, before we had nvptx 'as'. gcc/ * config/nvptx/nvptx.cc (TARGET_ASM_NEED_VAR_DECL_BEFORE_USE): Don't '#define'.
2025-04-17d: Fix infinite loop regression in CTFEIain Buclaw4-4/+38
An infinite loop was introduced by a previous refactoring in the semantic pass for DeclarationExp nodes. Ensure the loop properly terminates and add tests cases. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 956e73d64e. gcc/testsuite/ChangeLog: * gdc.test/fail_compilation/test21247.d: New test. * gdc.test/fail_compilation/test21247b.d: New test. Reviewed-on: https://github.com/dlang/dmd/pull/21248
2025-04-17combine: Correct comments about combine_validate_costHans-Peter Nilsson1-3/+3
Fix misleading comments. That function only determines whether replacements cost more; it doesn't actually *validate* costs as being cheaper. For example, it returns true also if it for various reasons cannot determine the costs, or if the new cost is the same, like when doing an identity replacement. The code has been the same since r0-59417-g64b8935d4809f3. * combine.cc: Correct comments about combine_validate_cost.
2025-04-16c++: ill-formed constexpr function [PR113360]Jason Merrill9-12/+45
If we already gave an error while parsing a function, we don't also need to try to explain what's wrong with it when we later try to use it in a constant-expression. In the new testcase explain_invalid_constexpr_fn couldn't find anything still in the function to complain about, so it said because: followed by nothing. We still try to constant-evaluate it to reduce error cascades, but we shouldn't complain if it doesn't work very well. This flag is similar to CLASSTYPE_ERRONEOUS that I added a while back. PR c++/113360 gcc/cp/ChangeLog: * cp-tree.h (struct language_function): Add erroneous bit. * constexpr.cc (explain_invalid_constexpr_fn): Return if set. (cxx_eval_call_expression): Quiet if set. * parser.cc (cp_parser_function_definition_after_declarator) * pt.cc (instantiate_body): Set it. gcc/testsuite/ChangeLog: * g++.dg/cpp23/constexpr-nonlit18.C: Remove redundant message. * g++.dg/cpp1y/constexpr-diag2.C: New test. * g++.dg/cpp1y/pr63996.C: Adjust expected errors. * g++.dg/template/explicit-args6.C: Likewise. * g++.dg/cpp0x/constexpr-ice21.C: Likewise.
2025-04-17Daily bump.GCC Administrator6-1/+223
2025-04-16[testsuite] [ppc] ipa-sra-19.c: pass -Wno-psabi on powerpc-*-elf as wellAlexandre Oliva1-1/+1
Like other ppc targets, powerpc-*-elf needs -Wno-psabi to compile gcc.dg/ipa/ipa-sra-19.c without an undesired warning about vector argument passing. for gcc/testsuite/ChangeLog * gcc.dg/ipa/ipa-sra-19.c: Add -Wno-psabi on ppc-elf too.