[Bug tree-optimization/115828] Inefficient loop termination (should use compare against 0)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 8 19:53:23 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115828
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2024-07-08
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is IV-OPTS going wrong.
What is interesting is for powerpc, doloop can move it back to being `!=0`.
E.g we get:
```
li 8,19
li 9,36
lis 10,v@ha
mtctr 8
.L2:
stw 9,v@l(10)
addi 9,9,-2
bdnz .L2
blr
```
Turning off ivopts `-fno-ivopts`. avr gives:
```
.L2:
sts v+1,r19
sts v,r18
subi r18,2
sbc r19,__zero_reg__
sbiw r24, 1
brne .L2
```
Which seems like reasonable code.
More information about the Gcc-bugs
mailing list