Applied the patch below as obvious.
It fixes a wrong code bug for u24 << 16 when the
input and output registers are not the same.

Johann

--

    AVR: target/117659 - Fix wrong code for u24 << 16.

    gcc/
            PR target/117659
            * config/avr/avr.cc (avr_out_ashlpsi3) [case 16]: Use %A1 as
            input (instead of bogus %A0).

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index dc68675b2bc..d0e39cd15df 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -6966,7 +6966,7 @@ avr_out_ashlpsi3 (rtx_insn *insn, rtx *op, int *plen)
            int reg1 = REGNO (op[1]);

            if (reg0 + 2 != reg1)
-             avr_asm_len ("mov %C0,%A0", op, plen, 1);
+             avr_asm_len ("mov %C0,%A1", op, plen, 1);

            return avr_asm_len ("clr %B0"  CR_TAB
                                "clr %A0", op, plen, 2);

Reply via email to