https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398
--- Comment #4 from Martin Sebor ---
A simpler test case is this (which is analogous to what the loop is transformed
into):
$ cat x.c && gcc -O2 -S -Wall x.c
unsigned left[1];
unsigned long right[1];
void f (unsigned i)
{
if (i)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398
--- Comment #3 from Thomas De Schampheleire
---
(In reply to Richard Biener from comment #2)
>
> We could change the warning to have a "may be above array bounds" form
> for your case but that wouldn't handle the bar() case.
The problem with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398
--- Comment #2 from Richard Biener ---
This is the simple case of GCC optimizing the access to a constant:
[50.00%]:
max.0_11 = max;
if (max.0_11 > 1)
goto ; [50.00%]
else
goto ; [50.00%]
[25.00%]:
_13 = right[0];
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398
Martin Sebor changed:
What|Removed |Added
Keywords||diagnostic,
|