Avoid -Wuninitialized false negatives with sanitization and VLAs.
authorMartin Sebor <msebor@redhat.com>
Thu, 13 May 2021 22:05:50 +0000 (16:05 -0600)
committerMartin Sebor <msebor@redhat.com>
Thu, 13 May 2021 22:06:51 +0000 (16:06 -0600)
commit2efe245bb88bf4574e322ef7e6d2df83d9e13237
treea6d0bbec49a776bda1dfb729d6a6a2290a73e57a
parentca9bb74a5f856ccdceb4797f18b0a4ac8f49d069
Avoid -Wuninitialized false negatives with sanitization and VLAs.

Resolves:
PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized
PR middle-end/98583 - missing -Wuninitialized reading from a second VLA in its own block

gcc/ChangeLog:

PR tree-optimization/93100
PR middle-end/98583
* tree-ssa-uninit.c (check_defs): Exclude intrinsic functions that
don't modify referenced objects.

gcc/testsuite/ChangeLog:

PR tree-optimization/93100
PR middle-end/98583
* g++.dg/warn/uninit-pr93100.C: New test.
* gcc.dg/uninit-pr93100.c: New test.
* gcc.dg/uninit-pr98583.c: New test.
gcc/testsuite/g++.dg/warn/uninit-pr93100.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/uninit-pr93100.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/uninit-pr98583.c [new file with mode: 0644]
gcc/tree-ssa-uninit.c