[Bug target/83496] [7/8 regression] wrong code generated with -Os -mbranch-cost=1
nbd at nbd dot name
gcc-bugzilla@gcc.gnu.org
Sun Feb 25 19:22:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83496
--- Comment #27 from Felix Fietkau <nbd at nbd dot name> ---
On the original test case, it generates this code:
00400690 <mytest>:
400690: 8c830008 lw v1,8(a0)
400694: 24020001 li v0,1
400698: 10620011 beq v1,v0,4006e0 <mytest+0x50>
40069c: 00000000 nop
4006a0: 8c830000 lw v1,0(a0)
4006a4: 00000000 nop
4006a8: 28630002 slti v1,v1,2
4006ac: 1060000a beqz v1,4006d8 <mytest+0x48>
4006b0: 00000000 nop
4006b4: 8c82000c lw v0,12(a0)
4006b8: 00000000 nop
4006bc: 8c420000 lw v0,0(v0)
4006c0: 00000000 nop
4006c4: 00a2182b sltu v1,a1,v0
4006c8: 14600007 bnez v1,4006e8 <mytest+0x58>
4006cc: 00000000 nop
4006d0: 0045102b sltu v0,v0,a1
4006d4: 00021023 negu v0,v0
4006d8: 03e00008 jr ra
4006dc: 00000000 nop
4006e0: 03e00008 jr ra
4006e4: 2402ffff li v0,-1
4006e8: 03e00008 jr ra
4006ec: 24020001 li v0,1
It looks to me like it's generating lots of useless nop instructions after lw
More information about the Gcc-bugs
mailing list