https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109190
Steven Sun <StevenSun2021 at hotmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |StevenSun2021 at hotmail dot
com
--- Comment #4 from Steven Sun <StevenSun2021 at hotmail dot com> ---
The analyzer is implemented as a ipa pass, which eats codes partially optimized
by the middle end, or the optimizer.
Your code presented to the analyzer looks like this in -O1
https://godbolt.org/z/KdaKW5Yae
```
int main ()
{
int j;
goto <bb 4>; [100.00%]
<bb 3> [local count: 536870913]:
j_4 = j_1 + 1;
<bb 4> [local count: 1073741824]:
if (j_1 <= 0)
goto <bb 3>; [50.00%]
else
goto <bb 5>; [50.00%]
<bb 5> [local count: 536870913]:
return 0;
}
```
And it looks like this in -O2
https://godbolt.org/z/rrjdaM4WP
```
int main ()
{
MEM[(int *)0B] = 1;
return 0;
}
```
The analyzer outputs should be definitely different.
I am not here to what causes this, but in case you're interested, you can use
godbolt to check all optimize passes.