aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2025-03-28srcextra fixesJakub Jelinek3-5/+5
Here is a patch which uses sed to fix up the copies of the generated files by flex/bison in the source directories (i.e. what we ship in release tarballs). In that case the generated files are in the same directory as the files they are generated from, so there should be no absolute or relative directories, just the filenames. Furthermore, c.srcextra was duplicating the work of gcc.srcextra, there is nothing C FE specific on gengtype-lex.l. 2025-03-28 Jakub Jelinek <jakub@redhat.com> gcc/ * Makefile.in (gcc.srcextra): Use sed to turn .../gcc/gengtype-lex.l in #line directives into just gengtype-lex.l. gcc/c/ * Make-lang.in (c.srcextra): Don't depend on anything and don't copy anything. gcc/cobol/ * Make-lang.in (cobol.srcextra): Use sed to turn .../gcc/cobol/*.{y,l,h,cc} and cobol/*.{y,l,h,cc} in #line directives into just *.{y,l,h,cc}.
2025-03-28If the LHS does not contain zero, neither do multiply operands.Andrew MacLeod3-0/+44
Given ~[0,0] = op1 * op2, range-ops should determine that neither op1 nor op2 is zero. Add this to the operator_mult for op1_range. op2_range simply invokes op1_range, so both will be covered. PR tree-optimzation/110992.c PR tree-optimzation/119471.c gcc/ * range-op.cc (operator_mult::op1_range): If the LHS does not contain zero, return non-zero. gcc/testsuite/ * gcc.dg/pr110992.c: New. * gcc.dg/pr119471.c: New.
2025-03-28bootstrap/119513 - fix cobol bootstrap with --enable-generated-files-in-srcdirRichard Biener1-1/+1
This adds gcc/cobol/parse.o to compare_exclusions and makes sure to ignore errors when copying generated files, like it's done when copying gengtype-lex.cc. PR bootstrap/119513 * configure.ac (compare_exclusions): Add gcc/cobol/parse\$(objext). * configure: Regenerated. gcc/cobol/ * Make-lang.in (cobol.srcextra): Use cp instead of ln, ignore errors.
2025-03-28testsuite: Add options for float16 for test [PR119133]Christophe Lyon1-0/+1
Some targets (like arm) need some flags to enable _Float16 support. gcc/testsuite/ChangeLog: PR target/119133 * gcc.dg/torture/pr119133.c: Add options for float16.
2025-03-28cobol: Eliminate check-cobol -Os failure in EVALUATE testcaseBob Dubner13-1/+236
The coding error was the lack of a necessary cast from unsigned char to int. gcc/cobol * genapi.cc: (create_and_call): cast unsigned char to int gcc/testsuite * cobol.dg/group2/Complex_EVALUATE__1_.cob: New EVALUTE testcase. * cobol.dg/group2/Complex_EVALUATE__2_.cob: Likewise. * cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob: Likewise. * cobol.dg/group2/EVALUATE_condition__2_.cob: Likewise. * cobol.dg/group2/EVALUATE_doubled_WHEN.cob: Likewise. * cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob: Likewise. * cobol.dg/group2/Complex_EVALUATE__1_.out: Known-good data for testcase. * cobol.dg/group2/Complex_EVALUATE__2_.out: Likewise. * cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.out: Likewise. * cobol.dg/group2/EVALUATE_condition__2_.out: Likewise. * cobol.dg/group2/EVALUATE_doubled_WHEN.out: Likewise. * cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.out: Likewise.
2025-03-28[COBOL] use native_encode_realRichard Biener1-7/+6
The following avoids the round-trip through a newly built tree and instead directly uses the now exported native_encode_real. gcc/cobol/ * genapi.cc (initial_from_float128): Use native_encode_real.
2025-03-28tailc: Handle musttail noreturn calls [PR119483]Jakub Jelinek4-23/+102
The following (first) testcase is accepted by clang (if clang::musttail) and rejected by gcc, because we discover the call is noreturn and then bail out because we don't want noreturn tailcalls. The general reason not to support noreturn tail calls is for cases like abort where we want nicer backtrace, but if user asks explicitly to musttail a call which either is explicitly noreturn or is implicitly determined to be noreturn, I don't see a reason why we couldn't do that. Both for tail calls and tail recursions. An alternative would be to keep rejecting musttail to explicit noreturn, but not actually implicitly mark anything as noreturn if it has any musttail calls. But it is unclear how we could do that, such marking is I think done typically before IPA and e.g. for LTO we won't know whether some other TU could have musttail calls to it. And keeping around both explicit and implicit noreturn bits would be ugly. Well, I guess we could differentiate between presence of noreturn/_Noreturn attributes and just ECF_NORETURN without those, but then tailc would still need to support it, just error out if it was explicit. 2025-03-28 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/119483 * tree-tailcall.cc (find_tail_calls): Handle noreturn musttail calls. (eliminate_tail_call): Likewise. (tree_optimize_tail_calls_1): If cfun->has_musttail and diag_musttail, handle also basic blocks with no successors with noreturn musttail calls. * calls.cc (can_implement_as_sibling_call_p): Allow ECF_NORETURN calls if they are musttail calls. * c-c++-common/pr119483-1.c: New test. * c-c++-common/pr119483-2.c: New test.
2025-03-28ipa-sra: Don't change return type to void if there are musttail calls [PR119484]Jakub Jelinek2-1/+26
The following testcase is rejected, because IPA-SRA decides to turn bar.constprop call into bar.constprop.isra which returns void. While there is no explicit lhs on the call, as it is a musttail call the tailc pass checks if IPA-VRP returns singleton from that function and the function returns the same value and in that case it still turns it into a tail call. This can't work with IPA-SRA changing it into void returning function though. The following patch fixes this by forcing returning the original type if there are musttail calls. 2025-03-28 Jakub Jelinek <jakub@redhat.com> PR ipa/119484 * ipa-sra.cc (isra_analyze_call): Don't set m_return_ignored if gimple_call_must_tail_p even if it doesn't have lhs. * c-c++-common/pr119484.c: New test.
2025-03-28Export native_encode_real operating on REAL_VALUE_TYPERichard Biener2-6/+9
The following exports the native_encode_real worker, and makes it take a scalar float mode and REAL_VALUE_TYPE data instead of a tree for use in the COBOL frontend, avoiding creating of a temporary tree. * fold-const.h (native_encode_real): Export. * fold-const.cc (native_encode_real): Change API to take mode and REAL_VALUE_TYPE. (native_encode_expr): Adjust.
2025-03-28testsuite, riscv: fix broken dg directivesDavid Malcolm4-4/+4
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/riscv/cmo-zicbop-1.c: Fix missing space before trailing } in dg-do directive. * gcc.target/riscv/cmo-zicbop-2.c: Likewise. * gcc.target/riscv/prefetch-zicbop.c: Likewise. * gcc.target/riscv/prefetch-zihintntl.c: Likewise.
2025-03-28testsuite, i386: fix broken dg directivesDavid Malcolm1-1/+1
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/i386/strub-pr118006.c: Fix ordering of dg-do and dg-require- directive so that dg-do is first.
2025-03-28testsuite, arm: fix broken dg directivesDavid Malcolm1-1/+1
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/cmse-17.c: Fix missing space before trailing "}" in dg-options.
2025-03-28testsuite, aarch64: fix broken dg directivesDavid Malcolm2-4/+4
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/aarch64/saturating_arithmetic_1.c: Fix dg-do compile. * gcc.target/aarch64/saturating_arithmetic_2.c: Likewise.
2025-03-28cobol: Do not include <cmath> (no longer needed)Iain Sandoe1-1/+0
Several of enumerators in parse.y conflict with ones declared in at least some versions of <cmath> .. e.g. "OVERFLOW". The header is no longer needed since the FE is not trying to do host arithmetic. gcc/cobol/ChangeLog: * cobol-system.h: Remove <cmath>. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-28Daily bump.GCC Administrator6-1/+395
2025-03-27testsuite: fix some malformed dg-require-* directivesDavid Malcolm2-2/+2
gcc/testsuite/ChangeLog: * g++.dg/abi/pure-virtual1.C: Fix dg-require-weak directive. * g++.target/i386/mangling-alias1.C: Fix dg-require-ifunc directive. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-03-27cobol: Incorporate new testcases from the cobolworx UAT tests.Bob Dubner69-0/+3242
The author notes that some of the file names are regrettably lengthy, which is because they are derived from the descriptive names of the autom4te tests. gcc/testsuite * cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob: New testcase. * cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob: Likewise. * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob: Likewise. * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob: Likewise. * cobol.dg/group2/COMP-6_arithmetic.cob: Likewise. * cobol.dg/group2/COMP-6_numeric_test.cob: Likewise. * cobol.dg/group2/COMP-6_used_with_DISPLAY.cob: Likewise. * cobol.dg/group2/COMP-6_used_with_MOVE.cob: Likewise. * cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob: Likewise. * cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob: Likewise. * cobol.dg/group2/DISPLAY__Sign_ASCII.cob: Likewise. * cobol.dg/group2/Floating_continuation_indicator__1_.cob: Likewise. * cobol.dg/group2/floating-point_ADD_FORMAT_1.cob: Likewise. * cobol.dg/group2/floating-point_ADD_FORMAT_2.cob: Likewise. * cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob: Likewise. * cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob: Likewise. * cobol.dg/group2/floating-point_literals.cob: Likewise. * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob: Likewise. * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob: Likewise. * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob: Likewise. * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob: Likewise. * cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob: Likewise. * cobol.dg/group2/Indicators_______________-____D__.cob: Likewise. * cobol.dg/group2/MULTIPLY_to_FIX4.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_dump.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob: Likewise. * cobol.dg/group2/POINTER__display.cob: Likewise. * cobol.dg/group2/Simple_floating-point_MOVE.cob: Likewise. * cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob: Likewise. * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out: Known-good result. * cobol.dg/group2/COMP-6_arithmetic.out: Likewise. * cobol.dg/group2/COMP-6_numeric_test.out: Likewise. * cobol.dg/group2/COMP-6_used_with_DISPLAY.out: Likewise. * cobol.dg/group2/COMP-6_used_with_MOVE.out: Likewise. * cobol.dg/group2/COMPUTE_multiplication_to_FIX4.out: Likewise. * cobol.dg/group2/DISPLAY__Sign_ASCII__2_.out: Likewise. * cobol.dg/group2/DISPLAY__Sign_ASCII.out: Likewise. * cobol.dg/group2/Floating_continuation_indicator__1_.out: Likewise. * cobol.dg/group2/floating-point_ADD_FORMAT_1.out: Likewise. * cobol.dg/group2/floating-point_ADD_FORMAT_2.out: Likewise. * cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.out: Likewise. * cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.out: Likewise. * cobol.dg/group2/floating-point_literals.out: Likewise. * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.out: Likewise. * cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.out: Likewise. * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.out: Likewise. * cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.out: Likewise. * cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.out: Likewise. * cobol.dg/group2/Indicators_______________-____D__.out: Likewise. * cobol.dg/group2/MULTIPLY_to_FIX4.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_arithmetic.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_dump.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.out: Likewise. * cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.out: Likewise. * cobol.dg/group2/POINTER__display.out: Likewise. * cobol.dg/group2/Simple_floating-point_MOVE.out: Likewise. * cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.out: Likewise.
2025-03-27i386: Fix offset calculation in ix86_redzone_clobberUros Bizjak1-2/+1
plus_constant expects integer as its third argument, not rtx. gcc/ChangeLog: * config/i386/i386.cc (ix86_redzone_clobber): Use integer, not rtx as the third argument of plus_constant.
2025-03-27testsuite: Fix up strub-internal-pr112938.C test for C++2{0,3,6}Jakub Jelinek1-1/+1
On Thu, Mar 27, 2025 at 12:05:21AM +0000, Sam James wrote: > The test was being ignored because dg.exp looks for .C in g++.dg/. > > gcc/testsuite/ChangeLog: > PR middle-end/112938 > > * g++.dg/strub-internal-pr112938.cc: Move to... > * g++.dg/strub-internal-pr112938.C: ...here. This regressed the test for C++20 and higher: FAIL: g++.dg/strub-internal-pr112938.C -std=gnu++20 (test for excess errors) FAIL: g++.dg/strub-internal-pr112938.C -std=gnu++23 (test for excess errors) FAIL: g++.dg/strub-internal-pr112938.C -std=gnu++26 (test for excess errors) Here is a fix. 2025-03-27 Jakub Jelinek <jakub@redhat.com> * g++.dg/strub-internal-pr112938.C: Add dg-warning for c++20.
2025-03-27Ada: Fix too late initialization of tasking runtime with standalone libraryEric Botcazou1-2/+4
The Tasking_Runtime_Initialize routine installs the tasking version of the RTS_Lock manipulation routines and thus needs to be called very early before the elaboration of all the Ada units of the program, including those of the runtime itself. This is guaranteed by the binder when the tasking runtime is explicitly dragged into the link. However, for a standalone dynamic library that does not depend on the tasking runtime and is auto-initialized, no such guarantee holds, even though the library might be later dragged into a link that contains the tasking runtime. This change causes the routine to be called even earlier, in particular at load time when a (standalone) dynamic library is involved in the link, so as to meet the requirements. It will cause the routine to be called twice if the main subprogram is generated by the binder, but this is harmless since the routine is idempotent. ada/ * libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): Add pragma Linker_Constructor for the procedure.
2025-03-27testsuite: fix g++.dg/template/explicit-args6.CMarek Polacek1-1/+1
gcc/testsuite/ChangeLog: * g++.dg/template/explicit-args6.C: Remove an extra set of {} in a dg-message.
2025-03-27testsuite: Require effective target sigsetjmp for gcov-31/32Dimitar Dimitrov2-0/+2
The tests call sigsetjmp and use sigjmp_buf type. Thus the tests cannot be compiled on baremetal newlib targets which do not have sigsetjmp. gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-31.c: Require effective target sigsetjmp. * gcc.misc-tests/gcov-32.c: Ditto. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2025-03-27c++: fix g++.dg/tree-ssa/initlist-opt2.CMarek Polacek1-1/+1
This test needs the same fix as g++.dg/tree-ssa/initlist-opt1.C in r15-8934. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/initlist-opt2.C: Match _M_range_initialize_n instead of _M_range_initialize.
2025-03-27testsuite: revert Fortran changeSam James1-1/+1
Revert part of my change from r15-8973-g1307de1b4e7d5e; as Harald points out, the comment explains why this is there. It's a hack but it needs to stay for now. (I did have this marked as a TODO in my branch and didn't leave a proper note as to why, so it's my fault.) gcc/testsuite/ChangeLog: * gfortran.dg/cray_pointers_2.f90: Restore whitespace.
2025-03-27RISC-V: testsuite: fix syntax error for assembler scanEdwin Lu1-1/+1
When the dg brackets were added, they forgot to add the brackets for the scan-assembler-times directive. Committed as obvious. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vls/merge-4.c: Fix typo Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
2025-03-27testsuite: aarch64: fix another unbalanced }Sam James1-1/+1
In r15-8956-ge90d6c2639c392, I missed one, so while it did fix a problem, it also exposed another because the braces were now unbalanced. There's IMO more to do here with ideally whitespace before the } when using scan-assembler-times but let's do that later. gcc/testsuite/ChangeLog: * gcc.target/aarch64/atomic-inst-ldlogic.c: Add another closing brace.
2025-03-27target/119010 - add znver{4,5}_insn_both to resolve missing reservationsRichard Biener1-0/+12
I still was seeing ;; 0--> b 0: i 101 {[sp-0x3c]=[sp-0x3c]+0x1;clobber flags;}:nothing so the following adds a standard alu insn reservation mimicing that from the znver.md description allowing both load and store. PR target/119010 * config/i386/zn4zn5.md (znver4_insn_both, znver5_insn_both): New reservation for ALU ops with load and store.
2025-03-27target/119010 - more DFmode handling in zn4zn5 reservationsRichard Biener1-22/+22
The following adds DFmode where V1DFmode and SFmode were handled. This resolves missing reservations for adds, subs [with memory] and for FMAs for the testcase I'm looking at. Resolved cases are -;; 16--> b 0: i 237 xmm3=xmm3+[r9*0x8+si] :nothing -;; 29--> b 0: i 246 xmm3=xmm3+xmm1 :nothing -;; 46--> b 0: i 296 xmm1=xmm1-xmm3 :nothing I've done search-and-replace for this, the catched cases look reasonable though I'm of course not sure all of them can actually happen. This also fixes the matched type for the znver{4,5}_sse_muladd_load reservations from sseshuf to ssemuladd, resolving -;; 1--> b 0: i 161 xmm0={-xmm0*xmm27+[cx+ax]} :nothing -;; 22--> b 0: i 229 xmm11={-xmm11*xmm7+[di*0x8+dx]} :nothing PR target/119010 * config/i386/zn4zn5.md (znver4_sse_add, znver4_sse_add_load, znver5_sse_add_load, znver4_sse_add1, znver4_sse_add1_load, znver5_sse_add1_load, znver4_sse_mul, znver4_sse_mul_load, znver5_sse_mul_load, znver4_sse_cvt, znver4_sse_cvt_load, znver5_sse_cvt_load, znver4_sse_shuf, znver5_sse_shuf, znver4_sse_shuf_load, znver5_sse_shuf_load, znver4_sse_cmp_avx128, znver5_sse_cmp_avx128, znver4_sse_cmp_avx128_load, znver5_sse_cmp_avx128_load): Also handle DFmode. (znver4_sse_muladd_load, znver5_sse_muladd_load): Use ssemuladd type.
2025-03-27testsuite: fix dg-* typosSam James4-5/+5
I have a handful more of these left but those introduce FAILs, while these all introduce new PASSes. libstdc++-v3/ChangeLog: * testsuite/std/format/string_neg.cc: Add missing brace for dg-error. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/fd-datagram-socket.c: Fix 'dg-message' spelling. * gcc.dg/analyzer/out-of-bounds-zero.c: Fix whitespace in 'dg-additional-options'. * gcc.dg/analyzer/strchr-1.c: Fix 'dg-message' whitespace. * gnat.dg/sso/q11.adb: Fix 'dg-output' whitespace.
2025-03-27testsuite: fix typos in commentsSam James29-39/+39
This fixes some 'scan-tree-dump-times' (vs '-time') typos and one or two others I noticed in passing. gcc/testsuite/ChangeLog: * g++.dg/warn/Winvalid-memory-model.C: Fix typo in comment. * gcc.dg/builtin-dynamic-object-size-19.c: Ditto. * gcc.dg/builtin-object-size-19.c: Ditto. * gcc.dg/strlenopt-40.c: Ditto. * gcc.dg/strlenopt-44.c: Ditto. * gcc.dg/strlenopt-45.c: Ditto. * gcc.dg/strlenopt-50.c: Ditto. * gcc.dg/strlenopt-51.c: Ditto. * gcc.dg/strlenopt-52.c: Ditto. * gcc.dg/strlenopt-53.c: Ditto. * gcc.dg/strlenopt-54.c: Ditto. * gcc.dg/strlenopt-55.c: Ditto. * gcc.dg/strlenopt-58.c: Ditto. * gcc.dg/strlenopt-59.c: Ditto. * gcc.dg/strlenopt-62.c: Ditto. * gcc.dg/strlenopt-65.c: Ditto. * gcc.dg/strlenopt-70.c: Ditto. * gcc.dg/strlenopt-72.c: Ditto. * gcc.dg/strlenopt-73.c: Ditto. * gcc.dg/strlenopt-77.c: Ditto. * gcc.dg/strlenopt-82.c: Ditto. * gcc.dg/tree-ssa/builtin-snprintf-4.c: Ditto. * gcc.dg/tree-ssa/builtin-snprintf-6.c: Ditto. * gcc.dg/tree-ssa/builtin-snprintf-7.c: Ditto. * gcc.dg/tree-ssa/builtin-sprintf-10.c: Ditto. * gcc.dg/tree-ssa/builtin-sprintf-9.c: Ditto. * gcc.dg/tree-ssa/phi-opt-value-5.c: Ditto. * lib/multiline.exp: Ditto. * lib/target-supports.exp: Ditto.
2025-03-27testsuite: harmless dg-* whitespace fixesSam James14-15/+15
These just fix inconsistent/unusual style to avoid noise when grepping and also people picking up bad habits when they see it (as similar mistakes can be harmful). gcc/testsuite/ChangeLog: * c-c++-common/goacc/pr69916.c: Fix unusual whitespace in dg-*. * g++.old-deja/g++.abi/vtable2.C: Ditto. * g++.old-deja/g++.bugs/900330_02.C: Ditto. * g++.old-deja/g++.bugs/900406_02.C: Ditto. * g++.old-deja/g++.bugs/900519_13.C: Ditto. * g++.old-deja/g++.mike/p9068.C: Ditto. * gcc.dg/20040203-1.c: Ditto. * gcc.dg/980502-1.c: Ditto. * gcc.dg/ipa/ipa-sra-14.c: Ditto. * gcc.dg/pr35468.c: Ditto. * gcc.dg/pr82597.c: Ditto. * gcc.dg/tree-ssa/phi-opt-7.c: Ditto. * gfortran.dg/assumed_charlen_in_main.f90: Ditto. * gfortran.dg/cray_pointers_2.f90: Ditto.
2025-03-27OpenMP: Fix C++ template handling with append_args' prefer_type modifierTobias Burnus7-21/+117
It is possible but not very sensible to use C++ templates with in the prefer_type modifier to the 'append_args' clause of 'declare variant'. The commit r15-6336-g12dd892b1a3ad7 added substitution support in pt.cc, but missed to update afterward the actual data in decl.cc. As gimplification support was only added in r15-8898-gf016ee89955ab4, this could not be tested back then. The latter commit added a sorry for it gimplify.cc and the existing testcase, which this commit now removes. gcc/cp/ChangeLog: * cp-tree.h (cp_finish_omp_init_prefer_type): Add. * decl.cc (omp_declare_variant_finalize_one): Call it. * pt.cc (tsubst_attribute): Minor rebustification for OpenMP append_args handling. * semantics.cc (cp_omp_init_prefer_type_update): Rename to ... (cp_finish_omp_init_prefer_type): ... this; remove static attribute and return modified tree. Move clause handling to ... (finish_omp_clauses): ... the caller. gcc/ChangeLog: * gimplify.cc (modify_call_for_omp_dispatch): Remove sorry. gcc/testsuite/ChangeLog: * g++.dg/gomp/append-args-1.C: Remove expected dg-sorry. * g++.dg/gomp/append-args-8.C: New test.
2025-03-27c++/modules: Handle conflicting ABI tags [PR118920]Nathaniel Shead9-5/+129
The ICE in the linked PR is caused because out_ptr_t inherits an ABI tag in a module that it does not in the importing module. When we try to build a qualified 'const out_ptr_t' during stream-in, we find the existing 'const out_ptr_t' variant type that has been built, but discard it due to having a mismatching attribute list. This causes us to build a new copy of this variant, and ultimately fail a checking assertion due to this being an identical type with different TYPE_CANONICAL. This patch adds checking that ABI tags between an imported and existing declaration match, and errors if they are incompatible. We make use of 'equal_abi_tags' from mangle.cc to determine if we should error; in the case in the PR, because the ABI tag was an implicit tag that doesn't affect name mangling, we don't need to error. To fix the ICE we ensure that (regardless of whether we errored or not) later processing considers the ABI tags as equivalent. PR c++/118920 gcc/cp/ChangeLog: * cp-tree.h (equal_abi_tags): Declare. * mangle.cc (equal_abi_tags): Make external, fix comparison. (tree_string_cmp): Make internal. * module.cc (trees_in::check_abi_tags): New function. (trees_in::decl_value): Use it. (trees_in::is_matching_decl): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/attrib-3_a.H: New test. * g++.dg/modules/attrib-3_b.C: New test. * g++.dg/modules/pr118920.h: New test. * g++.dg/modules/pr118920_a.H: New test. * g++.dg/modules/pr118920_b.H: New test. * g++.dg/modules/pr118920_c.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
2025-03-27c++/modules: Fix tsubst of global module friend classes [PR118920]Nathaniel Shead6-10/+43
When doing tsubst_friend_class, we need to first check if any imported module has already created a (hidden) declaration for the class so that we don't end up with conflicting declarations. Currently we do this using DECL_MODULE_IMPORT_P, but this is not set in cases where the class is in the global module and matches an existing GM declaration we've seen (via an include, for example). This patch fixes this by checking DECL_MODULE_ENTITY_P instead, which is set on all entities that have been seen from a module import. We also use the 'for_mangle' version of get_originating_module so that we don't treat imported GM entities as attached to the module we imported them from. And rename that parameter to something more general. And dump_module_suffix is another place where we want to treat global module entities as not coming from a module. PR c++/118920 gcc/cp/ChangeLog: * name-lookup.cc (lookup_imported_hidden_friend): Check for module entity rather than just module import. * module.cc (get_originating_module): Rename for_mangle parm to global_m1. * error.cc (dump_module_suffix): Don't decorate global module decls. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-friend-17.h: New test. * g++.dg/modules/tpl-friend-17_a.C: New test. * g++.dg/modules/tpl-friend-17_b.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Co-authored-by: Jason Merrill <jason@redhat.com>
2025-03-27arm: don't vectorize fmaxf() unless unsafe math opts are enabledRichard Earnshaw4-19/+24
This test has presumably been failing since vectorization was enabled at -O2. I suspect part of the reason this wasn't picked up sooner is that the test is a hybrid execution/scan-assembler test and the execution part requires appropriate hardware. The problem is that we are vectorizing an expansion of fmaxf() when the vector version of the instruction does not preserve denormal values. This means we should only apply this optimization when -funsafe-math-optimizations is enabled. This fix does a few things: - Moves the expand pattern to vec-common.md. Although I haven't changed its behaviour (beyond fixing the bug), this should really be enabled for MVE as well (but that will need to wait for gcc-16 since the MVE code needs some additional changes first). - Adds support for HF mode vectors. - splits the test that was exposing the bug into two parts: an executable test and a scan-assembler test. The scan-assembler version is more widely enabled, since it does not require a suitable executable environment. gcc/ChangeLog: * config/arm/neon.md (<fmaxmin><mode>3): Move pattern from here... * config/arm/vec-common.md (<fmaxmin><mode>3): ... to here. Convert to define_expand and disable the pattern when denormal values might get truncated to zero. Iterate on VF to add V4HF and V8HF variants. gcc/testsuite/ChangeLog: * gcc.target/arm/fmaxmin.c: Move scan-assembler checks to ... * gcc.target/arm/fmaxmin-2.c: ... here. New test.
2025-03-27i386: Set attr "addr" as "gpr16" for constraint "jm". [PR 119425]Hu, Lin12-11/+57
"jm" should with "gpr16", otherwise maybe raise ICE in reload pass. gcc/ChangeLog: PR target/119425 * config/i386/sse.md: (vec_set<mode>_0): Set the alternative with constraint "jm"'s attribute "addr" to "gpr16". (<mask_codefor>avx512dq_shuf_<shuffletype>64x2_1<mask_name>): Ditto. (avx512vl_shuf_<shuffletype>32x4_1<mask_name>): Ditto. (avx2_pblendd<mode>): Ditto. (aesenc): Ditto. (aesenclast): Ditto. (aesdec): Ditto. (aesdeclast): Ditto. (vaesdec_<mode>): Ditto. (vaesdeclast_<mode>): Ditto. (vaesenc_<mode>):: Ditto. (vaesenclast_<mode>):: Ditto. (aes<aesklvariant>u8): Ditto. (*aes<aeswideklvariant>u8): Ditto. gcc/testsuite/ChangeLog: PR target/119425 * gcc.target/i386/pr119425.c: New test. Co-authered-by: Hongyu Wang <hongyu.wang@intel.com>
2025-03-27c: Fix tagname confusion for typedef redefinitions [PR118765]Martin Uecker5-0/+96
When we redefine a typedef for a tagged type that has just been redefined, merge_decls may produce invalid TYPE_DECLS that are not consistent with what set_underlying_type produces. This is fixed by updating DECL_ORIGINAL_TYPE. PR c/118765 gcc/c/ChangeLog: * c-decl.cc (merge_decls): For TYPE_DECLS copy DECL_ORIGINAL_TYPE from the old declaration. * c-typeck.cc (tagged_types_tu_compatible_p): Add checking assertions. gcc/testsuite/ChangeLog: * gcc.dg/pr118765-2.c: New test. * gcc.dg/pr118765-3.c: New test. * gcc.dg/typedef-redecl3.c: New test.
2025-03-27LoongArch: Support Q suffix for __float128.Lulu Cheng2-0/+25
In r14-3635 supports `__float128`, but does not support the 'q/Q' suffix. PR target/119408 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_c_mode_for_suffix): New. (TARGET_C_MODE_FOR_SUFFIX): Define. gcc/testsuite/ChangeLog: * gcc.target/loongarch/pr119408.c: New test.
2025-03-27OpenMP: Fix declaration in append-args-interop.c test caseSandra Loosemore1-1/+1
I ran into this while backporting my declare variant/dispatch/interop patch f016ee89955ab4da5fe7ef89368e9437bb5ffb13 to the og14 development branch. In C dialects prior to C23 (the default on mainline), functions declared "float f()" and "float g(void)" aren't considered equivalent for the purpose of the C front end code that checks whether a type of a variant matches the base function after accounting for the added interop arguments. Using "(void)" instead of "()" works in all C dialects as well as C++, so do that. gcc/testsuite/ChangeLog * c-c++-common/gomp/append-args-interop.c: Fix declaration of base function to be correct for pre-C23 dialects.
2025-03-27testsuite: fixup tree scan syntax for strub-internal-pr112938.CSam James1-1/+1
This wasn't being run before my r15-8949-g6b21f7969241cf so went unnoticed. Match [0-9+] instead of [0-9][0-9] and escape the parentheses around 'D'. gcc/testsuite/ChangeLog: PR testsuite/119489 * g++.dg/strub-internal-pr112938.C: Adjust pattern.
2025-03-27testsuite: assorted targets: add missing braces to dg-* directivesSam James11-11/+11
These get ignored otherwise. gcc/testsuite/ChangeLog: * gcc.target/arc/taux-1.c: Add missing brace. * gcc.target/arc/taux-2.c: Ditto. * gcc.target/i386/addr-space-1.c: Ditto. * gcc.target/ia64/mfused-madd-vect.c: Ditto. * gcc.target/ia64/mfused-madd.c: Ditto. * gcc.target/ia64/mno-fused-madd-vect.c: Ditto. * gcc.target/ia64/mno-fused-madd.c: Ditto. * gcc.target/riscv/rvv/autovec/vls-vlmax/merge-4.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/merge-4.c: Ditto. * gcc.target/s390/target-attribute/tattr-1.c: Ditto. * gcc.target/s390/target-attribute/tattr-2.c: Ditto.
2025-03-27testsuite: fix more dg-* whitespace issuesSam James18-21/+21
A handful of cosmetic ones in here but most meant the directive wasn't doing anything. gcc/testsuite/ChangeLog: PR target/98743 PR tree-optimization/105820 * g++.dg/cpp0x/udlit-namespace-ambiguous.C: Fix whitespace. * g++.dg/cpp2a/constexpr-init21.C: Ditto. * g++.dg/diagnostic/wrong-tag-1.C: Ditto. * g++.dg/init/self1.C: Ditto. * g++.dg/opt/pr98743.C: Add missing '}' to terminate dg directive. * g++.dg/parse/error8.C: Fix whitespace. * g++.dg/template/explicit-args6.C: Add missing '{' to begin dg directive. * g++.dg/template/unify9.C: Fix whitespace. * g++.dg/tree-ssa/pr105820.C: Ditto. * g++.dg/warn/Wmismatched-tags-8.C: Add missing braces. * gcc.dg/cpp/cmdlne-dM-M.c: Ditto. * gcc.dg/tree-ssa/reassoc-32.c: Ditto. * gcc.dg/tree-ssa/reassoc-33.c: Ditto. * gcc.dg/tree-ssa/reassoc-34.c: Ditto. * gcc.dg/tree-ssa/reassoc-35.c: Ditto. * gcc.dg/tree-ssa/reassoc-36.c: Ditto. * gcc.dg/tree-ssa/reassoc-39.c: Ditto. * gcc.dg/tree-ssa/reassoc-41.c: Ditto.
2025-03-27testsuite: fix dg-message typosSam James2-4/+4
gcc/testsuite/ChangeLog: * g++.dg/diagnostic/unclosed-extern-c.C: Fix 'dg-message' typo. * g++.dg/warn/Wno-attributes-1.C: Ditto.
2025-03-27testsuite: more (mostly cosmetic) dg- whitespace fixesSam James7-12/+12
Some of these are harmless but still inconsistent (and asking for trouble given it may give people the wrong idea about similar "style"). gcc/testsuite/ChangeLog: * g++.dg/cpp0x/gen-attrs-6.C: Surround 'target' by whitespace. * gcc.target/aarch64/atomic-inst-ldlogic.c: Fix 'dg-final' whitespace. * gcc.target/arm/short-vfp-1.c: Ditto. * gcc.target/bfin/l2.c: Fix 'dg-bfin-processors' whitespace. * gcc.target/i386/avx512fp16-vmovw-1b.c: Surround 'target' by whitespace. * gcc.target/i386/sse2-float16-5.c: Ditto. * gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto.
2025-03-27testsuite: fix dg-bogus typoSam James1-1/+1
The dg-bogus directive here is trying to match -Warray-bounds or -Wstringop-overflow, but it got the casing wrong on the latter. gcc.dg/pr89350.c gets this right. gcc/testsuite/ChangeLog: PR middle-end/93437 * g++.dg/warn/Wstringop-overflow-5.C: Fix -Wstringop-overflow casing.
2025-03-27testsuite: fortran: fix dg syntax errorsSam James4-4/+4
No change in test results. The changes other than the first are arguably not errors, but still clearly wrong and mistakes. gcc/testsuite/ChangeLog: * gfortran.dg/associate_70.f90: Replace parenthesis with '}'. * gfortran.dg/bessel_3.f90: Drop extraneous parenthesis. * gfortran.dg/c_funloc_tests_6.f90: Ditto. * gfortran.dg/parity_2.f90: Ditto.
2025-03-27Daily bump.GCC Administrator8-1/+381
2025-03-27testsuite: tree-ssa: fix PR98265 test to use C++14Sam James1-2/+2
This test was previously not being run at all so this wasn't noticed until my fix just now. The test needs C++14 and it also should use scan-tree-dump, not scan-tree-dump-times, as it wasn't passing a count parameter. gcc/testsuite/ChangeLog: PR ipa/98265 * g++.dg/tree-ssa/pr98265.C: Use -std=c++14. Use scan-tree-dump instead of scan-tree-dump-times.
2025-03-27testsuite: g++.dg: vect: fix PR37143 filenameSam James1-0/+0
The test was being ignored because vect.exp looks for .cc in g++.dg/vect/. gcc/testsuite/ChangeLog: PR tree-optimization/37143 * g++.dg/vect/pr37143.C: Move to... * g++.dg/vect/pr37143.cc: ...here.
2025-03-27testsuite: tree-ssa: fix PR98265 filenameSam James1-0/+0
.C is for C++ testcases and gcc.dg's dg.exp ignores .c. The test was not being run. gcc/testsuite/ChangeLog: PR ipa/98265 * gcc.dg/tree-ssa/pr98265.C: Move to... * g++.dg/tree-ssa/pr98265.C: ...here.