aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2025-02-24Daily bump.GCC Administrator2-1/+7
2025-02-24x86: Add tests for PR tree-optimization/82142H.J. Lu2-0/+52
Verify that PR tree-optimization/82142 testcase is properly optimized. PR tree-optimization/82142 * gcc.target/i386/pr82142a.c: New file. * gcc.target/i386/pr82142b.c: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-23Daily bump.GCC Administrator5-1/+463
2025-02-22Turn test cases into UNSUPPORTED if running into 'sorry, unimplemented: ↵Thomas Schwinge373-482/+117
dynamic stack allocation not supported' In Subversion r217296 (Git commit e2acc079ff125a869159be45371dc0a29b230e92) "Testsuite alloca fixes for ptx", effective-target 'alloca' was added to mark up test cases that run into the nvptx back end's non-support of dynamic stack allocation. (Later, nvptx gained conditional support for that in commit 3861d362ec7e3c50742fc43833fe9d8674f4070e "nvptx: PTX 'alloca' for '-mptx=7.3'+, '-march=sm_52'+ [PR65181]", but on the other hand, in commit f93a612fc4567652b75ffc916d31a446378e6613 "bpf: liberate R9 for general register allocation", the BPF back end joined "the list of targets that do not support alloca in target-support.exp". Manually maintaining the list of test cases requiring effective-target 'alloca' is notoriously hard, gets out of date quickly: new test cases added to the test suite may need to be analyzed and annotated, and over time annotations also may need to be removed, in cases where the compiler learns to optimize out 'alloca'/VLA usage, for example. This commit replaces (99 % of) the manual annotations with an automatic scheme: turn test cases into UNSUPPORTED if running into 'sorry, unimplemented: dynamic stack allocation not supported'. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_alloca): Gracefully handle the case that we've not be called (indirectly) from 'dg-test'. * lib/gcc-dg.exp (proc gcc-dg-prune): Turn 'sorry, unimplemented: dynamic stack allocation not supported' into UNSUPPORTED. * c-c++-common/Walloca-larger-than.c: Don't 'dg-require-effective-target alloca'. * c-c++-common/Warray-bounds-9.c: Likewise. * c-c++-common/Warray-bounds.c: Likewise. * c-c++-common/Wdangling-pointer-2.c: Likewise. * c-c++-common/Wdangling-pointer-4.c: Likewise. * c-c++-common/Wdangling-pointer-5.c: Likewise. * c-c++-common/Wdangling-pointer.c: Likewise. * c-c++-common/Wimplicit-fallthrough-7.c: Likewise. * c-c++-common/Wsizeof-pointer-memaccess1.c: Likewise. * c-c++-common/Wsizeof-pointer-memaccess2.c: Likewise. * c-c++-common/Wstringop-truncation.c: Likewise. * c-c++-common/Wunused-var-6.c: Likewise. * c-c++-common/Wunused-var-8.c: Likewise. * c-c++-common/analyzer/alloca-leak.c: Likewise. * c-c++-common/analyzer/allocation-size-multiline-2.c: Likewise. * c-c++-common/analyzer/allocation-size-multiline-3.c: Likewise. * c-c++-common/analyzer/capacity-1.c: Likewise. * c-c++-common/analyzer/capacity-3.c: Likewise. * c-c++-common/analyzer/imprecise-floating-point-1.c: Likewise. * c-c++-common/analyzer/infinite-recursion-alloca.c: Likewise. * c-c++-common/analyzer/malloc-callbacks.c: Likewise. * c-c++-common/analyzer/malloc-paths-8.c: Likewise. * c-c++-common/analyzer/out-of-bounds-5.c: Likewise. * c-c++-common/analyzer/out-of-bounds-diagram-11.c: Likewise. * c-c++-common/analyzer/uninit-alloca.c: Likewise. * c-c++-common/analyzer/write-to-string-literal-5.c: Likewise. * c-c++-common/asan/alloca_loop_unpoisoning.c: Likewise. * c-c++-common/auto-init-11.c: Likewise. * c-c++-common/auto-init-12.c: Likewise. * c-c++-common/auto-init-15.c: Likewise. * c-c++-common/auto-init-16.c: Likewise. * c-c++-common/builtins.c: Likewise. * c-c++-common/dwarf2/vla1.c: Likewise. * c-c++-common/gomp/pr61486-2.c: Likewise. * c-c++-common/torture/builtin-clear-padding-4.c: Likewise. * c-c++-common/torture/strub-run3.c: Likewise. * c-c++-common/torture/strub-run4.c: Likewise. * c-c++-common/torture/strub-run4c.c: Likewise. * c-c++-common/torture/strub-run4d.c: Likewise. * c-c++-common/torture/strub-run4i.c: Likewise. * g++.dg/Walloca1.C: Likewise. * g++.dg/Walloca2.C: Likewise. * g++.dg/cpp0x/pr70338.C: Likewise. * g++.dg/cpp1y/lambda-generic-vla1.C: Likewise. * g++.dg/cpp1y/vla10.C: Likewise. * g++.dg/cpp1y/vla2.C: Likewise. * g++.dg/cpp1y/vla6.C: Likewise. * g++.dg/cpp1y/vla8.C: Likewise. * g++.dg/debug/debug5.C: Likewise. * g++.dg/debug/debug6.C: Likewise. * g++.dg/debug/pr54828.C: Likewise. * g++.dg/diagnostic/pr70105.C: Likewise. * g++.dg/eh/cleanup5.C: Likewise. * g++.dg/eh/spbp.C: Likewise. * g++.dg/ext/builtin_alloca.C: Likewise. * g++.dg/ext/tmplattr9.C: Likewise. * g++.dg/ext/vla10.C: Likewise. * g++.dg/ext/vla11.C: Likewise. * g++.dg/ext/vla12.C: Likewise. * g++.dg/ext/vla15.C: Likewise. * g++.dg/ext/vla16.C: Likewise. * g++.dg/ext/vla17.C: Likewise. * g++.dg/ext/vla23.C: Likewise. * g++.dg/ext/vla3.C: Likewise. * g++.dg/ext/vla6.C: Likewise. * g++.dg/ext/vla7.C: Likewise. * g++.dg/init/array24.C: Likewise. * g++.dg/init/new47.C: Likewise. * g++.dg/init/pr55497.C: Likewise. * g++.dg/opt/pr78201.C: Likewise. * g++.dg/template/vla2.C: Likewise. * g++.dg/torture/Wsizeof-pointer-memaccess1.C: Likewise. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: Likewise. * g++.dg/torture/pr62127.C: Likewise. * g++.dg/torture/pr67055.C: Likewise. * g++.dg/torture/stackalign/eh-alloca-1.C: Likewise. * g++.dg/torture/stackalign/eh-inline-2.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-1.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-2.C: Likewise. * g++.dg/warn/Wplacement-new-size-5.C: Likewise. * g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Likewise. * g++.dg/warn/Wvla-1.C: Likewise. * g++.dg/warn/Wvla-3.C: Likewise. * g++.old-deja/g++.ext/array2.C: Likewise. * g++.old-deja/g++.ext/constructor.C: Likewise. * g++.old-deja/g++.law/builtin1.C: Likewise. * g++.old-deja/g++.other/crash12.C: Likewise. * g++.old-deja/g++.other/eh3.C: Likewise. * g++.old-deja/g++.pt/array6.C: Likewise. * g++.old-deja/g++.pt/dynarray.C: Likewise. * gcc.c-torture/compile/20000923-1.c: Likewise. * gcc.c-torture/compile/20030224-1.c: Likewise. * gcc.c-torture/compile/20071108-1.c: Likewise. * gcc.c-torture/compile/20071117-1.c: Likewise. * gcc.c-torture/compile/900313-1.c: Likewise. * gcc.c-torture/compile/parms.c: Likewise. * gcc.c-torture/compile/pr17397.c: Likewise. * gcc.c-torture/compile/pr35006.c: Likewise. * gcc.c-torture/compile/pr42956.c: Likewise. * gcc.c-torture/compile/pr51354.c: Likewise. * gcc.c-torture/compile/pr52714.c: Likewise. * gcc.c-torture/compile/pr55851.c: Likewise. * gcc.c-torture/compile/pr77754-1.c: Likewise. * gcc.c-torture/compile/pr77754-2.c: Likewise. * gcc.c-torture/compile/pr77754-3.c: Likewise. * gcc.c-torture/compile/pr77754-4.c: Likewise. * gcc.c-torture/compile/pr77754-5.c: Likewise. * gcc.c-torture/compile/pr77754-6.c: Likewise. * gcc.c-torture/compile/pr78439.c: Likewise. * gcc.c-torture/compile/pr79413.c: Likewise. * gcc.c-torture/compile/pr82564.c: Likewise. * gcc.c-torture/compile/pr87110.c: Likewise. * gcc.c-torture/compile/pr99787-1.c: Likewise. * gcc.c-torture/compile/vla-const-1.c: Likewise. * gcc.c-torture/compile/vla-const-2.c: Likewise. * gcc.c-torture/execute/20010209-1.c: Likewise. * gcc.c-torture/execute/20020314-1.c: Likewise. * gcc.c-torture/execute/20020412-1.c: Likewise. * gcc.c-torture/execute/20021113-1.c: Likewise. * gcc.c-torture/execute/20040223-1.c: Likewise. * gcc.c-torture/execute/20040308-1.c: Likewise. * gcc.c-torture/execute/20040811-1.c: Likewise. * gcc.c-torture/execute/20070824-1.c: Likewise. * gcc.c-torture/execute/20070919-1.c: Likewise. * gcc.c-torture/execute/built-in-setjmp.c: Likewise. * gcc.c-torture/execute/pr22061-1.c: Likewise. * gcc.c-torture/execute/pr43220.c: Likewise. * gcc.c-torture/execute/pr82210.c: Likewise. * gcc.c-torture/execute/pr86528.c: Likewise. * gcc.c-torture/execute/vla-dealloc-1.c: Likewise. * gcc.dg/20001012-2.c: Likewise. * gcc.dg/20020415-1.c: Likewise. * gcc.dg/20030331-2.c: Likewise. * gcc.dg/20101010-1.c: Likewise. * gcc.dg/Walloca-1.c: Likewise. * gcc.dg/Walloca-10.c: Likewise. * gcc.dg/Walloca-11.c: Likewise. * gcc.dg/Walloca-12.c: Likewise. * gcc.dg/Walloca-13.c: Likewise. * gcc.dg/Walloca-14.c: Likewise. * gcc.dg/Walloca-15.c: Likewise. * gcc.dg/Walloca-2.c: Likewise. * gcc.dg/Walloca-3.c: Likewise. * gcc.dg/Walloca-4.c: Likewise. * gcc.dg/Walloca-5.c: Likewise. * gcc.dg/Walloca-6.c: Likewise. * gcc.dg/Walloca-7.c: Likewise. * gcc.dg/Walloca-8.c: Likewise. * gcc.dg/Walloca-9.c: Likewise. * gcc.dg/Walloca-larger-than-2.c: Likewise. * gcc.dg/Walloca-larger-than-3.c: Likewise. * gcc.dg/Walloca-larger-than-4.c: Likewise. * gcc.dg/Walloca-larger-than.c: Likewise. * gcc.dg/Warray-bounds-22.c: Likewise. * gcc.dg/Warray-bounds-41.c: Likewise. * gcc.dg/Warray-bounds-46.c: Likewise. * gcc.dg/Warray-bounds-48-novec.c: Likewise. * gcc.dg/Warray-bounds-48.c: Likewise. * gcc.dg/Warray-bounds-50.c: Likewise. * gcc.dg/Warray-bounds-63.c: Likewise. * gcc.dg/Warray-bounds-66.c: Likewise. * gcc.dg/Wdangling-pointer.c: Likewise. * gcc.dg/Wfree-nonheap-object-2.c: Likewise. * gcc.dg/Wfree-nonheap-object.c: Likewise. * gcc.dg/Wrestrict-17.c: Likewise. * gcc.dg/Wrestrict.c: Likewise. * gcc.dg/Wreturn-local-addr-2.c: Likewise. * gcc.dg/Wreturn-local-addr-3.c: Likewise. * gcc.dg/Wreturn-local-addr-4.c: Likewise. * gcc.dg/Wreturn-local-addr-6.c: Likewise. * gcc.dg/Wsizeof-pointer-memaccess1.c: Likewise. * gcc.dg/Wstack-usage.c: Likewise. * gcc.dg/Wstrict-aliasing-bogus-vla-1.c: Likewise. * gcc.dg/Wstrict-overflow-27.c: Likewise. * gcc.dg/Wstringop-overflow-15.c: Likewise. * gcc.dg/Wstringop-overflow-23.c: Likewise. * gcc.dg/Wstringop-overflow-25.c: Likewise. * gcc.dg/Wstringop-overflow-27.c: Likewise. * gcc.dg/Wstringop-overflow-3.c: Likewise. * gcc.dg/Wstringop-overflow-39.c: Likewise. * gcc.dg/Wstringop-overflow-56.c: Likewise. * gcc.dg/Wstringop-overflow-57.c: Likewise. * gcc.dg/Wstringop-overflow-67.c: Likewise. * gcc.dg/Wstringop-overflow-71.c: Likewise. * gcc.dg/Wstringop-truncation-3.c: Likewise. * gcc.dg/Wvla-larger-than-1.c: Likewise. * gcc.dg/Wvla-larger-than-2.c: Likewise. * gcc.dg/Wvla-larger-than-3.c: Likewise. * gcc.dg/Wvla-larger-than-4.c: Likewise. * gcc.dg/Wvla-larger-than-5.c: Likewise. * gcc.dg/analyzer/boxed-malloc-1.c: Likewise. * gcc.dg/analyzer/call-summaries-2.c: Likewise. * gcc.dg/analyzer/malloc-1.c: Likewise. * gcc.dg/analyzer/malloc-reuse.c: Likewise. * gcc.dg/analyzer/out-of-bounds-diagram-12.c: Likewise. * gcc.dg/analyzer/pr93355-localealias.c: Likewise. * gcc.dg/analyzer/putenv-1.c: Likewise. * gcc.dg/analyzer/taint-alloc-1.c: Likewise. * gcc.dg/analyzer/torture/pr93373.c: Likewise. * gcc.dg/analyzer/torture/ubsan-1.c: Likewise. * gcc.dg/analyzer/vla-1.c: Likewise. * gcc.dg/atomic/stdatomic-vm.c: Likewise. * gcc.dg/attr-alloc_size-6.c: Likewise. * gcc.dg/attr-alloc_size-7.c: Likewise. * gcc.dg/attr-alloc_size-8.c: Likewise. * gcc.dg/attr-alloc_size-9.c: Likewise. * gcc.dg/attr-noipa.c: Likewise. * gcc.dg/auto-init-uninit-36.c: Likewise. * gcc.dg/auto-init-uninit-9.c: Likewise. * gcc.dg/auto-type-1.c: Likewise. * gcc.dg/builtin-alloc-size.c: Likewise. * gcc.dg/builtin-dynamic-alloc-size.c: Likewise. * gcc.dg/builtin-dynamic-object-size-1.c: Likewise. * gcc.dg/builtin-dynamic-object-size-2.c: Likewise. * gcc.dg/builtin-dynamic-object-size-3.c: Likewise. * gcc.dg/builtin-dynamic-object-size-4.c: Likewise. * gcc.dg/builtin-object-size-1.c: Likewise. * gcc.dg/builtin-object-size-2.c: Likewise. * gcc.dg/builtin-object-size-3.c: Likewise. * gcc.dg/builtin-object-size-4.c: Likewise. * gcc.dg/builtins-64.c: Likewise. * gcc.dg/builtins-68.c: Likewise. * gcc.dg/c23-auto-2.c: Likewise. * gcc.dg/c99-const-expr-13.c: Likewise. * gcc.dg/c99-vla-1.c: Likewise. * gcc.dg/fold-alloca-1.c: Likewise. * gcc.dg/gomp/pr30494.c: Likewise. * gcc.dg/gomp/vla-2.c: Likewise. * gcc.dg/gomp/vla-3.c: Likewise. * gcc.dg/gomp/vla-4.c: Likewise. * gcc.dg/gomp/vla-5.c: Likewise. * gcc.dg/graphite/pr99085.c: Likewise. * gcc.dg/guality/guality.c: Likewise. * gcc.dg/lto/pr80778_0.c: Likewise. * gcc.dg/nested-func-10.c: Likewise. * gcc.dg/nested-func-12.c: Likewise. * gcc.dg/nested-func-13.c: Likewise. * gcc.dg/nested-func-14.c: Likewise. * gcc.dg/nested-func-15.c: Likewise. * gcc.dg/nested-func-16.c: Likewise. * gcc.dg/nested-func-17.c: Likewise. * gcc.dg/nested-func-9.c: Likewise. * gcc.dg/packed-vla.c: Likewise. * gcc.dg/pr100225.c: Likewise. * gcc.dg/pr25682.c: Likewise. * gcc.dg/pr27301.c: Likewise. * gcc.dg/pr31507-1.c: Likewise. * gcc.dg/pr33238.c: Likewise. * gcc.dg/pr41470.c: Likewise. * gcc.dg/pr49120.c: Likewise. * gcc.dg/pr50764.c: Likewise. * gcc.dg/pr51491-2.c: Likewise. * gcc.dg/pr51990-2.c: Likewise. * gcc.dg/pr51990.c: Likewise. * gcc.dg/pr59011.c: Likewise. * gcc.dg/pr59523.c: Likewise. * gcc.dg/pr61561.c: Likewise. * gcc.dg/pr78468.c: Likewise. * gcc.dg/pr78902.c: Likewise. * gcc.dg/pr79972.c: Likewise. * gcc.dg/pr82875.c: Likewise. * gcc.dg/pr83844.c: Likewise. * gcc.dg/pr84131.c: Likewise. * gcc.dg/pr87099.c: Likewise. * gcc.dg/pr87320.c: Likewise. * gcc.dg/pr89045.c: Likewise. * gcc.dg/pr91014.c: Likewise. * gcc.dg/pr93986.c: Likewise. * gcc.dg/pr98721-1.c: Likewise. * gcc.dg/pr99122-2.c: Likewise. * gcc.dg/shrink-wrap-alloca.c: Likewise. * gcc.dg/sso-14.c: Likewise. * gcc.dg/strlenopt-62.c: Likewise. * gcc.dg/strlenopt-83.c: Likewise. * gcc.dg/strlenopt-84.c: Likewise. * gcc.dg/strlenopt-91.c: Likewise. * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise. * gcc.dg/torture/calleesave-sse.c: Likewise. * gcc.dg/torture/pr48953.c: Likewise. * gcc.dg/torture/pr71881.c: Likewise. * gcc.dg/torture/pr71901.c: Likewise. * gcc.dg/torture/pr78742.c: Likewise. * gcc.dg/torture/pr92088-1.c: Likewise. * gcc.dg/torture/pr92088-2.c: Likewise. * gcc.dg/torture/pr93124.c: Likewise. * gcc.dg/torture/pr94479.c: Likewise. * gcc.dg/torture/stackalign/alloca-1.c: Likewise. * gcc.dg/torture/stackalign/inline-2.c: Likewise. * gcc.dg/torture/stackalign/nested-3.c: Likewise. * gcc.dg/torture/stackalign/vararg-1.c: Likewise. * gcc.dg/torture/stackalign/vararg-2.c: Likewise. * gcc.dg/tree-ssa/20030807-2.c: Likewise. * gcc.dg/tree-ssa/20080530.c: Likewise. * gcc.dg/tree-ssa/alias-37.c: Likewise. * gcc.dg/tree-ssa/builtin-sprintf-warn-22.c: Likewise. * gcc.dg/tree-ssa/builtin-sprintf-warn-25.c: Likewise. * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Likewise. * gcc.dg/tree-ssa/loop-interchange-15.c: Likewise. * gcc.dg/tree-ssa/pr23848-1.c: Likewise. * gcc.dg/tree-ssa/pr23848-2.c: Likewise. * gcc.dg/tree-ssa/pr23848-3.c: Likewise. * gcc.dg/tree-ssa/pr23848-4.c: Likewise. * gcc.dg/uninit-32.c: Likewise. * gcc.dg/uninit-36.c: Likewise. * gcc.dg/uninit-39.c: Likewise. * gcc.dg/uninit-41.c: Likewise. * gcc.dg/uninit-9-O0.c: Likewise. * gcc.dg/uninit-9.c: Likewise. * gcc.dg/uninit-pr100250.c: Likewise. * gcc.dg/uninit-pr101300.c: Likewise. * gcc.dg/uninit-pr101494.c: Likewise. * gcc.dg/uninit-pr98583.c: Likewise. * gcc.dg/vla-2.c: Likewise. * gcc.dg/vla-22.c: Likewise. * gcc.dg/vla-24.c: Likewise. * gcc.dg/vla-3.c: Likewise. * gcc.dg/vla-4.c: Likewise. * gcc.dg/vla-stexp-1.c: Likewise. * gcc.dg/vla-stexp-2.c: Likewise. * gcc.dg/vla-stexp-4.c: Likewise. * gcc.dg/vla-stexp-5.c: Likewise. * gcc.dg/winline-7.c: Likewise. * gcc.target/aarch64/stack-check-alloca-1.c: Likewise. * gcc.target/aarch64/stack-check-alloca-10.c: Likewise. * gcc.target/aarch64/stack-check-alloca-2.c: Likewise. * gcc.target/aarch64/stack-check-alloca-3.c: Likewise. * gcc.target/aarch64/stack-check-alloca-4.c: Likewise. * gcc.target/aarch64/stack-check-alloca-5.c: Likewise. * gcc.target/aarch64/stack-check-alloca-6.c: Likewise. * gcc.target/aarch64/stack-check-alloca-7.c: Likewise. * gcc.target/aarch64/stack-check-alloca-8.c: Likewise. * gcc.target/aarch64/stack-check-alloca-9.c: Likewise. * gcc.target/arc/interrupt-6.c: Likewise. * gcc.target/i386/pr80969-3.c: Likewise. * gcc.target/loongarch/stack-check-alloca-1.c: Likewise. * gcc.target/loongarch/stack-check-alloca-2.c: Likewise. * gcc.target/loongarch/stack-check-alloca-3.c: Likewise. * gcc.target/loongarch/stack-check-alloca-4.c: Likewise. * gcc.target/loongarch/stack-check-alloca-5.c: Likewise. * gcc.target/loongarch/stack-check-alloca-6.c: Likewise. * gcc.target/riscv/stack-check-alloca-1.c: Likewise. * gcc.target/riscv/stack-check-alloca-10.c: Likewise. * gcc.target/riscv/stack-check-alloca-2.c: Likewise. * gcc.target/riscv/stack-check-alloca-3.c: Likewise. * gcc.target/riscv/stack-check-alloca-4.c: Likewise. * gcc.target/riscv/stack-check-alloca-5.c: Likewise. * gcc.target/riscv/stack-check-alloca-6.c: Likewise. * gcc.target/riscv/stack-check-alloca-7.c: Likewise. * gcc.target/riscv/stack-check-alloca-8.c: Likewise. * gcc.target/riscv/stack-check-alloca-9.c: Likewise. * gcc.target/sparc/setjmp-1.c: Likewise. * gcc.target/x86_64/abi/ms-sysv/ms-sysv.c: Likewise. * gcc.c-torture/compile/20001221-1.c: Don't 'dg-skip-if' for '! alloca'. * gcc.c-torture/compile/20020807-1.c: Likewise. * gcc.c-torture/compile/20050801-2.c: Likewise. * gcc.c-torture/compile/920428-4.c: Likewise. * gcc.c-torture/compile/debugvlafunction-1.c: Likewise. * gcc.c-torture/compile/pr41469.c: Likewise. * gcc.c-torture/execute/920721-2.c: Likewise. * gcc.c-torture/execute/920929-1.c: Likewise. * gcc.c-torture/execute/921017-1.c: Likewise. * gcc.c-torture/execute/941202-1.c: Likewise. * gcc.c-torture/execute/align-nest.c: Likewise. * gcc.c-torture/execute/alloca-1.c: Likewise. * gcc.c-torture/execute/pr22061-4.c: Likewise. * gcc.c-torture/execute/pr36321.c: Likewise. * gcc.dg/torture/pr8081.c: Likewise. * gcc.dg/analyzer/data-model-1.c: Don't 'dg-require-effective-target alloca'. XFAIL relevant 'dg-warning's for '! alloca'. * gcc.dg/uninit-38.c: Likewise. * gcc.dg/uninit-pr98578.c: Likewise. * gcc.dg/compat/struct-by-value-22_main.c: Comment on 'dg-require-effective-target alloca'. libstdc++-v3/ * testsuite/lib/prune.exp (proc libstdc++-dg-prune): Turn 'sorry, unimplemented: dynamic stack allocation not supported' into UNSUPPORTED.
2025-02-22Gracefully handle the case that ↵Thomas Schwinge2-1/+11
'gcc/testsuite/lib/gcc-dg.exp:find-dg-do-what' has not been called (indirectly) from 'dg-test' No change in behavior intended. gcc/testsuite/ * lib/gcc-dg.exp (find-dg-do-what): Gracefully handle the case that we've not be called (indirectly) from 'dg-test'. * lib/target-supports.exp (check_effective_target_stack_size) (check_effective_target_alloca): Catch this.
2025-02-22Refactor duplicated code into 'gcc/testsuite/lib/gcc-dg.exp:find-dg-do-what'Thomas Schwinge2-18/+18
No change in behavior intended. gcc/testsuite/ * lib/gcc-dg.exp (proc find-dg-do-what): New. * lib/target-supports.exp (check_effective_target_stack_size) (check_effective_target_alloca): Use it.
2025-02-22BPF, nvptx: Standardize on 'sorry, unimplemented: dynamic stack allocation ↵Thomas Schwinge7-9/+11
not supported' ... instead of BPF: 'error: BPF does not support dynamic stack allocation', and nvptx: 'sorry, unimplemented: target cannot support alloca'. gcc/ * config/bpf/bpf.md (define_expand "allocate_stack"): Emit 'sorry, unimplemented: dynamic stack allocation not supported'. * config/nvptx/nvptx.md (define_expand "allocate_stack") [!TARGET_SOFT_STACK && !(TARGET_PTX_7_3 && TARGET_SM52)]: Likewise. gcc/testsuite/ * gcc.target/bpf/diag-alloca-1.c: Adjust 'dg-message'. * gcc.target/bpf/diag-alloca-2.c: Likewise. * gcc.target/nvptx/alloca-1-sm_30.c: Likewise. * gcc.target/nvptx/vla-1-sm_30.c: Likewise. * lib/target-supports.exp (proc check_effective_target_alloca): Adjust comment.
2025-02-22OpenMP: Silence uninitialized variable warning in C++ front end.Sandra Loosemore1-1/+1
There's no actual problem with the code here, just a false-positive warning emitted by some older GCC versions. gcc/cp/ChangeLog * parser.cc (cp_finish_omp_declare_variant): Initialize append_args_last.
2025-02-22PR modula2/118978 ICE when attempting to pass an incompatible parameterGaius Mulley5-62/+219
This bugfix is for a an ICE which occurs if an incompatible parameter is passed to a procedure. In particular if a REAL constant actual parameter is passed to INTEGER formal parameter then M2Range is invoked to check the type and then M2Range is called to check the value range. The value range check causes an ICE. The bug fix introduces range dependencies on type checks. If the type check fails an error message is generated and any future range check cancelled. These range and type checks are tightly coupled when generating parameter quad intermediate code. gcc/m2/ChangeLog: PR modula2/118978 * gm2-compiler/M2Check.mod (checkConstMeta): Add check for typed constants. * gm2-compiler/M2Quads.mod (BoolFrame): New field RangeDep. (CheckProcedureParameters): Call PutRangeDep to associate the range dependency with the parameter on the quad stack. Pass ParamCheckId to CheckParameter. (CheckProcTypeAndProcedure): Add ParamCheckId parameter. Pass ParamCheckId to BuildRange. (CheckParameter): New parameter ParamCheckId. Pass ParamCheckId to CheckProcTypeAndProcedure. (CheckParameterOrdinals): Add extra range dep parameter to the call of InitParameterRangeCheck. (ConvertBooleanToVariable): Initialize RangeDep field. (PushBacktok): Ditto. (OperandRangeDep): New procedure. (PutRangeDep): Ditto. * gm2-compiler/M2Range.def (InitTypesParameterCheck): Add new parameter depRangeId. (InitParameterRangeCheck): Add new parameter parentRangeId. (FoldRangeCheck): Add new parameter range. * gm2-compiler/M2Range.mod (InitTypesParameterCheck): Add new parameter depRangeId. (InitParameterRangeCheck): Add new parameter parentRangeId. (FoldRangeCheck): Add new parameter range and rewrite. (FoldRangeCheckLower): New procedure. (Range): New field cancelled. New field dependantid. (PutRangeParam): Initialize dependantid. (PutRangeParamAssign): Ditto. (CheckCancelled): New procedure. (Cancel): Ditto. (IsCancelled): New procedure function. (FoldTypeParam): Add depRangeId parameter. (WriteRangeCheck): Add dependent debugging. gcc/testsuite/ChangeLog: PR modula2/118978 * gm2/pim/fail/badparamtype.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2025-02-22Daily bump.GCC Administrator4-1/+47
2025-02-22Append a newline in debug_edgeH.J. Lu1-0/+1
Append a newline in debug_edge so that we get (gdb) call debug_edge (e) edge (bb_9, bb_1) (gdb) instead of (gdb) call debug_edge (e) edge (bb_9, bb_1)(gdb) * sese.cc (debug_edge): Append a newline. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-21tree-optimization/118954 - avoid UB on ref created by predcomRichard Biener2-1/+24
When predicitive commoning moves an invariant ref it makes sure to not build a MEM_REF with a base that is negatively offsetted from an object. But in trying to preserve some transforms it does not consider association of a constant offset with the address computation in DR_BASE_ADDRESS leading to exactly this problem again. This is arguably a problem in data-ref analysis producing such an out-of-bound DR_BASE_ADDRESS, but this looks quite involved to fix, so the following avoids the association in one more case. This fixes the testcase while preserving the desired transform in gcc.dg/tree-ssa/predcom-1.c. PR tree-optimization/118954 * tree-predcom.cc (ref_at_iteration): Make sure to not associate the constant offset with DR_BASE_ADDRESS when that is an offsetted pointer. * gcc.dg/torture/pr118954.c: New testcase.
2025-02-21Improve g++.dg/torture/pr118521.CRichard Biener1-1/+1
Alexander pointed out the way to do a dg-bogus in an included header. PR tree-optimization/118521 * g++.dg/torture/pr118521.C: Use dg-bogus properly.
2025-02-21Fortran: initialize non-saved pointers with -fcheck=pointer [PR48958]Harald Anlauf2-2/+29
PR fortran/48958 gcc/fortran/ChangeLog: * trans-array.cc (gfc_trans_deferred_array): Initialize the data component of non-saved pointers when -fcheck=pointer is set. gcc/testsuite/ChangeLog: * gfortran.dg/pointer_init_13.f90: New test.
2025-02-21Fortran: Improve gfc_array_kind for assumed rank; gfc_tree_array_size on 'tree'Tobias Burnus4-44/+90
Improve the internal and debug representation of assumed-rank arrays by honoring the pointer and allocatable property. Permit obtaining the array size from only a tree (via the array descriptor) besides obtaining it from the gfc_expr's array spec. This will be used by a follow up OpenMP patch for mapping derived types with allocatable components. gcc/fortran/ChangeLog: * trans-array.cc (gfc_full_array_size): Obtain the rank from the array descriptor for assumed rank. (gfc_tree_array_size): Likewise; permit expr = NULL to operate only the tree. (gfc_conv_descriptor_stride_get): Update for added assumed-rank array types. * trans-openmp.cc (gfc_omp_finish_clause): Likewise. * trans-types.cc (gfc_build_array_type, gfc_get_derived_type, gfc_get_array_descr_info): Likewise. * trans.h (enum gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK_{ALLOCATABLE,POINTER{,_CONT}}.
2025-02-21Daily bump.GCC Administrator4-1/+312
2025-02-20diagnostics: add comments about global_dcDavid Malcolm1-3/+6
No functional change intended. gcc/ChangeLog: * diagnostic-core.h: Add comments making clear that these functions implicitly use global_dc. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-02-20sarif-replay: add testcase for empty input fileDavid Malcolm1-0/+2
gcc/testsuite/ChangeLog: * sarif-replay.dg/malformed-json/empty.sarif: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-02-20sarif-replay: improve error for unescaped braces in messages (§3.11.5)David Malcolm2-14/+33
Spotted via https://github.com/llvm/llvm-project/issues/128024 gcc/ChangeLog: * libsarifreplay.cc (sarif_replayer::make_plain_text_within_result_message): Capture which json::string was used. When reporting on unescaped "{" or "}" in SARIF message strings, use that string rather than the message object, and refer the user to §3.11.5 ("Messages with placeholders") rather than §3.11.11 ("arguments"). Ideally we'd place the error at the precise character, but that can't be done without reworking json-parsing.cc's lexer::lex_string, which is too invasive for stage 4. (sarif_replayer::get_plain_text_from_mfms): Capture which json::string was used. (sarif_replayer::lookup_plain_text_within_result_message): Likewise. gcc/testsuite/ChangeLog: * sarif-replay.dg/2.1.0-invalid/3.11.11-malformed-placeholder.sarif: Rename to... * sarif-replay.dg/2.1.0-invalid/3.11.5-unescaped-braces.sarif: ...this. Update expected subsection in error message, and expected underline in quoted JSON. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-02-20doc: Drop note for Binutils pre 2.24Gerald Pfeifer1-4/+0
Binutils 2.24 was released in 2013, so this is more than 11 years old. gcc: PR target/69374 * doc/install.texi (Specific, aarch64*-*-*): Drop note for Binutils pre 2.24.
2025-02-20aarch64: Remove old aarch64_expand_sve_vec_cmp_float codeRichard Sandiford3-29/+11
While looking at PR118956, I noticed that we had some dead code left over after the removal of the vcond patterns. The can_invert_p path is no longer used. gcc/ * config/aarch64/aarch64-protos.h (aarch64_expand_sve_vec_cmp_float): Remove can_invert_p argument and change return type to void. * config/aarch64/aarch64.cc (aarch64_expand_sve_vec_cmp_float): Likewise. * config/aarch64/aarch64-sve.md (vec_cmp<mode><vpred>): Update call accordingly.
2025-02-20testsuite: Fix sve/pcs/args_1.c failures [PR116604]Richard Sandiford1-15/+16
This test has been failing since r15-1619-g3b9b8d6cfdf593, which made IRA prefer a call-clobbered register over a call-preserved register for mem1 (the second load). In this particular case, that just forces the variable p3 to be allocated to a call-preserved register instead, leading to an extra predicate move from p3 to that register. However, it was really pot luck that this worked before. Each argument is used exactly once, so there isn't an obvious colouring order. And mem0 and mem1 are passed by indirect reference, so they are not REG_EQUIV to a stack slot in the way that some memory arguments are. IIRC, the test was the result of some experimentation, and so I think the best fix is to rework it to try to make it less sensitive to RA decisions. This patch does that by enabling scheduling for the function and using both memory arguments in the same instruction. This gets rid of the distracting prologue and epilogue code and restricts the test to the PCS parts. gcc/testsuite/ PR testsuite/116604 * gcc.target/aarch64/sve/pcs/args_1.c (callee_pred): Enable scheduling and use both memory arguments in the same instruction. Expect no prologue and epilogue code.
2025-02-20testsuite: Fix sve/var_stride_*.c failuresRichard Sandiford2-4/+2
gcc.target/aarch64/sve/var_stride_2.c started failing after r15-268-g9dbff9c05520, but the change was an improvement: @@ -36,13 +36,11 @@ b.any .L9 ret .L17: - ubfiz x5, x3, 10, 16 - ubfiz x4, x2, 10, 16 - add x5, x1, x5 - add x4, x0, x4 - cmp x0, x5 - ccmp x1, x4, 2, ls uxtw x4, w2 + add x6, x1, x3, lsl 10 + cmp x0, x6 + add x5, x0, x4, lsl 10 + ccmp x1, x5, 2, ls ccmp w2, 0, 4, hi beq .L3 cntb x7 This patch therefore changes the test to expect the new output for var_stride_2.c. The changes for var_stride_4.c were a wash, with both versions having 18(!) arithmetic instructions before the alias check branch. Both versions sign-extend the n and m arguments as part of this sequence; the question is whether they do it first or later. This patch therefore changes the test to accept either the old or the new code for var_stride_4.c. gcc/testsuite/ * gcc.target/aarch64/sve/var_stride_2.c: Expect ADD+LSL. * gcc.target/aarch64/sve/var_stride_4.c: Accept LSL or SBFIZ.
2025-02-20tree-optimization/118521 - bogus diagnostic from unreachable codeRichard Biener2-0/+32
When SCCP does final value replacement we end up with unfolded IL like __result_274 = _150 + 1; ... __new_finish_106 = __result_274 + 3; <-- from SCCP _115 = _150 + 4; if (__new_finish_106 != _115) this does only get rectified by the next full folding which happens in forwprop4 which is after the strlen pass emitting the unwanted diagnostic. The following mitigates this case in a similar way as r15-7472 did for PR118817 - by ensuring we have the IL folded. This is done by simply folding all immediate uses of the former PHI def that SCCP replaces. All other more general approaches have too much fallout at this point. PR tree-optimization/118521 * tree-scalar-evolution.cc (final_value_replacement_loop): Fold uses of the replaced PHI def. * g++.dg/torture/pr118521.C: New testcase.
2025-02-20invoke.texi: Fix typo in the file-cache-lines paramFilip Kastl1-1/+1
file-cache-lines param was documented as file-cache-files. This fixes the typo. gcc/ChangeLog: * doc/invoke.texi: Fix typo file-cache-files -> file-cache-lines. Signed-off-by: Filip Kastl <fkastl@suse.cz>
2025-02-20Fortran: Remove deprecated coarray routines [PR107635]Andre Vehreschild4-1494/+0
gcc/fortran/ChangeLog: PR fortran/107635 * gfortran.texi: Remove deprecated functions from documentation. * trans-decl.cc (gfc_build_builtin_function_decls): Remove decprecated function decls. * trans-intrinsic.cc (gfc_conv_intrinsic_exponent): Remove deprecated/no longer needed routines. * trans.h: Remove unused decls. libgfortran/ChangeLog: * caf/libcaf.h (_gfortran_caf_get): Removed because deprecated. (_gfortran_caf_send): Same. (_gfortran_caf_sendget): Same. (_gfortran_caf_send_by_ref): Same. * caf/single.c (assign_char4_from_char1): Same. (assign_char1_from_char4): Same. (convert_type): Same. (defined): Same. (_gfortran_caf_get): Same. (_gfortran_caf_send): Same. (_gfortran_caf_sendget): Same. (copy_data): Same. (get_for_ref): Same. (_gfortran_caf_get_by_ref): Same. (send_by_ref): Same. (_gfortran_caf_send_by_ref): Same. (_gfortran_caf_sendget_by_ref): Same.
2025-02-20Fortran: Add transfer_between_remotes [PR107635]Andre Vehreschild7-1072/+1436
Add the last missing coarray data manipulation routine using remote accessors. gcc/fortran/ChangeLog: PR fortran/107635 * coarray.cc (rewrite_caf_send): Rewrite to transfer_between_remotes when both sides of the assignment have a coarray. (coindexed_code_callback): Prevent duplicate rewrite. * gfortran.texi: Add documentation for transfer_between_remotes. * intrinsic.cc (add_subroutines): Add intrinsic symbol for caf_sendget to allow easy rewrite to transfer_between_remotes. * trans-decl.cc (gfc_build_builtin_function_decls): Add prototype for transfer_between_remotes. * trans-intrinsic.cc (conv_caf_vector_subscript_elem): Mark as deprecated. (conv_caf_vector_subscript): Same. (compute_component_offset): Same. (conv_expr_ref_to_caf_ref): Same. (conv_stat_and_team): Extract stat and team from expr. (gfc_conv_intrinsic_caf_get): Use conv_stat_and_team. (conv_caf_send_to_remote): Same. (has_ref_after_cafref): Mark as deprecated. (conv_caf_sendget): Translate to transfer_between_remotes. * trans.h: Add prototype for transfer_between_remotes. libgfortran/ChangeLog: * caf/libcaf.h: Add prototype for transfer_between_remotes. * caf/single.c: Implement transfer_between_remotes. gcc/testsuite/ChangeLog: * gfortran.dg/coarray_lib_comm_1.f90: Fix up scan_trees.
2025-02-20Fortran: Add send_to_remote [PR107635]Andre Vehreschild9-68/+652
Refactor to use send_to_remote instead of the slow send_by_ref. gcc/fortran/ChangeLog: PR fortran/107635 * coarray.cc (move_coarray_ref): Move the coarray reference out of the given one. Especially when there is a regular array ref. (fixup_comp_refs): Move components refs to a derived type where the codim has been removed, aka a new type. (split_expr_at_caf_ref): Correctly split the reference chain. (remove_caf_ref): Simplify. (create_get_callback): Fix some deficiencies. (create_allocated_callback): Adapt to new signature of split. (create_send_callback): New function. (rewrite_caf_send): Rewrite a call to caf_send to caf_send_to_remote. (coindexed_code_callback): Treat caf_send and caf_sendget correctly. * gfortran.h (enum gfc_isym_id): Add SENDGET-isym. * gfortran.texi: Add documentation for send_to_remote. * resolve.cc (gfc_resolve_code): No longer generate send_by_ref when allocatable coarray (component) is on the lhs. * trans-decl.cc (gfc_build_builtin_function_decls): Add caf_send_to_remote decl. * trans-intrinsic.cc (conv_caf_func_index): Ensure the static variables created are not in a block-scope. (conv_caf_send_to_remote): Translate caf_send_to_remote calls. (conv_caf_send): Renamed to conv_caf_sendget. (conv_caf_sendget): Renamed from conv_caf_send. (gfc_conv_intrinsic_subroutine): Branch correctly for conv_caf_send and sendget. * trans.h: Correct decl. libgfortran/ChangeLog: * caf/libcaf.h: Add/Correct prototypes for caf_get_from_remote, caf_send_to_remote. * caf/single.c (struct accessor_hash_t): Rename accessor_t to getter_t. (_gfortran_caf_register_accessor): Use new name of getter_t. (_gfortran_caf_send_to_remote): New function for sending data to coarray on a remote image. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/send_char_array_1.f90: Extend test to catch more cases. * gfortran.dg/coarray_42.f90: Invert tests use, because no longer a send is needed when local memory in a coarray is allocated.
2025-02-20Fortran: Add caf_is_present_on_remote. [PR107635]Andre Vehreschild9-98/+268
Replace caf_is_present by caf_is_present_on_remote which is using a dedicated callback for each object to test on the remote image. gcc/fortran/ChangeLog: PR fortran/107635 * coarray.cc (create_allocated_callback): Add creating remote side procedure for checking allocation status of coarray. (rewrite_caf_allocated): Rewrite ALLOCATED on coarray to use caf routine. (coindexed_expr_callback): Exempt caf_is_present_on_remote from being rewritten again. * gfortran.h (enum gfc_isym_id): Add caf_is_present_on_remote id. * gfortran.texi: Add documentation for caf_is_present_on_remote. * intrinsic.cc (add_functions): Add caf_is_present_on_remote symbol. * trans-decl.cc (gfc_build_builtin_function_decls): Define interface of caf_is_present_on_remote. * trans-intrinsic.cc (gfc_conv_intrinsic_caf_is_present_remote): Translate caf_is_present_on_remote. (trans_caf_is_present): Remove. (caf_this_image_ref): Remove. (gfc_conv_allocated): Take out coarray treatment, because that is rewritten to caf_is_present_on_remote now. (gfc_conv_intrinsic_function): Handle caf_is_present_on_remote calls. * trans.h: Add symbol for caf_is_present_on_remote and remove old one. libgfortran/ChangeLog: * caf/libcaf.h (_gfortran_caf_is_present_on_remote): Add new function. (_gfortran_caf_is_present): Remove deprecated one. * caf/single.c (struct accessor_hash_t): Add function ptr access for remote side call. (_gfortran_caf_is_present_on_remote): Added. (_gfortran_caf_is_present): Removed. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/coarray_allocated.f90: Adapt to new method of checking on remote image. * gfortran.dg/coarray_lib_alloc_4.f90: Same.
2025-02-20Fortran: Allow to use non-pure/non-elemental functions in coarray indexes ↵Andre Vehreschild5-141/+480
[PR107635] Extract calls to non-pure or non-elemental functions from index expressions on a coarray. gcc/fortran/ChangeLog: PR fortran/107635 * coarray.cc (get_arrayspec_from_expr): Treat array result of function calls correctly. (remove_coarray_from_derived_type): Prevent memory loss. (add_caf_get_from_remote): Correct locus. (find_comp): New function to find or create a new component in a derived type. (check_add_new_comp_handle_array): Handle allocatable arrays or non-pure/non-elemental functions in indexes of coarrays. (check_add_new_component): Use above function. (create_get_parameter_type): Rename to create_caf_add_data_parameter_type. (create_caf_add_data_parameter_type): Renaming of variable and make the additional data a coarray. (remove_caf_ref): Factor out to reuse in other caf-functions. (create_get_callback): Use function factored out, set locus correctly and ensure a kind is set for parameters. (add_caf_get_intrinsic): Rename to add_caf_get_from_remote and rename some variables. (coindexed_expr_callback): Skip over function created by the rewriter. (coindexed_code_callback): Filter some intrinsics not to process. (gfc_coarray_rewrite): Rewrite also contained functions. * trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Reflect changed order on caf_get_from_remote (). libgfortran/ChangeLog: * caf/libcaf.h (_gfortran_caf_register_accessor): Reflect changed parameter order. * caf/single.c (struct accessor_hash_t): Same. (_gfortran_caf_register_accessor): Call accessor using a token for accessing arrays with a descriptor on the source side. gcc/testsuite/ChangeLog: * gfortran.dg/coarray_lib_comm_1.f90: Adapt scan expression. * gfortran.dg/coarray/get_with_fn_parameter.f90: New test. * gfortran.dg/coarray/get_with_scalar_fn.f90: New test.
2025-02-20Fortran: Prepare for more caf-rework. [PR107635]Andre Vehreschild7-135/+155
Factor out generation of code to get remote function index and to create the additional data structure. Rename caf_get_by_ct to caf_get_from_remote. gcc/fortran/ChangeLog: PR fortran/107635 * gfortran.texi: Rename caf_get_by_ct to caf_get_from_remote. * trans-decl.cc (gfc_build_builtin_function_decls): Rename intrinsic. * trans-intrinsic.cc (conv_caf_func_index): Factor out functionality to be reused by other caf-functions. (conv_caf_add_call_data): Same. (gfc_conv_intrinsic_caf_get): Use functions factored out. * trans.h: Rename intrinsic symbol. libgfortran/ChangeLog: * caf/libcaf.h (_gfortran_caf_get_by_ref): Remove from ABI. This function is replaced by caf_get_from_remote (). (_gfortran_caf_get_remote_function_index): Use better name. * caf/single.c (_gfortran_caf_finalize): Free internal data. (_gfortran_caf_get_by_ref): Remove from public interface, but keep it, because it is still used by sendget (). gcc/testsuite/ChangeLog: * gfortran.dg/coarray_lib_comm_1.f90: Adapt to renamed ABI function. * gfortran.dg/coarray_stat_function.f90: Same. * gfortran.dg/coindexed_1.f90: Same.
2025-02-20Fortran: Move caf_get-rewrite to coarray.cc [PR107635]Andre Vehreschild5-698/+785
Add a rewriter to keep all expression tree that is not optimization together. At the moment this is just a move from resolve.cc, but will be extended to handle more cases where rewriting the expression tree may be easier. The first use case is to extract accessors for coarray remote image data access. gcc/fortran/ChangeLog: PR fortran/107635 * Make-lang.in: Add coarray.cc. * coarray.cc: New file. * gfortran.h (gfc_coarray_rewrite): New procedure. * parse.cc (rewrite_expr_tree): Add entrypoint for rewriting expression trees. * resolve.cc (gfc_resolve_ref): Remove caf_lhs handling. (get_arrayspec_from_expr): Moved to rewrite.cc. (remove_coarray_from_derived_type): Same. (convert_coarray_class_to_derived_type): Same. (split_expr_at_caf_ref): Same. (check_add_new_component): Same. (create_get_parameter_type): Same. (create_get_callback): Same. (add_caf_get_intrinsic): Same. (resolve_variable): Remove caf_lhs handling. libgfortran/ChangeLog: * caf/single.c (_gfortran_caf_finalize): Free memory preventing leaks. (_gfortran_caf_get_by_ct): Fix constness. * caf/libcaf.h (_gfortran_caf_register_accessor): Fix constness.
2025-02-20tree-optimization/86270 - improve SSA coalescing for loop exit testRichard Biener2-5/+59
The PR indicates a very specific issue with regard to SSA coalescing failures because there's a pre IV increment loop exit test. While IVOPTs created the desired IL we later simplify the exit test into the undesirable form again. The following fixes this up during RTL expansion where we try to improve coalescing of IVs. That seems easier that trying to avoid the simplification with some weird heuristics (it could also have been written this way). PR tree-optimization/86270 * tree-outof-ssa.cc (insert_backedge_copies): Pattern match a single conflict in a loop condition and adjust that avoiding the conflict if possible. * gcc.target/i386/pr86270.c: Adjust to check for no reg-reg copies as well.
2025-02-20x86: Add a test for PR target/118936H.J. Lu1-0/+22
Add a test for PR target/118936 which was fixed by reverting: 565d4e75549 i386: Simplify PARALLEL RTX scan in ix86_find_all_reg_use 11902be7a57 x86: Properly find the maximum stack slot alignment PR target/118936 * gcc.target/i386/pr118936.c: New test. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-20Revert "x86: Properly find the maximum stack slot alignment"H.J. Lu6-342/+21
This reverts commit 11902be7a57c0ccf03786aa0255fffaf0f54dbf9.
2025-02-20Revert "i386: Simplify PARALLEL RTX scan in ix86_find_all_reg_use"H.J. Lu1-3/+25
This reverts commit 565d4e755498ad2b5ed55e368ef61eb9511cda3a.
2025-02-20Daily bump.GCC Administrator4-1/+432
2025-02-19AVR: Add new ISR test gcc.target/avr/torture/isr-04-regs.c.Georg-Johann Lay2-2/+110
gcc/testsuite/ * gcc.target/avr/torture/isr-04-regs.c: New test. * gcc.target/avr/isr-test.h: Don't set GPRs to values that are 0 mod 0x11.
2025-02-19aarch64: Fix testcase pr112105.cAndrew Pinski1-1/+1
This testcase started to fail with r15-268-g9dbff9c05520a7. When late_combine was added, it was turned on for -O2+ only, so this testcase still failed. This changes the option to be -O2 instead of -O and the testcase started to pass again. tested for aarch64-linux-gnu. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr112105.c: Change to be -O2 rather than -O1. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2025-02-19input: give file_cache_slot its own copy of the file path [PR118919]David Malcolm1-5/+5
input.cc's file_cache was borrowing copies of the file name. This could lead to use-after-free when writing out sarif output from Fortran, which frees its filenames before the sarif output is fully written out. Fix by taking a copy in file_cache_slot. gcc/ChangeLog: PR other/118919 * input.cc (file_cache_slot::m_file_path): Make non-const. (file_cache_slot::evict): Free m_file_path. (file_cache_slot::create): Store a copy of file_path if non-null. (file_cache_slot::~file_cache_slot): Free m_file_path. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-02-19analyzer: handle more IFN_UBSAN_* as no-ops [PR118300]David Malcolm2-6/+31
Previously the analyzer treated IFN_UBSAN_BOUNDS as a no-op, but the other IFN_UBSAN_* were unrecognized and conservatively treated as having arbitrary behavior. Treat IFN_UBSAN_NULL and IFN_UBSAN_PTR also as no-ops, which should make -fanalyzer behave better with -fsanitize=undefined. gcc/analyzer/ChangeLog: PR analyzer/118300 * kf.cc (class kf_ubsan_bounds): Replace this with... (class kf_ubsan_noop): ...this. (register_sanitizer_builtins): Use it to handle IFN_UBSAN_NULL, IFN_UBSAN_BOUNDS, and IFN_UBSAN_PTR as nop-ops. (register_known_functions): Drop handling of IFN_UBSAN_BOUNDS here, as it's now handled by register_sanitizer_builtins above. gcc/testsuite/ChangeLog: PR analyzer/118300 * gcc.dg/analyzer/ubsan-pr118300.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-02-19Vect: Fix ICE when vect_verify_loop_lens acts on relevant mode [PR116351]Pan Li4-0/+31
This patch would like to fix the ICE similar as below, assump we have sample code: 1 │ int a, b, c; 2 │ short d, e, f; 3 │ long g (long h) { return h; } 4 │ 5 │ void i () { 6 │ for (; b; ++b) { 7 │ f = 5 >> a ? d : d << a; 8 │ e &= c | g(f); 9 │ } 10 │ } It will ice when compile with -O3 -march=rv64gc_zve64f -mrvv-vector-bits=zvl during GIMPLE pass: vect pr116351-1.c: In function ‘i’: pr116351-1.c:8:6: internal compiler error: in get_len_load_store_mode, at optabs-tree.cc:655 8 | void i () { | ^ 0x44d6b9d internal_error(char const*, ...) /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/diagnostic-global-context.cc:517 0x44a26a6 fancy_abort(char const*, int, char const*) /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/diagnostic.cc:1722 0x19e4309 get_len_load_store_mode(machine_mode, bool, internal_fn*, vec<int, va_heap, vl_ptr>*) /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/optabs-tree.cc:655 0x1fada40 vect_verify_loop_lens /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vect-loop.cc:1566 0x1fb2b07 vect_analyze_loop_2 /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vect-loop.cc:3037 0x1fb4302 vect_analyze_loop_1 /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vect-loop.cc:3478 0x1fb4e9a vect_analyze_loop(loop*, gimple*, vec_info_shared*) /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vect-loop.cc:3638 0x203c2dc try_vectorize_loop_1 /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vectorizer.cc:1095 0x203c839 try_vectorize_loop /home/pli/gcc/111/riscv-gnu-toolchain/gcc/__RISC-V_BUILD__/../gcc/tree-vectorizer.cc:1212 0x203cb2c execute During vectorization the override_widen pattern matched and then will get DImode as vector_mode in loop_info. After that the loop_vinfo will step in vect_analyze_xx with below flow: vect_analyze_loop_2 |- vect_pattern_recog // over-widening and set loop_vinfo->vector_mode to DImode |- ... |- vect_analyze_loop_operations |- stmt_info->def_type == vect_reduction_def |- stmt_info->slp_type == pure_slp |- vectorizable_lc_phi // Not Hit |- vectorizable_induction // Not Hit |- vectorizable_reduction // Not Hit |- vectorizable_recurr // Not Hit |- vectorizable_live_operation // Not Hit |- vect_analyze_stmt |- stmt_info->relevant == vect_unused_in_scope |- stmt_info->live == false |- p pattern_stmt_info == (stmt_vec_info) 0x0 |- return opt_result::success (); OR |- PURE_SLP_STMT (stmt_info) && !node then dump "handled only by SLP analysis\n" |- Early return opt_result::success (); |- vectorizable_load/store/call_convert/... // Not Hit |- LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P && !LOOP_VINFO_MASKS(loop_vinfo).is_empty () |- vect_verify_loop_lens (loop_vinfo) |- assert (VECTOR_MODE_P (loop_vinfo->vector_mode); // Hit assert result in ICE Finally, the DImode in loop_vinfo will hit the assert (VECTOR_MODE_P (mode)) in vect_verify_loop_lens. This patch would like to return false directly if the loop_vinfo has relevant mode like DImode for the ICE fix, but still may have mis-optimization for similar cases. We will try to cover that in separated patches. The below test suites are passed for this patch. * The rv64gcv fully regression test. * The x86 bootstrap test. * The x86 fully regression test. PR middle-end/116351 gcc/ChangeLog: * tree-vect-loop.cc (vect_verify_loop_lens): Return false if the loop_vinfo has relevant mode such as DImode. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr116351-1.c: New test. * gcc.target/riscv/rvv/base/pr116351-2.c: New test. * gcc.target/riscv/rvv/base/pr116351.h: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
2025-02-19LoongArch: Use normal RTL pattern instead of UNSPEC for {x,}vsr{a,l}ri ↵Xi Ruoyao4-44/+40
instructions Allowing (t + (1ul << imm >> 1)) >> imm to be recognized as a rounding shift operation. gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVSRARI): Remove. (UNSPEC_LASX_XVSRLRI): Remove. (lasx_xvsrari_<lsxfmt>): Remove. (lasx_xvsrlri_<lsxfmt>): Remove. * config/loongarch/lsx.md (UNSPEC_LSX_VSRARI): Remove. (UNSPEC_LSX_VSRLRI): Remove. (lsx_vsrari_<lsxfmt>): Remove. (lsx_vsrlri_<lsxfmt>): Remove. * config/loongarch/simd.md (simd_<optab>_imm_round_<mode>): New define_insn. (<simd_isa>_<x>v<insn>ri_<simdfmt>): New define_expand. gcc/testsuite/ChangeLog: * gcc.target/loongarch/vect-shift-imm-round.c: New test.
2025-02-19LoongArch: Implement [su]dot_prod* for LSX and LASX modesXi Ruoyao2-1/+31
Despite it's just a special case of "a widening product of which the result used for reduction," having these standard names allows to recognize the dot product pattern earlier and it may be beneficial to optimization. Also fix some test failures with the test cases: - gcc.dg/vect/vect-reduc-chain-2.c - gcc.dg/vect/vect-reduc-chain-3.c - gcc.dg/vect/vect-reduc-chain-dot-slp-3.c - gcc.dg/vect/vect-reduc-chain-dot-slp-4.c gcc/ChangeLog: * config/loongarch/simd.md (wvec_half): New define_mode_attr. (<su>dot_prod<wvec_half><mode>): New define_expand. gcc/testsuite/ChangeLog: * gcc.target/loongarch/wide-mul-reduc-2.c (dg-final): Scan DOT_PROD_EXPR in optimized tree.
2025-02-19LoongArch: Implement vec_widen_mult_{even,odd}_* for LSX and LASX modesXi Ruoyao3-0/+51
Since PR116142 has been fixed, now we can add the standard names so the compiler will generate better code if the result of a widening production is reduced. gcc/ChangeLog: * config/loongarch/simd.md (even_odd): New define_int_attr. (vec_widen_<su>mult_<even_odd>_<mode>): New define_expand. gcc/testsuite/ChangeLog: * gcc.target/loongarch/wide-mul-reduc-1.c: New test. * gcc.target/loongarch/wide-mul-reduc-2.c: New test.
2025-02-19LoongArch: Simplify lsx_vpick descriptionXi Ruoyao2-119/+47
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates instead of hard-coded const vectors. This is not suitable for LASX where lasx_xvpick has a different semantic. gcc/ChangeLog: * config/loongarch/simd.md (LVEC): New define_mode_attr. (simdfmt_as_i): Make it same as simdfmt for integer vector modes. (_f): New define_mode_attr. * config/loongarch/lsx.md (lsx_vpickev_b): Remove. (lsx_vpickev_h): Remove. (lsx_vpickev_w): Remove. (lsx_vpickev_w_f): Remove. (lsx_vpickod_b): Remove. (lsx_vpickod_h): Remove. (lsx_vpickod_w): Remove. (lsx_vpickev_w_f): Remove. (lsx_pick_evod_<mode>): New define_insn. (lsx_<x>vpick<ev_od>_<simdfmt_as_i><_f>): New define_expand.
2025-02-19LoongArch: Simplify {lsx_,lasx_x}vmaddw descriptionXi Ruoyao4-720/+118
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates and TImode RTL instead of hard-coded const vectors and UNSPECs. Also reorder two operands of the outer plus in the template, so combine will recognize {x,}vadd + {x,}vmulw{ev,od} => {x,}vmaddw{ev,od}. gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVMADDWEV): Remove. (UNSPEC_LASX_XVMADDWEV2): Remove. (UNSPEC_LASX_XVMADDWEV3): Remove. (UNSPEC_LASX_XVMADDWOD): Remove. (UNSPEC_LASX_XVMADDWOD2): Remove. (UNSPEC_LASX_XVMADDWOD3): Remove. (lasx_xvmaddwev_h_b<u>): Remove. (lasx_xvmaddwev_w_h<u>): Remove. (lasx_xvmaddwev_d_w<u>): Remove. (lasx_xvmaddwev_q_d): Remove. (lasx_xvmaddwod_h_b<u>): Remove. (lasx_xvmaddwod_w_h<u>): Remove. (lasx_xvmaddwod_d_w<u>): Remove. (lasx_xvmaddwod_q_d): Remove. (lasx_xvmaddwev_q_du): Remove. (lasx_xvmaddwod_q_du): Remove. (lasx_xvmaddwev_h_bu_b): Remove. (lasx_xvmaddwev_w_hu_h): Remove. (lasx_xvmaddwev_d_wu_w): Remove. (lasx_xvmaddwev_q_du_d): Remove. (lasx_xvmaddwod_h_bu_b): Remove. (lasx_xvmaddwod_w_hu_h): Remove. (lasx_xvmaddwod_d_wu_w): Remove. (lasx_xvmaddwod_q_du_d): Remove. * config/loongarch/lsx.md (UNSPEC_LSX_VMADDWEV): Remove. (UNSPEC_LSX_VMADDWEV2): Remove. (UNSPEC_LSX_VMADDWEV3): Remove. (UNSPEC_LSX_VMADDWOD): Remove. (UNSPEC_LSX_VMADDWOD2): Remove. (UNSPEC_LSX_VMADDWOD3): Remove. (lsx_vmaddwev_h_b<u>): Remove. (lsx_vmaddwev_w_h<u>): Remove. (lsx_vmaddwev_d_w<u>): Remove. (lsx_vmaddwev_q_d): Remove. (lsx_vmaddwod_h_b<u>): Remove. (lsx_vmaddwod_w_h<u>): Remove. (lsx_vmaddwod_d_w<u>): Remove. (lsx_vmaddwod_q_d): Remove. (lsx_vmaddwev_q_du): Remove. (lsx_vmaddwod_q_du): Remove. (lsx_vmaddwev_h_bu_b): Remove. (lsx_vmaddwev_w_hu_h): Remove. (lsx_vmaddwev_d_wu_w): Remove. (lsx_vmaddwev_q_du_d): Remove. (lsx_vmaddwod_h_bu_b): Remove. (lsx_vmaddwod_w_hu_h): Remove. (lsx_vmaddwod_d_wu_w): Remove. (lsx_vmaddwod_q_du_d): Remove. * config/loongarch/simd.md (simd_maddw_evod_<mode>_<su>): New define_insn. (<simd_isa>_<x>vmaddw<ev_od>_<simdfmt_w>_<simdfmt><u>): New define_expand. (simd_maddw_evod_<mode>_hetero): New define_insn. (<simd_isa>_<x>vmaddw<ev_od>_<simdfmt_w>_<simdfmt>u_<simdfmt>): New define_expand. (<simd_isa>_maddw<ev_od>_q_d<u>_punned): New define_expand. (<simd_isa>_maddw<ev_od>_q_du_d_punned): New define_expand. * config/loongarch/loongarch-builtins.cc (CODE_FOR_lsx_vmaddwev_q_d): Define as a macro to override it with the punned expand. (CODE_FOR_lsx_vmaddwev_q_du): Likewise. (CODE_FOR_lsx_vmaddwev_q_du_d): Likewise. (CODE_FOR_lsx_vmaddwod_q_d): Likewise. (CODE_FOR_lsx_vmaddwod_q_du): Likewise. (CODE_FOR_lsx_vmaddwod_q_du_d): Likewise. (CODE_FOR_lasx_xvmaddwev_q_d): Likewise. (CODE_FOR_lasx_xvmaddwev_q_du): Likewise. (CODE_FOR_lasx_xvmaddwev_q_du_d): Likewise. (CODE_FOR_lasx_xvmaddwod_q_d): Likewise. (CODE_FOR_lasx_xvmaddwod_q_du): Likewise. (CODE_FOR_lasx_xvmaddwod_q_du_d): Likewise.
2025-02-19LoongArch: Simplify {lsx_,lasx_x}vh{add,sub}w descriptionXi Ruoyao4-227/+69
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates and TImode RTL instead of hard-coded const vectors and UNSPECs. gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVHADDW_Q_D): Remove. (UNSPEC_LASX_XVHSUBW_Q_D): Remove. (UNSPEC_LASX_XVHADDW_QU_DU): Remove. (UNSPEC_LASX_XVHSUBW_QU_DU): Remove. (lasx_xvh<addsub:optab>w_h<u>_b<u>): Remove. (lasx_xvh<addsub:optab>w_w<u>_h<u>): Remove. (lasx_xvh<addsub:optab>w_d<u>_w<u>): Remove. (lasx_xvhaddw_q_d): Remove. (lasx_xvhsubw_q_d): Remove. (lasx_xvhaddw_qu_du): Remove. (lasx_xvhsubw_qu_du): Remove. (reduc_plus_scal_v4di): Call gen_lasx_haddw_q_d_punned instead of gen_lasx_xvhaddw_q_d. (reduc_plus_scal_v8si): Likewise. * config/loongarch/lsx.md (UNSPEC_LSX_VHADDW_Q_D): Remove. (UNSPEC_ASX_VHSUBW_Q_D): Remove. (UNSPEC_ASX_VHADDW_QU_DU): Remove. (UNSPEC_ASX_VHSUBW_QU_DU): Remove. (lsx_vh<addsub:optab>w_h<u>_b<u>): Remove. (lsx_vh<addsub:optab>w_w<u>_h<u>): Remove. (lsx_vh<addsub:optab>w_d<u>_w<u>): Remove. (lsx_vhaddw_q_d): Remove. (lsx_vhsubw_q_d): Remove. (lsx_vhaddw_qu_du): Remove. (lsx_vhsubw_qu_du): Remove. (reduc_plus_scal_v2di): Change the temporary register mode to V1TI, and pun the mode calling gen_vec_extractv2didi. (reduc_plus_scal_v4si): Change the temporary register mode to V1TI. * config/loongarch/simd.md (simd_h<optab>w_<mode>_<su>): New define_insn. (<simd_isa>_<x>vh<optab>w_<simdfmt_w><u>_<simdfmt><u>): New define_expand. (<simd_isa>_h<optab>w_q<u>_d<u>_punned): New define_expand. * config/loongarch/loongarch-builtins.cc (CODE_FOR_lsx_vhaddw_q_d): Define as a macro to override with punned expand. (CODE_FOR_lsx_vhaddw_qu_du): Likewise. (CODE_FOR_lsx_vhsubw_q_d): Likewise. (CODE_FOR_lsx_vhsubw_qu_du): Likewise. (CODE_FOR_lasx_xvhaddw_q_d): Likewise. (CODE_FOR_lasx_xvhaddw_qu_du): Likewise. (CODE_FOR_lasx_xvhsubw_q_d): Likewise. (CODE_FOR_lasx_xvhsubw_qu_du): Likewise.
2025-02-19LoongArch: Simplify {lsx_,lasx_x}v{add,sub,mul}l{ev,od} descriptionXi Ruoyao8-904/+206
These pattern definitions are tediously long, invoking 32 UNSPECs and many hard-coded long const vectors. To simplify them, at first we use the TImode vector operations instead of the UNSPECs, then we adopt an approach in AArch64: using a special predicate to match the const vectors for odd/even indices for define_insn's, and generate those vectors in define_expand's. For "backward compatibilty" we need to provide a "punned" version for the operations invoking TImode vectors as the intrinsics still expect DImode vectors. The stat is "201 insertions, 905 deletions." gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVADDWEV): Remove. (UNSPEC_LASX_XVADDWEV2): Remove. (UNSPEC_LASX_XVADDWEV3): Remove. (UNSPEC_LASX_XVSUBWEV): Remove. (UNSPEC_LASX_XVSUBWEV2): Remove. (UNSPEC_LASX_XVMULWEV): Remove. (UNSPEC_LASX_XVMULWEV2): Remove. (UNSPEC_LASX_XVMULWEV3): Remove. (UNSPEC_LASX_XVADDWOD): Remove. (UNSPEC_LASX_XVADDWOD2): Remove. (UNSPEC_LASX_XVADDWOD3): Remove. (UNSPEC_LASX_XVSUBWOD): Remove. (UNSPEC_LASX_XVSUBWOD2): Remove. (UNSPEC_LASX_XVMULWOD): Remove. (UNSPEC_LASX_XVMULWOD2): Remove. (UNSPEC_LASX_XVMULWOD3): Remove. (lasx_xv<addsubmul:optab>wev_h_b<u>): Remove. (lasx_xv<addsubmul:optab>wev_w_h<u>): Remove. (lasx_xv<addsubmul:optab>wev_d_w<u>): Remove. (lasx_xvaddwev_q_d): Remove. (lasx_xvsubwev_q_d): Remove. (lasx_xvmulwev_q_d): Remove. (lasx_xv<addsubmul:optab>wod_h_b<u>): Remove. (lasx_xv<addsubmul:optab>wod_w_h<u>): Remove. (lasx_xv<addsubmul:optab>wod_d_w<u>): Remove. (lasx_xvaddwod_q_d): Remove. (lasx_xvsubwod_q_d): Remove. (lasx_xvmulwod_q_d): Remove. (lasx_xvaddwev_q_du): Remove. (lasx_xvsubwev_q_du): Remove. (lasx_xvmulwev_q_du): Remove. (lasx_xvaddwod_q_du): Remove. (lasx_xvsubwod_q_du): Remove. (lasx_xvmulwod_q_du): Remove. (lasx_xv<addmul:optab>wev_h_bu_b): Remove. (lasx_xv<addmul:optab>wev_w_hu_h): Remove. (lasx_xv<addmul:optab>wev_d_wu_w): Remove. (lasx_xv<addmul:optab>wod_h_bu_b): Remove. (lasx_xv<addmul:optab>wod_w_hu_h): Remove. (lasx_xv<addmul:optab>wod_d_wu_w): Remove. (lasx_xvaddwev_q_du_d): Remove. (lasx_xvsubwev_q_du_d): Remove. (lasx_xvmulwev_q_du_d): Remove. (lasx_xvaddwod_q_du_d): Remove. (lasx_xvsubwod_q_du_d): Remove. * config/loongarch/lsx.md (UNSPEC_LSX_XVADDWEV): Remove. (UNSPEC_LSX_VADDWEV2): Remove. (UNSPEC_LSX_VADDWEV3): Remove. (UNSPEC_LSX_VSUBWEV): Remove. (UNSPEC_LSX_VSUBWEV2): Remove. (UNSPEC_LSX_VMULWEV): Remove. (UNSPEC_LSX_VMULWEV2): Remove. (UNSPEC_LSX_VMULWEV3): Remove. (UNSPEC_LSX_VADDWOD): Remove. (UNSPEC_LSX_VADDWOD2): Remove. (UNSPEC_LSX_VADDWOD3): Remove. (UNSPEC_LSX_VSUBWOD): Remove. (UNSPEC_LSX_VSUBWOD2): Remove. (UNSPEC_LSX_VMULWOD): Remove. (UNSPEC_LSX_VMULWOD2): Remove. (UNSPEC_LSX_VMULWOD3): Remove. (lsx_v<addsubmul:optab>wev_h_b<u>): Remove. (lsx_v<addsubmul:optab>wev_w_h<u>): Remove. (lsx_v<addsubmul:optab>wev_d_w<u>): Remove. (lsx_vaddwev_q_d): Remove. (lsx_vsubwev_q_d): Remove. (lsx_vmulwev_q_d): Remove. (lsx_v<addsubmul:optab>wod_h_b<u>): Remove. (lsx_v<addsubmul:optab>wod_w_h<u>): Remove. (lsx_v<addsubmul:optab>wod_d_w<u>): Remove. (lsx_vaddwod_q_d): Remove. (lsx_vsubwod_q_d): Remove. (lsx_vmulwod_q_d): Remove. (lsx_vaddwev_q_du): Remove. (lsx_vsubwev_q_du): Remove. (lsx_vmulwev_q_du): Remove. (lsx_vaddwod_q_du): Remove. (lsx_vsubwod_q_du): Remove. (lsx_vmulwod_q_du): Remove. (lsx_v<addmul:optab>wev_h_bu_b): Remove. (lsx_v<addmul:optab>wev_w_hu_h): Remove. (lsx_v<addmul:optab>wev_d_wu_w): Remove. (lsx_v<addmul:optab>wod_h_bu_b): Remove. (lsx_v<addmul:optab>wod_w_hu_h): Remove. (lsx_v<addmul:optab>wod_d_wu_w): Remove. (lsx_vaddwev_q_du_d): Remove. (lsx_vsubwev_q_du_d): Remove. (lsx_vmulwev_q_du_d): Remove. (lsx_vaddwod_q_du_d): Remove. (lsx_vsubwod_q_du_d): Remove. (lsx_vmulwod_q_du_d): Remove. * config/loongarch/loongarch-modes.def: Add V4TI and V1DI. * config/loongarch/loongarch-protos.h (loongarch_gen_stepped_int_parallel): New function prototype. * config/loongarch/loongarch.cc (loongarch_print_operand): Accept 'O' for printing "ev" or "od." (loongarch_gen_stepped_int_parallel): Implement. * config/loongarch/predicates.md (vect_par_cnst_even_or_odd_half): New define_predicate. * config/loongarch/simd.md (WVEC_HALF): New define_mode_attr. (simdfmt_w): Likewise. (zero_one): New define_int_iterator. (ev_od): New define_int_attr. (simd_<optab>w_evod_<mode:IVEC>_<su>): New define_insn. (<simd_isa>_<x>v<optab>w<ev_od>_<simdfmt_w>_<simdfmt><u>): New define_expand. (simd_<optab>w_evod_<mode>_hetero): New define_insn. (<simd_isa>_<x>v<optab>w<ev_od>_<simdfmt_w>_<simdfmt>u_<simdfmt>): New define_expand. (DIVEC): New define_mode_iterator. (<simd_isa>_<optab>w<ev_od>_q_d<u>_punned): New define_expand. (<simd_isa>_<optab>w<ev_od>_q_du_d_punned): Likewise. * config/loongarch/loongarch-builtins.cc (CODE_FOR_lsx_vaddwev_q_d): Define as a macro to override it with the punned expand. (CODE_FOR_lsx_vaddwev_q_du): Likewise. (CODE_FOR_lsx_vsubwev_q_d): Likewise. (CODE_FOR_lsx_vsubwev_q_du): Likewise. (CODE_FOR_lsx_vmulwev_q_d): Likewise. (CODE_FOR_lsx_vmulwev_q_du): Likewise. (CODE_FOR_lsx_vaddwod_q_d): Likewise. (CODE_FOR_lsx_vaddwod_q_du): Likewise. (CODE_FOR_lsx_vsubwod_q_d): Likewise. (CODE_FOR_lsx_vsubwod_q_du): Likewise. (CODE_FOR_lsx_vmulwod_q_d): Likewise. (CODE_FOR_lsx_vmulwod_q_du): Likewise. (CODE_FOR_lsx_vaddwev_q_du_d): Likewise. (CODE_FOR_lsx_vmulwev_q_du_d): Likewise. (CODE_FOR_lsx_vaddwod_q_du_d): Likewise. (CODE_FOR_lsx_vmulwod_q_du_d): Likewise. (CODE_FOR_lasx_xvaddwev_q_d): Likewise. (CODE_FOR_lasx_xvaddwev_q_du): Likewise. (CODE_FOR_lasx_xvsubwev_q_d): Likewise. (CODE_FOR_lasx_xvsubwev_q_du): Likewise. (CODE_FOR_lasx_xvmulwev_q_d): Likewise. (CODE_FOR_lasx_xvmulwev_q_du): Likewise. (CODE_FOR_lasx_xvaddwod_q_d): Likewise. (CODE_FOR_lasx_xvaddwod_q_du): Likewise. (CODE_FOR_lasx_xvsubwod_q_d): Likewise. (CODE_FOR_lasx_xvsubwod_q_du): Likewise. (CODE_FOR_lasx_xvmulwod_q_d): Likewise. (CODE_FOR_lasx_xvmulwod_q_du): Likewise. (CODE_FOR_lasx_xvaddwev_q_du_d): Likewise. (CODE_FOR_lasx_xvmulwev_q_du_d): Likewise. (CODE_FOR_lasx_xvaddwod_q_du_d): Likewise. (CODE_FOR_lasx_xvmulwod_q_du_d): Likewise.
2025-02-19LoongArch: Allow moving TImode vectorsXi Ruoyao5-78/+45
We have some vector instructions for operations on 128-bit integer, i.e. TImode, vectors. Previously they had been modeled with unspecs, but it's more natural to just model them with TImode vector RTL expressions. For the preparation, allow moving V1TImode and V2TImode vectors in LSX and LASX registers so we won't get a reload failure when we start to save TImode vectors in these registers. This implicitly depends on the vrepli optimization: without it we'd try "vrepli.q" which does not really exist and trigger an ICE. gcc/ChangeLog: * config/loongarch/lsx.md (mov<LSX:mode>): Remove. (movmisalign<LSX:mode>): Remove. (mov<LSX:mode>_lsx): Remove. * config/loongarch/lasx.md (mov<LASX:mode>): Remove. (movmisalign<LASX:mode>): Remove. (mov<LASX:mode>_lasx): Remove. * config/loongarch/loongarch-modes.def (V1TI): Add. (V2TI): Mention in the comment. * config/loongarch/loongarch.md (mode): Add V1TI and V2TI. * config/loongarch/simd.md (ALLVEC_TI): New mode iterator. (mov<ALLVEC_TI:mode): New define_expand. (movmisalign<ALLVEC_TI:mode>): Likewise. (mov<ALLVEC_TI:mode>_simd): New define_insn_and_split.