[avr] : PR86040: Fix missing reset of RAMPZ after ELPM.
diff mbox series

Message ID d0d2cdb1-59ef-5d1d-29f4-31f62bab774c@gjlay.de
State New
Headers show
Series
  • [avr] : PR86040: Fix missing reset of RAMPZ after ELPM.
Related show

Commit Message

Georg-Johann Lay Oct. 17, 2019, 11:26 a.m. UTC
Hi, for families avrxmega5/7 after ELPM the reset of RAMPZ to
zero was missing in some situations due to  shortcut-return in
avr_out_lpm which which bypassed that reset.

Ok to apply and backport?

Johann

	PR target/86040
	* config/avr/avr.c (avr_out_lpm): Do not shortcut-return.

Comments

Jeff Law Oct. 17, 2019, 9:41 p.m. UTC | #1
On 10/17/19 5:26 AM, Georg-Johann Lay wrote:
> Hi, for families avrxmega5/7 after ELPM the reset of RAMPZ to
> zero was missing in some situations due to  shortcut-return in
> avr_out_lpm which which bypassed that reset.
> 
> Ok to apply and backport?
> 
> Johann
> 
>     PR target/86040
>     * config/avr/avr.c (avr_out_lpm): Do not shortcut-return.
OK for applying and backporting.
jeff

Patch
diff mbox series

Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c	(revision 276704)
+++ config/avr/avr.c	(working copy)
@@ -3780,13 +3780,14 @@  avr_out_lpm (rtx_insn *insn, rtx *op, in
           gcc_unreachable();
 
         case 1:
-          return avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
+          avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
+          break;
 
         case 2:
           if (REGNO (dest) == REG_Z)
-            return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
-                                "%4lpm %B0,%a2" CR_TAB
-                                "mov %A0,%5", xop, plen, 3);
+            avr_asm_len ("%4lpm %5,%a2+" CR_TAB
+                         "%4lpm %B0,%a2" CR_TAB
+                         "mov %A0,%5", xop, plen, 3);
           else
             {
               avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
@@ -3815,9 +3816,9 @@  avr_out_lpm (rtx_insn *insn, rtx *op, in
                        "%4lpm %B0,%a2+", xop, plen, 2);
 
           if (REGNO (dest) == REG_Z - 2)
-            return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
-                                "%4lpm %C0,%a2" CR_TAB
-                                "mov %D0,%5", xop, plen, 3);
+            avr_asm_len ("%4lpm %5,%a2+" CR_TAB
+                         "%4lpm %C0,%a2" CR_TAB
+                         "mov %D0,%5", xop, plen, 3);
           else
             {
               avr_asm_len ("%4lpm %C0,%a2+" CR_TAB