]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid -Walloca-larger-than and -Wvla-larger-than false postives and negatives.
authorMartin Sebor <msebor@redhat.com>
Mon, 10 May 2021 20:00:04 +0000 (14:00 -0600)
committerMartin Sebor <msebor@redhat.com>
Mon, 10 May 2021 20:02:35 +0000 (14:02 -0600)
commitf974b54b8a0c330e9dd2b43ebc940100d601df0f
tree43298bab245d60accec860e2f6409f991bf1aef1
parent51d89e61f7ebfe75ca752e62bd29b58cb957235c
Avoid -Walloca-larger-than and -Wvla-larger-than false postives and negatives.

Resolves:
PR middle-end/100425 - missing -Walloca-larger-than with -O0
PR middle-end/100510 - bogus -Wvla-large-than with -Walloca

gcc/ChangeLog:

PR middle-end/100425
PR middle-end/100510
* gimple-ssa-warn-alloca.c (pass_walloca::firast_time_p): Rename...
(pass_walloca::xlimit_certain_p): ...to this.
(pass_walloca::gate): Execute for any kind of handled warning.
(pass_walloca::execute): Avoid issuing "maybe" and "unbounded"
warnings when xlimit_certain_p is set.

gcc/testsuite/ChangeLog:

PR middle-end/100425
PR middle-end/100510
* c-c++-common/Walloca-larger-than.C: New test.
* gcc.dg/Walloca-larger-than-4.c: New test.
* gcc.dg/Wvla-larger-than-5.c: New test.
* gcc.dg/pr79972.c: Remove unexpected warning directive.
gcc/gimple-ssa-warn-alloca.c
gcc/testsuite/c-c++-common/Walloca-larger-than.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Walloca-larger-than-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wvla-larger-than-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr79972.c