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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #7 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I can reproduce with gcc-12 as host compiler, but not with gcc-11 as host
compiler.

I'm using the example in comment #4, and a recent HEAD of master (bac07a1da24)
configured with --target=sh3eb-elf.

With "GCC: (GNU) 11.3.1 20220812" as host compiler, the cross-compiler compiles
(-O1) the example to:

_f:
        cmp/pz  r4
        bf.s    .L3
        add     r4,r5
        tst     r5,r5
        bf      .L4
        rts
        mov     r4,r0
        .align 1
.L3:
        rts
        mov     #1,r0
        .align 1
.L4:
        rts
        mov     #3,r0

which looks ok to me (not knowing SH asm...).

With "GCC: (GNU) 12.1.1 20220812" (the 12.2.0 RC) as host compiler, the
cross-compiler instead compiles the example to:

_f:
        cmp/pz  r4
        bf      .L3
        bf      .L4
        rts
        mov     r4,r0
        .align 1
.L3:
        rts
        mov     #1,r0
        .align 1
.L4:
        rts
        mov     #3,r0

which looks broken.

Reply via email to