aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2012-03-07 10:33:19 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2012-03-07 10:33:19 +0000
commitb30e10aba7ee054286393da539d4fc4f534b5b5b (patch)
tree7638785fce50e0f49c390449f2a2707afca1e1d6 /gcc/config/avr/avr.c
parenteb3e63ccf77951625062082a487a21d199a83b51 (diff)
downloadgcc-b30e10aba7ee054286393da539d4fc4f534b5b5b.zip
gcc-b30e10aba7ee054286393da539d4fc4f534b5b5b.tar.gz
gcc-b30e10aba7ee054286393da539d4fc4f534b5b5b.tar.bz2
re PR target/52461 ([avr] XMEGA+EBI: RAMPZ clobbered while reading from flash)
libgcc/ PR target/52461 PR target/52508 * config/avr/lib1funcs.S (__do_copy_data): Clear RAMPZ after usage if RAMPZ affects reading from RAM. (__tablejump_elpm__): Ditto. (.xload): Ditto. (__movmemx_hi): Ditto. (__do_global_ctors): Right condition for RAMPZ usage is "have ELPM". (__do_global_dtors): Ditto. (__xload_1, __xload_2, __xload_3, __xload_4): Ditto. (__movmemx_hi): Ditto. gcc/ PR target/52461 * gcc/config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage if RAMPZ affects reading from RAM. From-SVN: r185030
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r--gcc/config/avr/avr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 7ead6f4..ef49c73 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -2762,7 +2762,14 @@ avr_out_lpm (rtx insn, rtx *op, int *plen)
break; /* POST_INC */
} /* switch CODE (addr) */
+
+ if (xop[4] == xstring_e && AVR_HAVE_RAMPD)
+ {
+ /* Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM */
+ avr_asm_len ("out __RAMPZ__,__zero_reg__", xop, plen, 1);
+ }
+
return "";
}