[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 Martin Sebor changed: What|Removed |Added CC||fredrik.hederstierna@securi ||tas-direct.com --- Comment #14 from Martin Sebor --- *** Bug 102346 has been marked as a duplicate of this bug. ***
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 Martin Sebor changed: What|Removed |Added CC||haoxintu at gmail dot com --- Comment #13 from Martin Sebor --- *** Bug 95461 has been marked as a duplicate of this bug. ***
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 Martin Sebor changed: What|Removed |Added Last reconfirmed|2008-03-17 14:05:57 |2020-3-23 Known to fail||10.0, 4.3.5, 4.4.7, 4.8.5, ||4.9.4, 5.4.0, 6.4.0, 7.3.0, ||8.3.0, 9.1.0 --- Comment #12 from Martin Sebor --- Reconfirmed with GCC 10.
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 --- Comment #11 from John Levon --- Ugh, and in fact, the sanitize option isn't even enough for the real-life code that we hit this with.
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 John Levon changed: What|Removed |Added CC||levon at movementarian dot org --- Comment #10 from John Levon --- This is such a pain because of -faggressive-loop-optimizations. Here's a salient example courtesy of bcantrill: #define NULL ((void *)0) static char *arr[2] = { "nasal", "demons" }; long func() { int i; for (i = 0; i <= 2; i++) { if (arr[i] == NULL && i == 0) return (0xbad); } return (0xfad); } Obviously, the index past the array bounds is undefined behaviour, but GCC compiling this down to just "return (0xbad)" as it does is not very helpful. But what's *really* not helpful is that -Warray-bounds=2 can't report on this. (As per #78678, --fsanitize=object-size does enable detection of this. I'm not clear if implementation-wise that's the only way to get this reported.)
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 Manuel López-Ibáñez changed: What|Removed |Added CC||Gildos at gmail dot com --- Comment #9 from Manuel López-Ibáñez --- *** Bug 57367 has been marked as a duplicate of this bug. ***
[Bug middle-end/35587] -Warray-bounds does not work at all or does not find all trivial cases, and :works only with -O2 or -O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35587 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||xinliangli at gmail dot com --- Comment #8 from Manuel López-Ibáñez manu at gcc dot gnu.org --- *** Bug 52954 has been marked as a duplicate of this bug. ***