[Bug tree-optimization/84053] [7/8 Regression] missing -Warray-bounds accessing a local array across inlined function boundaries
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 20 16:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84053
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Actually, the new test revealed that it doesn't work in ILP32 even in GCC 9:
$ gcc -O2 -S -Wall -m32 pr84053.c
pr84053.c: In function ‘f’:
pr84053.c:9:11: warning: array subscript 3 is above array bounds of ‘int[2]’
[-Warray-bounds]
9 | return a[i]; // -Warray-bounds (good)
| ~^~~
pr84053.c:4:7: note: while referencing ‘a’
4 | int a[] = { 1, 2 };
| ^
Let me add the test anyway and xfail it for ILP32.
More information about the Gcc-bugs
mailing list