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.
/* PR middle-end/100425 - missing -Walloca-larger-than with -O0
{ dg-do compile }
- { dg-options "-O0 -Wall -Walloca-larger-than=128" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -Walloca-larger-than=128" } */
typedef __SIZE_TYPE__ size_t;
/* PR tree-optimization/99121 - ICE in -Warray-bounds on a multidimensional
VLA
{ dg-do compile }
- { dg-options "-O2 -Wall -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
#define NOIPA __attribute__ ((noipa))
/* PR tree-optimization/82588 - missing -Warray-bounds on an excessively
large index
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Warray-bounds -Wno-stringop-overread -ftrack-macro-expansion=0" } */
#include "../gcc.dg/range.h"
variable within the same function
Exercise basic cases of -Wdangling-pointer with optimization.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-uninitialized -Wno-return-local-addr -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-uninitialized -Wno-return-local-addr -ftrack-macro-expansion=0" } */
typedef __INTPTR_TYPE__ intptr_t;
typedef __SIZE_TYPE__ size_t;
variable within the same function
Exercise -Wdangling-pointer for VLAs.
{ dg-do compile }
- { dg-options "-O0 -Wall -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -ftrack-macro-expansion=0" } */
void sink (void*, ...);
Exercise -Wdangling-pointer for escaping stores of addreses of auto
variables.
{ dg-do compile }
- { dg-options "-O0 -Wall -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -ftrack-macro-expansion=0" } */
void* alloca (__SIZE_TYPE__);
variable within the same function
Exercise basic cases of -Wdangling-pointer without optimization.
{ dg-do compile }
- { dg-options "-O0 -Wall -Wno-uninitialized -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -Wno-uninitialized -ftrack-macro-expansion=0" } */
typedef __INTPTR_TYPE__ intptr_t;
typedef __SIZE_TYPE__ size_t;
/* PR c/7652 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Wimplicit-fallthrough" } */
extern void bar (int);
/* { dg-do compile } */
/* { dg-options "-Wall -Wno-array-bounds -Wno-sizeof-array-argument -Wno-stringop-overflow -Wno-stringop-overread" } */
/* { dg-options "-Wall -Wno-array-bounds -Wno-sizeof-array-argument -Wno-c++-compat -Wno-stringop-overflow -Wno-stringop-overread" { target c } } */
-/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
#ifdef __cplusplus
/* { dg-do compile } */
/* { dg-options "-Wall -O2 -Wno-array-bounds -Wno-sizeof-array-argument -Wno-stringop-truncation -ftrack-macro-expansion=0" } */
/* { dg-options "-Wall -O2 -Wno-array-bounds -Wno-sizeof-array-argument -Wno-stringop-truncation -Wno-c++-compat -ftrack-macro-expansion=0" {target c} } */
-/* { dg-require-effective-target alloca } */
#define bos(ptr) __builtin_object_size (ptr, 1)
#define bos0(ptr) __builtin_object_size (ptr, 0)
/* PR middle-end/81117 - Improve buffer overflow checking in strncpy
{ dg-do compile }
- { dg-options "-O2 -Wstringop-truncation -Wno-stringop-overflow -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wstringop-truncation -Wno-stringop-overflow -ftrack-macro-expansion=0" } */
typedef __SIZE_TYPE__ size_t;
/* PR c/43981 */
/* { dg-do compile } */
/* { dg-options "-Wunused" } */
-/* { dg-require-effective-target alloca } */
void g (char *);
/* Origin: PR c++/44108 */
/* { dg-options "-Wunused" } */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
int
foo ()
-/* { dg-require-effective-target alloca } */
-
void *test (void)
{
void *ptr = __builtin_alloca (64);
/* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret -fanalyzer-fine-grained" } */
-/* { dg-require-effective-target alloca } */
#include <stdint.h>
macro in a system header), and that the output looks correct. */
/* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret -fanalyzer-fine-grained" } */
-/* { dg-require-effective-target alloca } */
#include <stdint.h>
#include "../../gcc.dg/analyzer/test-alloca.h"
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { powerpc*-*-aix* } } */
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "requires hosted libstdc++ for stdlib size_t" { ! hostedlib } } */
#include <stdlib.h>
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
#include <stdlib.h>
-/* { dg-require-effective-target alloca } */
-
typedef __SIZE_TYPE__ size_t;
int test_alloca_1 (void)
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
#include <stdlib.h>
/* { dg-additional-options "-fanalyzer-transitivity" } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
#include <stddef.h>
/* { dg-additional-options "-Wno-unused-but-set-variable" } */
-/* { dg-require-effective-target alloca } */
#include <string.h>
#include <stdlib.h>
/* { dg-additional-options "-fdiagnostics-text-art-charset=unicode" } */
-/* { dg-require-effective-target alloca } */
#include <stdlib.h>
#include <stdint.h>
-/* { dg-require-effective-target alloca } */
-
int test_1 (void)
{
int *p = (int *) __builtin_alloca (sizeof (int)); /* { dg-message "region created on stack here" } */
notes) works. */
/* { dg-additional-options "-fanalyzer-show-duplicate-count" } */
-/* { dg-require-effective-target alloca } */
#include "../../gcc.dg/analyzer/analyzer-decls.h"
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "--param=asan-use-after-return=0" } */
/* This testcase checks that allocas and VLAs inside loop are correctly unpoisoned. */
/* Verify zero initialization for VLA automatic variables. */
/* { dg-do compile } */
/* { dg-options "-ftrivial-auto-var-init=zero -fdump-tree-gimple" } */
-/* { dg-require-effective-target alloca } */
extern void bar (int);
/* Verify zero initialization for VLA automatic variables. */
/* { dg-do compile } */
/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-tree-gimple" } */
-/* { dg-require-effective-target alloca } */
extern void bar (int);
/* Verify the auto initialization of nested VLA. */
/* { dg-do compile } */
/* { dg-options "-ftrivial-auto-var-init=zero -fdump-tree-gimple" } */
-/* { dg-require-effective-target alloca } */
void g(void *);
/* Verify the auto initialization of nested VLA. */
/* { dg-do compile } */
/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-tree-gimple" } */
-/* { dg-require-effective-target alloca } */
void g(void *);
{ dg-do compile }
{ dg-options "-O2 -Wall -Wextra" }
{ dg-additional-options "-std=gnu17 -fpermissive" { target c } }
- { dg-prune-output "warning" }
- { dg-require-effective-target alloca } */
+ { dg-prune-output "warning" } */
typedef __SIZE_TYPE__ size_t;
// PR debug/42800
// { dg-options "-gdwarf-2 -dA" }
// { dg-final { scan-assembler "DW_AT_upper_bound" } }
-// { dg-require-effective-target alloca }
int
f (int i)
/* PR middle-end/61486 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
#pragma omp declare target
void dosomething (int *a, int n, int m);
/* PR libstdc++/88101 */
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
struct S { char a; short b; char c; };
/* { dg-do run } */
/* { dg-options "-fstrub=strict" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target strub } */
/* Check that a non-strub function leaves a string behind in the stack, and that
/* { dg-do run } */
/* { dg-options "-fstrub=all" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target strub } */
/* Check that multi-level, multi-inlined functions still get cleaned up as
/* { dg-do run } */
/* { dg-options "-fstrub=at-calls" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target strub } */
#include "strub-run4.c"
/* { dg-do run } */
/* { dg-options "-fstrub=strict" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target strub } */
#define ATTR_STRUB_AT_CALLS __attribute__ ((__strub__ ("at-calls")))
/* { dg-do run } */
/* { dg-options "-fstrub=internal" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target strub } */
#include "strub-run4.c"
/* PR middle-end/79809 - ICE in alloca_call_type, at gimple-ssa-warn-alloca.c */
/* { dg-do compile } */
/* { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2" } */
-/* { dg-require-effective-target alloca } */
int a;
char *b = static_cast<char *>(__builtin_alloca (a));
// { dg-do compile }
// { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2 --param ggc-min-heapsize=0 --param ggc-min-expand=0 -w" }
-// { dg-require-effective-target alloca }
int a;
char *b = static_cast<char *>(__builtin_alloca (a));
// PR c++/70338
// { dg-do compile { target c++11 } }
// { dg-options "-g" }
-// { dg-require-effective-target alloca }
template<typename T>
void
// PR c++/59271
// { dg-do compile { target c++14 } }
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
extern "C" int printf (const char *, ...);
// PR c++/57402
// { dg-do run }
// { dg-options "" }
-// { dg-require-effective-target alloca }
int i = 2;
// N3639 allows initialization and capture of VLAs
// { dg-do run { target c++11 } }
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
void f(int n)
{
// PR c++/57404
// { dg-do compile { target c++11 } }
// { dg-options "-g" }
-// { dg-require-effective-target alloca }
void f (int i)
{
// PR c++/55149
// { dg-do compile { target c++11 } }
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
template<unsigned int TA>
struct SA
// { dg-do compile }
-// { dg-require-effective-target alloca }
int foo()
{
// { dg-do compile }
-// { dg-require-effective-target alloca }
void foo()
{
// PR debug/54828
// { dg-do compile }
// { dg-options "-g" }
-// { dg-require-effective-target alloca }
struct T { T (); virtual ~T (); };
struct S : public virtual T { S (); virtual ~S (); };
// { dg-options "-Wsequence-point -fdiagnostics-show-caret" }
-// { dg-require-effective-target alloca }
void *libiberty_concat_ptr;
extern unsigned long concat_length (const char *, ...);
// PR 17907
// { dg-do compile }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// We lost a CLEANUP_POINT_EXPR, leading to a crash destroying temp of A.
/* { dg-do run } */
/* { dg-options "-gdwarf-2" } */
/* { dg-skip-if "No Dwarf" { { hppa*-*-hpux* } && { ! hppa*64*-*-* } } } */
-/* { dg-require-effective-target alloca } */
/* This was a bug on x86-darwin, where the register numbering for SP
and BP was swapped (it's easy to do because on that port it's
// PR middle-end/69780 - [4.9/5/6 Regression] ICE on
// __builtin_alloca_with_align with small alignment
// { dg-do compile }
-// { dg-require-effective-target alloca }
#define CHAR_BIT __CHAR_BIT__
#define SIZE_MAX __SIZE_MAX__
// PR c++/34937, 34962
// { dg-require-weak "" }
// { dg-options "" }
-// { dg-require-effective-target alloca }
struct A
{
// PR c++/48446
// { dg-options "" }
-// { dg-require-effective-target alloca }
template<typename T>
struct A
// Test that auto works with VLAs.
// { dg-do compile { target c++11 } }
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
void bar(int n)
{
// VLA sizeof test
// { dg-do compile }
// { dg-options "" }
-// { dg-require-effective-target alloca }
int
f1 (int i)
// PR c++/44613
// { dg-do run }
// { dg-options "" }
-// { dg-require-effective-target alloca }
typedef int int32_t __attribute__((mode (__SI__)));
// PR c++/72766
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
long fn1() {
const int a = fn1();
// PR c++/69487
// { dg-do run }
// { dg-options -Wno-vla }
-// { dg-require-effective-target alloca }
int size = 6;
// PR c++/95552
// Test for VLA and cloned constructor.
// { dg-additional-options -Wno-vla }
-// { dg-require-effective-target alloca }
struct VB { };
struct ViewDom: virtual VB
// PR c++/28903
// { dg-options "" }
-// { dg-require-effective-target alloca }
template <class>
struct View
// PR c++/28879
// { dg-options "" }
-// { dg-require-effective-target alloca }
struct A
{
// PR c++/40013
// { dg-options "" }
-// { dg-require-effective-target alloca }
template <class T>
struct A
// PR c++/29175
// { dg-options "-Wno-vla" }
-// { dg-require-effective-target alloca }
void foo(int i)
{
// PR c++/70448
// { dg-do compile }
// { dg-options "-Wall" }
-// { dg-require-effective-target alloca }
typedef __typeof__ (sizeof 0) size_t;
void *operator new (size_t, void *p) { return p; }
// PR c++/55497
// { dg-options "-g" }
-// { dg-require-effective-target alloca }
int get();
// PR middle-end/78201
// { dg-do compile }
// { dg-options "-O2" }
-// { dg-require-effective-target alloca }
struct B { long d (); } *c;
long e;
// PR c++/28879
// { dg-do compile }
// { dg-options "" }
-// { dg-require-effective-target alloca }
struct A
{
// Test just twice, once with -O0 non-fortified, once with -O2 fortified.
// { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
-// { dg-require-effective-target alloca }
extern "C" {
// suppressing buffer overflow warnings.
// { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
-// { dg-require-effective-target alloca }
extern "C" {
// { dg-do compile }
-// { dg-require-effective-target alloca }
+
struct A
{
A(int);
// { dg-do compile }
// { dg-additional-options "-std=c++14" }
-// { dg-require-effective-target alloca }
namespace std {
typedef __SIZE_TYPE__ size_t;
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
/* { dg-options "-Wno-abi" {target arm_eabi} } */
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
// warn_placement_new_too_small
// { dg-do compile }
// { dg-additional-options "-Wplacement-new -Wno-pedantic" }
-// { dg-require-effective-target alloca }
#define SIZE_MAX __SIZE_MAX__
#define DIFF_MAX __PTRDIFF_MAX__
// Test -Wsizeof-pointer-memaccess warnings.
// { dg-do compile }
// { dg-options "-Wall -Wno-sizeof-array-argument" }
-// { dg-require-effective-target alloca }
typedef __SIZE_TYPE__ size_t;
extern "C" void *memset (void *, int, size_t);
/* { dg-do compile } */
/* { dg-options "-Wvla" } */
-/* { dg-require-effective-target alloca } */
void func (int i)
{
/* { dg-do compile } */
/* { dg-options "-pedantic-errors -Wno-vla" } */
-/* { dg-require-effective-target alloca } */
-/* { dg-require-effective-target alloca } */
void func (int i)
{
// { dg-do assemble }
// { dg-options "-w" }
-// { dg-require-effective-target alloca }
// This testcase used to cause a crash on the Alpha.
struct A {
// { dg-do run }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// Testcase for constructor expressions (GNU extension)
struct Any {
// { dg-do run }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// GROUPS passed builtins
// Apparently not in g++ bug snapshot (was originally sent to bug-gcc)
// Message-Id: <m0p74Fh-0002fCC@neal.ctd.comsat.com>
// { dg-do assemble }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
template<typename T>
// { dg-do run }
// { dg-options "-O" }
-// { dg-require-effective-target alloca }
+
typedef struct { } e;
char *p;
// { dg-do assemble }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// Origin: Alfred Minarik <a8601248@unet.univie.ac.at>
template<typename _CharT>
// { dg-do assemble }
// { dg-options "" }
-// { dg-require-effective-target alloca }
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
inline const unsigned& f(unsigned const& a) {
-/* { dg-require-effective-target alloca } */
const int a = 3;
const int b = 50;
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static void
foo ()
{
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
int x;
static int
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-std=gnu89" } */
void zzz (char *s1, char *s2, int len, int *q)
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
__inline int f(int i)
{
struct {
/* PR tree-optimization/33680 */
-/* { dg-require-effective-target alloca } */
int
f (int dim, int *b, int *c)
/* PR middle-end/34134 */
-/* { dg-require-effective-target alloca } */
extern void bar (void *, int);
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
/* { dg-additional-options "-std=gnu89" } */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void x(int a){struct{int p[a],i;}l;l.i;}
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void dynreplace_trampoline(void);
extern void dynreplace_trampoline_endlabel(void);
int dynreplace_add_trampoline(void)
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
/* { dg-additional-options "-std=gnu89" } */
#define alloca __builtin_alloca
/* ICE due to invalid GIMPLE created during strlen simplification. */
-/* { dg-require-effective-target alloca } */
extern unsigned long strlen (__const char *__s);
extern void bar ();
-/* { dg-require-effective-target alloca } */
typedef unsigned long grub_uint64_t;
typedef grub_uint64_t grub_size_t;
void grub_putchar (char);
/* { dg-options "-fexceptions" } */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* { dg-require-effective-target exceptions } */
void
-/* { dg-require-effective-target alloca } */
typedef const int cint;
typedef struct {
} Bounds;
/* PR target/51354 */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
-/* { dg-require-effective-target alloca } */
-
int __re_compile_fastmap(unsigned char *p)
{
unsigned char **stack;
/* PR middle-end/55851 */
-/* { dg-require-effective-target alloca } */
enum { A = 1UL, B = -1UL } var = A;
void foo (char *);
-// { dg-require-effective-target alloca }
/* PR c/77754 */
int fn3();
-// { dg-require-effective-target alloca }
// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
-// { dg-require-effective-target alloca }
// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
-// { dg-require-effective-target alloca }
// { dg-require-effective-target indirect_calls }
/* PR c/77754 */
-// { dg-require-effective-target alloca }
/* PR c/77754 */
int fn3();
-// { dg-require-effective-target alloca }
/* PR c/77754 */
int fn3();
-/* { dg-require-effective-target alloca } */
/* PR target/78439. */
enum demangle_component_type
-/* { dg-require-effective-target alloca } */
/* PR c/79413 */
void
/* PR middle-end/82564 */
-/* { dg-require-effective-target alloca } */
int
main ()
-// { dg-require-effective-target alloca }
enum a { b, c };
struct d {
_Bool e;
/* { dg-options "-ftree-slp-vectorize -ffp-contract=on -ffloat-store" } */
-/* { dg-require-effective-target alloca } */
_Complex foo_x_0;
int foo_n11, foo_i, foo_l;
/* Test TREE_CONSTANT VLA size: bug 27893. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-require-effective-target alloca } */
+
int a;
void g(void *);
void f(void) { int b[(__SIZE_TYPE__)&a]; g(b); }
/* Test TREE_CONSTANT VLA size: bug 27893. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
-/* { dg-require-effective-target alloca } */
+
void g(void *);
void f(void) { int b[1/0]; g(b); }
-/* { dg-require-effective-target alloca } */
void abort (void);
void exit (int);
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-fpermissive" } */
void f(void * a, double y)
{
/* PR c/3711
This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise,
because std_expand_builtin_va_arg didn't handle variable size types. */
-/* { dg-require-effective-target alloca } */
#include <stdarg.h>
-/* { dg-require-effective-target alloca } */
-
/* This program tests a data flow bug that would cause constant propagation
to propagate constants through function calls. */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-fpermissive" } */
#include <string.h>
#include <stdio.h>
-/* { dg-require-effective-target alloca } */
/* This used to fail on SPARC with an unaligned memory access. */
void foo(int n)
/* { dg-require-effective-target int32plus } */
-/* { dg-require-effective-target alloca } */
/* Ensure that we deallocate X when branching back before its
declaration. */
/* PR tree-optimization/33136 */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
/* PR c/33238 */
-/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
int memcmp (const void *, const void *, size_t);
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* { dg-additional-options "-std=gnu89" } */
f(){}
main(){int n=2;double x[n];f();exit(0);}
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */
void exit (int);
void
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* { dg-require-effective-target trampolines } */
/* { dg-additional-options "-std=gnu89" } */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* { dg-additional-options "-std=gnu89" } */
g (x, y)
{
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
-
void foo(int n)
{
typedef struct
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* Verify that alloca storage is sufficiently aligned. */
/* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess
can only happen on !STRICT_ALIGNMENT targets. */
/* { dg-require-effective-target indirect_jumps } */
-/* { dg-require-effective-target alloca } */
extern int strcmp(const char *, const char *);
extern char *strcpy(char *, const char *);
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-fpermissive" } */
int N = 1;
void foo() {} /* Necessary to trigger the original ICE. */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void abort (void);
void exit (int);
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* See 'gcc.target/nvptx/__builtin_alloca_0-1-O0.c'.
{ dg-xfail-if TODO { nvptx-*-* && { ! nvptx_softstack } } { "-O0" } { "" } } */
/* { dg-require-effective-target int32plus } */
-/* { dg-require-effective-target alloca } */
void *volatile p;
/* PR c/82210 */
-/* { dg-require-effective-target alloca } */
void
foo (int size)
-// { dg-require-effective-target alloca }
/* PR middle-end/86528 */
void __attribute__((noinline, noclone))
/* VLAs should be deallocated on a jump to before their definition,
including a jump to a label in an inner scope. PR 19771. */
-/* { dg-require-effective-target alloca } */
#if (__SIZEOF_INT__ <= 2)
#define LIMIT 10000
/* { dg-do run { target fpic } } */
/* { dg-options "-O2 -fpic" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);
ASM_SIMPLIFY_DWARF_ADDR hook. */
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fpic -g" } */
-/* { dg-require-effective-target alloca } */
static inline char *
bar (unsigned long x, char *y)
// { dg-options "" }
-/* { dg-require-effective-target alloca } */
extern int printf (const char *, ...);
/* { dg-do compile } */
/* { dg-options "-std=gnu17 -O2 -fno-crossjumping" } */
-/* { dg-require-effective-target alloca } */
int bar1 ();
int bar2 ();
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=2000 -O2 -ftrack-macro-expansion=0" } */
#define alloca __builtin_alloca
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=2000 -O2" } */
// Test when the conditionals are incorrectly reversed.
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca -O2" } */
// Make sure we don't warn on VLA with -Walloca.
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=128 -O2" } */
void f (void*);
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=100 -O2" } */
void f (void*);
/* PR tree-optimization/80109 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "small address space" { "pdp11-*-*" } } */
/* { dg-options "-O2 -Walloca-larger-than=126812070" { target ptr32plus } } */
/* { dg-options "-O2 -Walloca-larger-than=12070" { target { ! ptr32plus } } } */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=128 -O2" } */
typedef __SIZE_TYPE__ size_t;
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=2000 -O2" } */
void f (void *);
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=2000 -O2" } */
void f (void *);
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=5000 -O2" } */
char *
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=123 -O2" } */
/* { dg-xfail-if "Currently broken but Andrew's work should fix this" { *-*-* } } */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=256 -O2" } */
void f (void*);
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca -O0" } */
extern void f(void *);
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=2000 -O2" } */
void *p;
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca-larger-than=5000 -O2" } */
extern void useit(char *);
/* PR middle-end/82063 - issues with arguments enabled by -Wall
Verify that alloca() calls in loops are not diagnosed by default.
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -ftrack-macro-expansion=0" } */
extern void* alloca (__SIZE_TYPE__);
/* PR middle-end/94004 - missing -Walloca on calls to alloca due
to -Wno-system-headers
{ dg-do compile }
- { dg-options "-O2 -Wall -Walloca-larger-than=8 -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Walloca-larger-than=8 -ftrack-macro-expansion=0" } */
#include "Walloca-larger-than-3.h"
/* PR middle-end/100425 - missing -Walloca-larger-than with -O0
{ dg-do compile }
- { dg-options "-O0 -Wall -Walloca-larger-than=128" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -Walloca-larger-than=128" } */
typedef __SIZE_TYPE__ size_t;
/* PR middle-end/82063 - issues with arguments enabled by -Wall
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Walloca-larger-than=0 -Wvla-larger-than=0 -ftrack-macro-expansion=0" } */
extern void* alloca (__SIZE_TYPE__);
/* PR tree-optimization/82588 - missing -Warray-bounds on an excessively
large index
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Warray-bounds -ftrack-macro-expansion=0" } */
#define SIZE_MAX __SIZE_MAX__
/* PR tree-optimization/89662- -Warray-bounds ICE on void* arithmetic
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */
static void* vptr (void *c)
Test to verify that past-the-end accesses by string functions to member
arrays by-reference objects are diagnosed.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-unused-local-typedefs -Wno-stringop-overflow -ftrack-macro-expansion=0" } */
#define SA(expr) typedef int StaticAssert [2 * !!(expr) - 1]
/* PR middle-end/91647 - missing -Warray-bounds accessing a zero-length array
of a declared object
{ dg-do "compile" }
- { dg-options "-O2 -Wall -fno-tree-vectorize" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -fno-tree-vectorize" } */
typedef __INT16_TYPE__ int16_t;
typedef __INT32_TYPE__ int32_t;
/* PR middle-end/91647 - missing -Warray-bounds accessing a zero-length array
of a declared object
{ dg-do "compile" }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
/* pr102706: disabled warnings because the now-disabled conditions for the
bogus warnings to come up do not take cost analysis into account, and often
/* PR middle-end/92349 - ICE in -Warray-bounds on a VLA member
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
typedef __SIZE_TYPE__ size_t;
/* PR middle-end/94195 - missing warning reading a smaller object via
an lvalue of a larger type
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
typedef __INT16_TYPE__ int16_t;
typedef __SIZE_TYPE__ size_t;
/* PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-uninitialized -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-uninitialized -ftrack-macro-expansion=0" } */
#include "range.h"
/* Exercise basic C-only cases of -Wdangling-pointer.
{ dg-do compile }
- { dg-options "-O0 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall" } */
typedef __SIZE_TYPE__ size_t;
Verify that attempting to reallocate unallocated objects referenced
either directly or through pointers is diagnosed.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wfree-nonheap-object" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wfree-nonheap-object" } */
typedef __SIZE_TYPE__ size_t;
or through pointers is diagnosed. In most cases this doesn't require
optimization.
{ dg-do compile }
- { dg-options "-Wall -Wfree-nonheap-object" }
- { dg-require-effective-target alloca } */
+ { dg-options "-Wall -Wfree-nonheap-object" } */
typedef __INTPTR_TYPE__ intptr_t;
typedef __SIZE_TYPE__ size_t;
/* PR tree-optimization/85826 - ICE in gimple-ssa-warn-restruct on
a variable-length struct
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */
int f (int n)
/* Test to verify that VLAs are handled gracefully by -Wrestrict
{ dg-do compile }
- { dg-options "-O2 -Wrestrict" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wrestrict" } */
typedef __SIZE_TYPE__ size_t;
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#define ATTR(...) __attribute__ ((__VA_ARGS__))
/* PR c/71924 - missing -Wreturn-local-addr returning alloca result
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
typedef __SIZE_TYPE__ size_t;
/* Test -Wsizeof-pointer-memaccess warnings. */
/* { dg-do compile } */
/* { dg-options "-Wall -Wno-array-bounds -Wno-sizeof-array-argument -Wno-stringop-overflow -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void bzero (void *, size_t);
/* PR 90983/manual documents `-Wno-stack-usage` flag, but it is unrecognized
{ dg-do compile }
- { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" }
- { dg-require-effective-target alloca } */
+ { dg-options "-Wall -Wstack-usage=123 -Wno-stack-usage" } */
void f (void*);
/* PR 41673: bogus -Wstrict-aliasing warning from VLA dereference. */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O2 -Wall" } */
-/* { dg-require-effective-target alloca } */
int main(int argc, char *argv[])
{
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O3 -Wstrict-overflow=2 -Werror" } */
typedef __SIZE_TYPE__ size_t;
for either kind of VLAs (member and non-member).
Diagnosing the accesses is the subject of pr82608.
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-array-bounds" } */
void sink (void*);
warnings are issued for calls to user-defined functions with attribute
access and with non-constant out-of-bounds arguments.
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#include "range.h"
/* PR middle-end/91582 - missing heap overflow detection for strcpy
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-array-bounds -ftrack-macro-expansion=0" } */
#include "range.h"
PR middle-end/85484 - missing -Wstringop-overflow for strcpy with
a string of non-const length
{ dg-do compile }
- { dg-options "-O2 -Wall -Wno-array-bounds" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wno-array-bounds" } */
typedef __SIZE_TYPE__ size_t;
/* PR tree-optimization/84238 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target alloca } */
char a[1];
int b;
/* PR middle-end/95667 - unintended warning for memset writing across multiple
members
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
extern void sink (void*);
/* PR middle-end/92942 - missing -Wstringop-overflow for allocations with
a negative lower bound size
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#define SIZE_MAX __SIZE_MAX__
#define UINT8_MAX __UINT8_MAX__
/* Verify that an anti-range ~[A, B] with small positive A and B
is handled correctly and doesn't trigger warnings.
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
typedef __typeof__ (sizeof 0) size_t;
/* PR middle-end/100571 - bogus -Wstringop-overflow with VLA of elements
larger than byte
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
__attribute__ ((access (read_only, 1, 2))) void fro (int *, int);
__attribute__ ((access (write_only, 1, 2))) void fwo (int *, int);
a larger scalar into a smaller array
Verify warnings for overflow by stores of results of built-in functions.
{ dg-do compile }
- { dg-options "-O2" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2" } */
typedef __INT16_TYPE__ int16_t;
typedef __SIZE_TYPE__ size_t;
/* PR c/85931 - -Wsizeof-pointer-memaccess for strncpy with size of source
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall -Wstringop-truncation -ftrack-macro-expansion=0" } */
typedef __SIZE_TYPE__ size_t;
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Wvla-larger-than=100 -O2" } */
typedef __SIZE_TYPE__ size_t;
/* { dg-do compile } */
/* { dg-require-effective-target stdint_types } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O2 -Wvla-larger-than=40" } */
#include <stdint.h>
/* Verify that VLA definitions with an unknown upper bound don't trigger
-Wvla-larger-than= warnings by default.
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */
void f (void *, ...);
/* PR middle-end/94004 - missing -Walloca on calls to alloca due
to -Wno-system-headers
{ dg-do compile }
- { dg-options "-O2 -Wall -Wvla-larger-than=31 -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -Wvla-larger-than=31 -ftrack-macro-expansion=0" } */
void sink (void*, ...);
static inline void use_inlined_vla (unsigned n)
{
inline_use_vla (n); // this call is okay
- inline_use_vla (n + 1); // this one is not (line 20)
+ inline_use_vla (n + 1); // this one is not (line 19)
}
void call_inline (void)
{
- use_inlined_vla (31); // line 25
+ use_inlined_vla (31); // line 24
}
/* Verify that the inlining context is included and that it points
to the correct line number in the inlined function:
- { dg-message "function 'inline_use_vla'.*inlined from 'use_inlined_vla'.*:20:.*inlined from 'call_inline' .*:25:" "" { target *-*-* } 0 } */
+ { dg-message "function 'inline_use_vla'.*inlined from 'use_inlined_vla'.*:19:.*inlined from 'call_inline' .*:24:" "" { target *-*-* } 0 } */
/* PR middle-end/100510 - bogus -Wvla-large-than with -Walloca
{ dg-do compile }
- { dg-options "-O0 -Walloca -Wvla-larger-than=1000" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Walloca -Wvla-larger-than=1000" } */
void f (void*);
/* Adapted from malloc-1.c, but wrapping the pointers in a struct. */
-/* { dg-require-effective-target alloca } */
-
#include <stdlib.h>
extern int foo (void);
/* { dg-additional-options "-fanalyzer-call-summaries --param analyzer-min-snodes-for-call-summary=0" } */
-/* { dg-require-effective-target alloca } */
/* There need to be at least two calls to a function for the
call-summarization code to be used.
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-fno-ipa-modref" } */
#include <stdlib.h>
__analyzer_eval (q->x == 107024); /* { dg-warning "TRUE" } */
__analyzer_eval (q->y == 107025); /* { dg-warning "TRUE" } */
- __analyzer_eval (p[10].x == 0); /* { dg-warning "use of uninitialized value '\\*p\\\[10\\\].x'" } */
+ __analyzer_eval (p[10].x == 0); /* { dg-warning "use of uninitialized value '\\*p\\\[10\\\].x'" "" { xfail { ! alloca } } } */
}
void test_30 (void *ptr)
-/* { dg-require-effective-target alloca } */
-
#include <stdlib.h>
extern int foo (void);
-/* { dg-require-effective-target alloca } */
-
#include <stdlib.h>
#include "analyzer-decls.h"
/* { dg-additional-options "-fdiagnostics-text-art-charset=unicode" } */
-/* { dg-require-effective-target alloca } */
#include <string.h>
#include <stdlib.h>
/* { dg-do "compile" } */
/* { dg-additional-options "-Wno-old-style-definition -Wno-analyzer-too-complex" } */
/* TODO: remove the need for this option. */
-/* { dg-require-effective-target alloca } */
/* Handle aliases for locale names.
Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "has no putenv" { "avr-*-*" } } */
#include <stdio.h>
-/* { dg-require-effective-target alloca } */
-
#include "analyzer-decls.h"
#include <stdio.h>
#include <stdlib.h>
-/* { dg-do compile }
- { dg-require-effective-target alloca } */
+/* { dg-do compile } */
+
#include "../../Warray-bounds-41.c"
/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
/* { dg-additional-options "-fsanitize=bounds" } */
-/* { dg-require-effective-target alloca } */
#include <stdlib.h>
#include "../analyzer-decls.h"
-/* { dg-require-effective-target alloca } */
#include "analyzer-decls.h"
void test_1 (int n)
with side effects. */
/* { dg-do run } */
/* { dg-options "-std=c11 -pedantic-errors" } */
-/* { dg-require-effective-target alloca } */
#include <stdatomic.h>
to allocate objects in excess of the number of bytes specified by
-Walloc-larger-than=maximum. */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O0 -Wall -Walloc-size-larger-than=12345 -Wno-use-after-free" } */
#define MAXOBJSZ 12345
detect and diagnose calls that attemnpt to allocate objects in excess
of the maximum specified by -Walloc-size-larger-than=maximum. */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O1 -Wall -Walloc-size-larger-than=12345 -Wno-use-after-free" } */
#define SIZE_MAX __SIZE_MAX__
-Wvla-larger-than, and -Walloc-size-larger-than options. The former
two more specific options override the more general latter option. */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O -Walloc-size-larger-than=123 -Walloca-larger-than=234 -Wvla-larger-than=345" } */
typedef __SIZE_TYPE__ size_t;
with attribute malloc. This means that the pointer they return
can be assumed not to alias any other valid pointer. */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
void sink (void*);
/* Test the noipa attribute. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-require-effective-target alloca } */
static inline int __attribute__((noipa))
fn1 (void) /* { dg-warning "inline function \[^\n\]* given attribute 'noinline'" "" } */
Verify that passing pointers to uninitialized objects to const
arguments to built-ins is diagnosed where expected.
{ dg-do compile }
- { dg-options "-O -Wall -ftrivial-auto-var-init=zero" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O -Wall -ftrivial-auto-var-init=zero" } */
typedef __SIZE_TYPE__ size_t;
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized -ftrivial-auto-var-init=zero" } */
-/* { dg-require-effective-target alloca } */
#include "uninit-9.c"
/* Test __auto_type. Test correct uses. */
/* { dg-do run } */
/* { dg-options "" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);
attribute alloc_size that __builtin_object_size can make use of (or
are treated as if they were for that purpose)..
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-additional-options "-O2 -fdump-tree-optimized" } */
void sink (void*);
/* { dg-do compile }
- { dg-require-effective-target alloca }
{ dg-additional-options "-O2 -fdump-tree-optimized" } */
#define __builtin_object_size __builtin_dynamic_object_size
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#define __builtin_object_size __builtin_dynamic_object_size
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#define __builtin_object_size __builtin_dynamic_object_size
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#define __builtin_object_size __builtin_dynamic_object_size
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#define __builtin_object_size __builtin_dynamic_object_size
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#include "builtin-object-size-common.h"
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#include "builtin-object-size-common.h"
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#include "builtin-object-size-common.h"
/* { dg-do run } */
/* { dg-options "-O2 -Wno-stringop-overread" } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-DSKIP_STRNDUP" { target { ! strndup } } } */
#include "builtin-object-size-common.h"
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
int main ()
{
/* PR middle-end/69780 - [4.9/5/6 Regression] ICE on
__builtin_alloca_with_align with small alignment */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Wno-long-long" } */
#define CHAR_BIT __CHAR_BIT__
/* Test C23 auto. Valid code, execution tests. Based on auto-type-1.c. */
/* { dg-do run } */
/* { dg-options "-std=c23 -pedantic-errors" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors -frounding-math" } */
-/* { dg-require-effective-target alloca } */
void
f (void)
/* Origin: PR 3467 */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
-/* { dg-require-effective-target alloca } */
void
tdef (int n)
-/* { dg-require-effective-target alloca } */
+/* { dg-require-effective-target alloca }
+ See 'struct-by-value-22_y.c'. */
/* { dg-skip-if "limited code space" { pdp11-*-* } } */
/* Test variable sized function argument passing.
/* { dg-do compile } */
/* { dg-options "-fdump-tree-cfg" } */
-/* { dg-require-effective-target alloca } */
void *alloca (__SIZE_TYPE__);
void link_error ();
/* PR middle-end/30494 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
int
foo (int n)
// { dg-do compile }
-/* { dg-require-effective-target alloca } */
void foo(int n, int i)
{
// { dg-do compile }
-/* { dg-require-effective-target alloca } */
void foo(int n, int i)
{
// { dg-do compile }
-/* { dg-require-effective-target alloca } */
void foo(int n, int i)
{
// { dg-do compile }
-/* { dg-require-effective-target alloca } */
void foo(int n, int i)
{
/* PR target/99085 */
/* { dg-do compile } */
/* { dg-options "-O2 -fgraphite-identity -fsel-sched-pipelining -fselective-scheduling2" } */
-/* { dg-require-effective-target alloca } */
void
foo (int m, int n, int o, int i)
/* { dg-do run { xfail { ! aarch64*-*-* } } } */
/* { dg-options "-g" } */
-/* { dg-require-effective-target alloca } */
#include "guality.h"
/* PR c/80778 */
/* { dg-lto-do link } */
-/* { dg-require-effective-target alloca } */
#include "../auto-type-1.c"
/* PR c/70093 */
/* { dg-do compile } */
/* { dg-options "" } */
-/* { dg-require-effective-target alloca } */
void __attribute__((noinline, noclone))
foo (int n)
/* PR target/88620 */
/* { dg-do run } */
/* { dg-options "-Ofast --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -fno-inline-small-functions" } */
-/* { dg-require-effective-target alloca } */
void
foo (int n)
/* Test nested-func-12.c with -std=gnu17. */
/* { dg-do run } */
/* { dg-options "-Ofast --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -fno-inline-small-functions -std=gnu17" } */
-/* { dg-require-effective-target alloca } */
#include "nested-func-12.c"
/* Test nested-func-12.c with -std=gnu23. */
/* { dg-do run } */
/* { dg-options "-Ofast --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -fno-inline-small-functions -std=gnu23" } */
-/* { dg-require-effective-target alloca } */
#include "nested-func-12.c"
to non-inlined nested function returning variable-size struct. */
/* { dg-do run } */
/* { dg-options "-O3 --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -fno-inline-small-functions -std=gnu23" } */
-/* { dg-require-effective-target alloca } */
void
foo (int n)
to non-inlined nested function returning variable-size struct. */
/* { dg-do run } */
/* { dg-options "-O3 -fno-guess-branch-probability -std=gnu23" } */
-/* { dg-require-effective-target alloca } */
void
foo (int n)
to non-inlined nested function returning variable-size struct. */
/* { dg-do run } */
/* { dg-options "-O3 --param ipa-cp-eval-threshold=0 -fno-guess-branch-probability -std=gnu23" } */
-/* { dg-require-effective-target alloca } */
#include "nested-func-16.c"
/* PR c/70093 */
/* { dg-do run } */
/* { dg-options "" } */
-/* { dg-require-effective-target alloca } */
void
foo (int n)
/* PR middle-end/27945 */
/* { dg-do run } */
/* { dg-options "" } */
-/* { dg-require-effective-target alloca } */
extern int printf (const char *, ...);
extern void abort ();
/* PR rtl-optimization/100225 */
/* { dg-do compile } */
/* { dg-options "-O1 -fmodulo-sched" } */
-/* { dg-require-effective-target alloca } */
void
vorbis_synthesis_lapout (void);
/* PR c/25682 */
/* { dg-do compile } */
/* { dg-options "-ansi" } */
-/* { dg-require-effective-target alloca } */
/* Test whether we don't ICE on questionable constructs where offsetof
should have been used instead. */
/* PR c/27301 */
/* { dg-do compile } */
/* { dg-options "-O2 -std=gnu89" } */
-/* { dg-require-effective-target alloca } */
void
foo (void *ptr, long n)
/* PR target/31507 */
/* { dg-do run } */
/* { dg-options "-Os -fno-omit-frame-pointer" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
/* PR c/33238 */
/* { dg-do compile } */
/* { dg-options "-std=gnu89" } */
-/* { dg-require-effective-target alloca } */
void
reverse (void *x, int y, int z)
/* { dg-do compile } */
/* { dg-options "-fexceptions" } */
-/* { dg-require-effective-target alloca } */
/* { dg-require-effective-target exceptions } */
void cf (void *);
/* PR c/49120 */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
-/* { dg-require-effective-target alloca } */
int
main ()
/* { dg-do compile } */
/* { dg-options "-O2 -fsched2-use-superblocks -ftree-tail-merge" } */
-/* { dg-require-effective-target alloca } */
typedef int aligned __attribute__ ((aligned (64)));
extern void abort (void);
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-ccp1" } */
-/* { dg-require-effective-target alloca } */
int g (int *);
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target alloca } */
int y;
extern int foo (int, ...) __attribute__((pure));
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target alloca } */
int
zzz (char *s1, char *s2, int len, int *q)
/* PR middle-end/59011 */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
-/* { dg-require-effective-target alloca } */
void
foo (int m)
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target alloca } */
int *
foo (int a, int *b, int *c, int *d)
/* PR c/61561. */
/* { dg-do assemble } */
/* { dg-options " -w -O2" } */
-/* { dg-require-effective-target alloca } */
int dummy (int a);
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O2 -fno-inline" } */
/* Test that targets correctly round the size of the outgoing arguments
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
void *ptr;
/* PR tree-optimization/79972 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Walloca -Wvla-larger-than=10000" } */
int
/* PR middle-end/82875 */
/* { dg-do compile } */
/* { dg-options "-ftree-ter" } */
-/* { dg-require-effective-target alloca } */
const int a = 100;
/* PR c/83844 */
/* { dg-do compile { target int32plus } } */
/* { dg-options "-O0 -Wall" } */
-/* { dg-require-effective-target alloca } */
typedef unsigned long long __u64 __attribute__((aligned(4),warn_if_not_aligned(8)));
void bar (void *, void *, void *);
/* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp
-fno-tree-forwprop
{ dg-do compile }
- { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" } */
void rv1 (int n)
{
/* PR middle-end/87099 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-Wstringop-overflow" } */
void bar (char *);
/* PR tree-optimization/87320 */
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O3" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* PR c/89045 */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "" } */
int
/* { dg-do compile } */
/* { dg-options "-O" } */
-/* { dg-require-effective-target alloca } */
void foo(void)
{
/* PR tree-optimization/93986 - ICE in decompose, at wide-int.h:984
{ dg-do compile }
- { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O1 -foptimize-strlen -ftree-slp-vectorize" } */
int dd (void);
/* PR tree-optimization/98721 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target alloca } */
int
foo (int n)
/* { dg-do compile } */
/* { dg-options "-std=gnu17 -O2 -g -w" } */
-/* { dg-require-effective-target alloca } */
static int foo ();
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
-/* { dg-require-effective-target alloca } */
int *p;
/* Testcase by George Thopas <george.thopas@gmail.com> */
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
#include <stddef.h>
#include <stdlib.h>
/* PR tree-optimization/90662 - strlen of a string in a vla plus offset
not folded
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall -fdump-tree-gimple -fdump-tree-optimized" } */
#include "strlenopt.h"
/* PR tree-optimization/83821 - local aggregate initialization defeats
strlen optimization
{ dg-do compile }
- { dg-options "-O2 -Wall -fdump-tree-optimized" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -fdump-tree-optimized" } */
#include "strlenopt.h"
char *p_p2, *p_p5, *p_p9, *p_p14;
Verify that stores that overwrite an interior nul are correctly
reflected in strlen results.
{ dg-do run }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
#define false (0 == 1)
#define true (0 == 0)
/* PR tree-optimization/92412 - excessive errno aliasing assumption defeats
optimization
{ dg-do compile }
- { dg-options "-O2 -Wall -fdump-tree-optimized" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -fdump-tree-optimized" } */
typedef __SIZE_TYPE__ size_t;
/* Test just twice, once with -O0 non-fortified, once with -O2 fortified. */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } } */
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
-/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void *memset (void *, int, size_t);
/* { dg-do run } */
/* { dg-options "-fno-omit-frame-pointer" } */
-/* { dg-require-effective-target alloca } */
#define alloca __builtin_alloca
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-fno-tree-dce" } */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static inline int foo (int n, int k)
{
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-additional-options "-g" } */
int a, b, c, d, *e, f, g;
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
typedef struct { int _mp_size; } mpz_t[1];
int a, b;
/* { dg-do compile } */
/* { dg-require-effective-target int128 } */
-/* { dg-require-effective-target alloca } */
void foo();
/* { dg-do run } */
-/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void abort (void);
int
/* { dg-do run } */
-/* { dg-require-effective-target alloca } */
int __attribute__((noipa))
g (char *p)
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
void foo(int n)
{
/* { dg-additional-options "-std=gnu17 -fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
-/* { dg-require-effective-target alloca } */
int x;
/* { dg-do compile } */
/* { dg-require-stack-check "specific" } */
/* { dg-additional-options "-fpermissive -fstack-check -w" } */
-/* { dg-require-effective-target alloca } */
int a;
struct b {
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
-/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
/* { dg-do compile } */
/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom2" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void bitmap_clear (int *);
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-einline" } */
-/* { dg-require-effective-target alloca } */
void bar (char *);
int i;
/* { dg-do compile } */
-/* { dg-require-effective-target alloca } */
/* { dg-options "-O2 -fdump-tree-dse1-details" } */
int i;
/* PR tree-optimization/91567 - Spurious -Wformat-overflow warnings building
glibc (32-bit only)
{ dg-do compile }
- { dg-options "-O2 -Wall -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
typedef __SIZE_TYPE__ size_t;
/* PR middle-end/97373 - missing warning on sprintf into allocated destination
{ dg-do compile }
- { dg-options "-O2 -Wall -ftrack-macro-expansion=0" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
#include "../range.h"
-O2 (-ftree-vrp) is necessary for the tests involving ranges to pass,
otherwise -O1 is sufficient.
{ dg-do compile }
- { dg-require-effective-target alloca }
{ dg-options "-O2 -Wformat -Wformat-overflow=1 -ftrack-macro-expansion=0" } */
typedef __SIZE_TYPE__ size_t;
/* PR tree-optimization/83337 */
/* { dg-do run { target int32plus } } */
/* { dg-options "-O2 -floop-interchange" } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "too big stack" { visium-*-* } } */
/* Copied from graphite/interchange-5.c */
/* PR middle-end/23848 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-require-effective-target alloca } */
void bar1 (char *, int);
void foo1 (int size)
/* PR middle-end/23848 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-require-effective-target alloca } */
void bar (char *, char *, char *, char *, int);
void foo (int size)
/* PR middle-end/23848 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-require-effective-target alloca } */
void bar (int, char *, char *, char *, char *, int);
void foo (int size)
/* PR middle-end/23848 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-require-effective-target alloca } */
void bar (char *, char *, char *, char *, int);
void foo (int size)
/* PR middle-end/10138 - warn for uninitialized arrays passed as const*
arguments
{ dg-do compile }
- { dg-options "-std=gnu17 -O -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-std=gnu17 -O -Wall" } */
typedef __SIZE_TYPE__ size_t;
Verify that passing pointers to uninitialized objects to const
arguments to built-ins is diagnosed where expected.
{ dg-do compile }
- { dg-options "-O -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O -Wall" } */
typedef __SIZE_TYPE__ size_t;
be adjusted. Ditto if -Wuninitialized output changes for some
other reason.
{ dg-do compile { target { { lp64 || ilp32 } || llp64 } } }
- { dg-options "-O2 -Wall -ftrack-macro-expansion=0 -fno-ipa-modref" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -ftrack-macro-expansion=0 -fno-ipa-modref" } */
#define CONCAT(x, y) x ## y
#define CAT(x, y) CONCAT(x, y)
} \
typedef void dummy_type
-T (int, 0, 0); // { dg-warning "'\\*\\(int \\*\\)a' is used uninitialized" }
-T (int, 0, 1); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)'" }
-T (int, 0, 2); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)'" }
-T (int, 0, 3); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)'" }
-T (int, 0, 4); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[1]'" }
-T (int, 0, 5); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[1]'" }
-T (int, 0, 6); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[1]'" }
-T (int, 0, 7); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[1]'" }
-T (int, 0, 8); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[2]'" }
-T (int, 0, 9); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[2]'" }
-
-
-T (int, 1, 0); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[1]' is used uninitialized" }
-T (int, 1, 1); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[1]'" }
-T (int, 1, 2); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[1]'" }
-T (int, 1, 3); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[1]'" }
-T (int, 1, 4); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[2]'" }
-T (int, 1, 5); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[2]'" }
-T (int, 1, 6); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[2]'" }
-T (int, 1, 7); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[2]'" }
-T (int, 1, 8); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[3]'" }
-T (int, 1, 9); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[3]'" }
+T (int, 0, 0); // { dg-warning "'\\*\\(int \\*\\)a' is used uninitialized" "" { xfail { ! alloca } } }
+T (int, 0, 1); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)'" "" { xfail { ! alloca } } }
+T (int, 0, 2); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)'" "" { xfail { ! alloca } } }
+T (int, 0, 3); // { dg-warning "'\\*\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)'" "" { xfail { ! alloca } } }
+T (int, 0, 4); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 0, 5); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 0, 6); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 0, 7); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 0, 8); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[2]'" "" { xfail { ! alloca } } }
+T (int, 0, 9); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[2]'" "" { xfail { ! alloca } } }
+
+
+T (int, 1, 0); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[1]' is used uninitialized" "" { xfail { ! alloca } } }
+T (int, 1, 1); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 1, 2); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 1, 3); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[1]'" "" { xfail { ! alloca } } }
+T (int, 1, 4); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[2]'" "" { xfail { ! alloca } } }
+T (int, 1, 5); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[2]'" "" { xfail { ! alloca } } }
+T (int, 1, 6); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 2\\)\\)\\\[2]'" "" { xfail { ! alloca } } }
+T (int, 1, 7); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 3\\)\\)\\\[2]'" "" { xfail { ! alloca } } }
+T (int, 1, 8); // { dg-warning "'\\(\\(int \\*\\)a\\)\\\[3]'" "" { xfail { ! alloca } } }
+T (int, 1, 9); // { dg-warning "'\\(\\(int \\*\\)\\(\\(char \\*\\)a \\+ 1\\)\\)\\\[3]'" "" { xfail { ! alloca } } }
/* PR c/98592 - ICE in gimple_canonical_types_compatible_p while formatting
a MEM_REF
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
void f (int);
/* Verify that calls to non-modifying built-ins aren't considered
potentially modifying.
{ dg-do compile }
- { dg-options "-std=gnu17 -O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-std=gnu17 -O2 -Wall" } */
typedef __SIZE_TYPE__ size_t;
/* { dg-do compile } */
/* { dg-options "-Wuninitialized" } */
-/* { dg-require-effective-target alloca } */
struct foo
{
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
-/* { dg-require-effective-target alloca } */
struct foo
{
/* PR middle-end/100250 - ICE related to -Wmaybe-uninitialized
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
extern void f (int D, const int[D], const int[D]);
/* PR middle-end/101300 - -fsanitize=undefined suppresses -Wuninitialized
for a VLA read at -O0
{ dg-do compile }
- { dg-options "-O0 -Wall -fsanitize=undefined" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O0 -Wall -fsanitize=undefined" } */
int warn_vla_rd0 (int n)
{
/* PR middle-end/101494 - bogus -Wmaybe-uninitialized on memrchr of size 0
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
typedef __SIZE_TYPE__ size_t;
/* PR middle-end/98578 - ICE warning on uninitialized VLA access
{ dg-do compile }
- { dg-options "-O2 -Wall -fno-ipa-modref" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall -fno-ipa-modref" } */
void* malloc (__SIZE_TYPE__);
as *a1), but definitely not as *a1[I]. This is a bug in VLA
formatting. */
T (a1[0]); // { dg-warning "'a1\\\[0]' is used uninitialized" "pr98587" { xfail *-*-* } }
- // { dg-warning "'\\*a1\\\[0]' is used uninitialized" "spurious star" { target *-*-* } .-1 }
- T (a1[1]); // { dg-warning "a1\\\[1]' is used uninitialized" }
- T (a1[i]); // { dg-warning "a1\\\[i]' is used uninitialized" }
+ // { dg-warning "'\\*a1\\\[0]' is used uninitialized" "spurious star" { target *-*-* xfail { ! alloca } } .-1 }
+ T (a1[1]); // { dg-warning "a1\\\[1]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a1[i]); // { dg-warning "a1\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
}
void vla_n_2 (int n, int i)
{
int a2[n][2];
- T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" }
- T (a2[2][1]); // { dg-warning "a2\\\[2]\\\[1]' is used uninitialized" }
- T (a2[3][i]); // { dg-warning "a2\\\[3]\\\[i]' is used uninitialized" }
- T (a2[i][0]); // { dg-warning "a2\\\[i]\\\[0]' is used uninitialized" }
- T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" }
+ T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[2][1]); // { dg-warning "a2\\\[2]\\\[1]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[3][i]); // { dg-warning "a2\\\[3]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][0]); // { dg-warning "a2\\\[i]\\\[0]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
}
{
int a2[3][n];
- T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" }
- T (a2[1][2]); // { dg-warning "a2\\\[1]\\\[2]' is used uninitialized" }
- T (a2[2][i]); // { dg-warning "a2\\\[2]\\\[i]' is used uninitialized" }
- T (a2[i][3]); // { dg-warning "a2\\\[i]\\\[3]' is used uninitialized" }
- T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" }
+ T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[1][2]); // { dg-warning "a2\\\[1]\\\[2]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[2][i]); // { dg-warning "a2\\\[2]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][3]); // { dg-warning "a2\\\[i]\\\[3]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
}
{
int a2[n][n];
- T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" }
- T (a2[4][5]); // { dg-warning "a2\\\[4]\\\[5]' is used uninitialized" }
- T (a2[6][i]); // { dg-warning "a2\\\[6]\\\[i]' is used uninitialized" }
- T (a2[i][7]); // { dg-warning "a2\\\[i]\\\[7]' is used uninitialized" }
- T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" }
+ T (a2[0][0]); // { dg-warning "a2\\\[0]\\\[0]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[4][5]); // { dg-warning "a2\\\[4]\\\[5]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[6][i]); // { dg-warning "a2\\\[6]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][7]); // { dg-warning "a2\\\[i]\\\[7]' is used uninitialized" "" { xfail { ! alloca } } }
+ T (a2[i][i]); // { dg-warning "a2\\\[i]\\\[i]' is used uninitialized" "" { xfail { ! alloca } } }
}
/* PR middle-end/98583 - missing -Wuninitialized reading from a second VLA
in its own block
{ dg-do compile }
- { dg-options "-O2 -Wall" }
- { dg-require-effective-target alloca } */
+ { dg-options "-O2 -Wall" } */
void f (int*);
void g (int);
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
-/* { dg-require-effective-target alloca } */
/* These are crash tests related to PR middle-end/6994; see also
g++.dg/ext/vla1.C. Note that at present A and C cannot be inlined. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target alloca } */
extern void bar (int *);
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
-/* { dg-require-effective-target alloca } */
extern void abort (void);
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
-/* { dg-require-effective-target alloca } */
/* This used to crash as we did not preserve the correct type
for __SIZE_TYPE__. See PR22439. */
/* { dg-do run } */
/* { dg-options "-std=c99 -pedantic-errors" } */
-/* { dg-require-effective-target alloca } */
/* PR c/18740 */
static int i;
/* PR29970*/
/* { dg-do run } */
/* { dg-options "-Wall -O0" } */
-/* { dg-require-effective-target alloca } */
int foo(void)
{
/* PR101838 */
/* { dg-do run } */
/* { dg-options "-std=gnu17 -Wpedantic -O0" } */
-/* { dg-require-effective-target alloca } */
int bar0(
/* PR29970, PR91038 */
/* { dg-do run } */
/* { dg-options "-O0 -Wunused-variable" } */
-/* { dg-require-effective-target alloca } */
int foo3b(void) // should not return 0
{
/* PR29970 */
/* { dg-do run } */
/* { dg-options "-Wunused-variable" } */
-/* { dg-require-effective-target alloca } */
/* { dg-do compile } */
/* { dg-options "-Winline -O2 -fgnu89-inline" } */
-/* { dg-require-effective-target alloca } */
extern void *alloca (__SIZE_TYPE__);
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE y
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 127.5 * 64 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 0
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 100
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 2 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 63 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 63.5 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 64 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 65 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 127 * 64 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-skip-if "Not available for ARCv1" { arc700 || arc6xx } } */
/* { dg-options "-O2 -mirq-ctrl-saved=r0-ilink" } */
-/* { dg-require-effective-target alloca } */
/* Check if ilink is recognized. Check how FP and BLINK are saved.
BLINK is saved last on the stack because the IRQ autosave will do
/* { dg-do compile { target { { ! x32 } && { ! avx512f_runtime } } } } */
/* { dg-options "-Ofast -mabi=ms -mavx512f" } */
/* { dg-require-effective-target avx512f } */
-/* { dg-require-effective-target alloca } */
/* Test with alloca (and DRAP). */
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -maddr-reg-reg-cost=1" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE y
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE 0
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE 100
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE 64 * 1024
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE 65 * 1024
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */
#define SIZE 127 * 64 * 1024
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE y
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 127.5 * 3 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 0
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 100
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 1.5 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 2 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 2.5 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 3 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 65 * 1024
#include "stack-check-alloca.h"
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
-/* { dg-require-effective-target alloca } */
#define SIZE 127 * 3 * 1024
#include "stack-check-alloca.h"
/* { dg-do run { target *-*-solaris2.* *-*-linux* *-*-*bsd* } } */\r
/* { dg-require-effective-target fpic } */\r
/* { dg-options "-fPIC" } */\r
-/* { dg-require-effective-target alloca } */\r
\r
#include <stdio.h>\r
#include <setjmp.h>\r
/* { dg-do run } */
/* { dg-additional-sources "do-test.S" } */
/* { dg-additional-options "-Wall" } */
-/* { dg-require-effective-target alloca } */
#include <stdio.h>
#include <string.h>
}
}
+ # If dynamic stack allocation is not supported, expectant tests are UNSUPPORTED.
+ if { ![check_effective_target_alloca] } {
+ if [regexp "(^|\n)\[^\n\]*: sorry, unimplemented: dynamic stack allocation not supported" $text] {
+ return "::unsupported::dynamic stack allocation not supported"
+ }
+ }
+
return $text
}
set dg-do-what [find-dg-do-what]
if { ![llength ${dg-do-what}] } {
- error "unexpected call stack"
+ # This happens if 'gcc-dg-prune' etc. get called outside of
+ # 'dg-test'. For these purposes, assume that dynamic stack
+ # allocation is supported.
+ return 1
}
if { [string equal [lindex ${dg-do-what} 0] run] } {
# For 'dg-do run', it additionally depends on runtime support.
}
}
+ # If dynamic stack allocation is not supported, expectant tests are UNSUPPORTED.
+ if { ![check_effective_target_alloca] } {
+ if [regexp "(^|\n)\[^\n\]*: sorry, unimplemented: dynamic stack allocation not supported" $text] {
+ return "::unsupported::dynamic stack allocation not supported"
+ }
+ }
+
foreach p $additional_prunes {
if { [string length $p] > 0 } {
# Following regexp matches a complete line containing $p.