https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121952
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> <bb 3> [local count: 955630224]:
> # ivtmp.11_30 = PHI <ivtmp.11_11(8), ivtmp.11_9(7)>
> _3 = 1 - t.0_1;
> _4 = (bool) _3;
> _5 = (unsigned long) ∾
> _21 = (bool) _5;
> _2 = _4 - _21;
> _31 = (bool) ivtmp.11_30;
> _32 = _2 + _31;
> _6 = _32;
> _33 = (void *) ivtmp.11_30;
> MEM[(bool *)_33 + 1B] = _6;
> ivtmp.11_11 = ivtmp.11_30 + 1;
> if (ivtmp.11_11 != _39)
> goto <bb 8>; [89.00%]
> else
> goto <bb 9>; [11.00%]
>
> I am going to reopen this because IV-OPTS does something interesting to the
> IR.
> _2 = _4 - _21;
> Where _2 and _4 are boolean types.
>
> I think is is trying to do ((n - i + 1) % 2) in a boolean way.
Note I made some slight changes to so you don't need to use scanf:
```
bool ac[19]={}; // must be >= 19 for bug to be seen
long long n;
volatile int t = 1;
n = t;
```
I still think something is going wrong in ccp:
Visiting PHI node: ivtmp.11_30 = PHI <ivtmp.11_11(4), ivtmp.11_9(3)>
Argument #0 (4 -> 4 not executable)
Argument #1 (3 -> 4 executable)
ivtmp.11_9 Value: CONSTANT 0x0 (0xfffffffffffffff0)
PHI node value: CONSTANT 0x0 (0xfffffffffffffff0)
Lattice value changed to CONSTANT 0x0 (0xfffffffffffffff0). Adding SSA edges
to worklist.
There is also a couple of missed optimizations which I am going to fix