This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/83496] MIPS BE: wrong code generates under "-Os -mbranch-cost=1"


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83496

Felix Fietkau <nbd at nbd dot name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nbd at nbd dot name

--- Comment #10 from Felix Fietkau <nbd at nbd dot name> ---
(In reply to Leslie Zhai from comment #9)
> GCC 8.0 Still reproducible:
> 
> 
> 0000000000000000 <mytest>:
>    0:   8c830008        lw      v1,8(a0)
>    4:   24020001        li      v0,1
>    8:   1062000d        beq     v1,v0,40 <mytest+0x40>
>    c:   00000000        nop
>   10:   8c830000        lw      v1,0(a0)
>   14:   28630002        slti    v1,v1,2
>   18:   1060000b        beqz    v1,48 <mytest+0x48>
>   1c:   00000000        nop
>   20:   dc820010        ld      v0,16(a0)
>   24:   dc420000        ld      v0,0(v0)
>   28:   00a2182b        sltu    v1,a1,v0
>   2c:   14600006        bnez    v1,48 <mytest+0x48>
>   30:   00000000        nop
>   34:   0045102b        sltu    v0,v0,a1
>   38:   03e00008        jr      ra
>   3c:   0002102f        dnegu   v0,v0
>   40:   03e00008        jr      ra
>   44:   2402ffff        li      v0,-1
>   48:   03e00008        jr      ra
>   4c:   24020001        li      v0,1

Actually, I think that assembly looks unaffected by the issue.

I have some doubts about the commits mentioned in this thread as well.
r240965 looks like it simply changes the code generator in a way that makes the
bug appear (without being the root cause of it) by affecting how and where
branches are generated.

It also looks like r248351 changes it again to avoid tripping over the bug,
again without affecting the root cause.

I don't know that much about GCC internals, so if I'm missing something here,
please help me understand.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]