aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2012-03-07 10:36:30 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2012-03-07 10:36:30 +0000
commit611082257d0365f045685d125954cb5294a8c7b8 (patch)
treed974173fcc910f559c632ce71aa04b29bba151f4 /gcc
parentb30e10aba7ee054286393da539d4fc4f534b5b5b (diff)
downloadgcc-611082257d0365f045685d125954cb5294a8c7b8.zip
gcc-611082257d0365f045685d125954cb5294a8c7b8.tar.gz
gcc-611082257d0365f045685d125954cb5294a8c7b8.tar.bz2
re PR target/52505 ([avr]: __memx address space reading unintentionally from RAM)
libgcc/ PR target/52505 * config/avr/lib1funcs.S (__xload_1): Don't read unintentionally from RAM. gcc/ PR target/52505 * config/avr/avr.c (avr_out_xload): Don't read unintentionally from RAM. * config/avr/avr.md (xload_8): Adjust insn length. From-SVN: r185031
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/avr/avr.c5
-rw-r--r--gcc/config/avr/avr.md19
3 files changed, 27 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1ceccc4..baac09c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
+ PR target/52505
+ * config/avr/avr.c (avr_out_xload): Don't read unintentionally
+ from RAM.
+ * config/avr/avr.md (xload_8): Adjust insn length.
+
+2012-03-07 Georg-Johann Lay <avr@gjlay.de>
+
PR target/52461
* gcc/config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage
if RAMPZ affects reading from RAM.
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index ef49c73..87b7e09 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -2789,8 +2789,9 @@ avr_out_xload (rtx insn ATTRIBUTE_UNUSED, rtx *op, int *plen)
if (plen)
*plen = 0;
- avr_asm_len ("ld %3,%a2" CR_TAB
- "sbrs %1,7", xop, plen, 2);
+ avr_asm_len ("sbrc %1,7" CR_TAB
+ "ld %3,%a2" CR_TAB
+ "sbrs %1,7", xop, plen, 3);
avr_asm_len (AVR_HAVE_LPMX ? "lpm %3,%a2" : "lpm", xop, plen, 1);
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index bcf21af..9a208ee 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -363,6 +363,11 @@
;;========================================================================
;; Move stuff around
+;; "loadqi_libgcc"
+;; "loadhi_libgcc"
+;; "loadpsi_libgcc"
+;; "loadsi_libgcc"
+;; "loadsf_libgcc"
(define_expand "load<mode>_libgcc"
[(set (match_dup 3)
(match_dup 2))
@@ -377,7 +382,12 @@
operands[1] = replace_equiv_address (operands[1], operands[3]);
set_mem_addr_space (operands[1], ADDR_SPACE_FLASH);
})
-
+
+;; "load_qi_libgcc"
+;; "load_hi_libgcc"
+;; "load_psi_libgcc"
+;; "load_si_libgcc"
+;; "load_sf_libgcc"
(define_insn "load_<mode>_libgcc"
[(set (reg:MOVMODE 22)
(match_operand:MOVMODE 0 "memory_operand" "m,m"))]
@@ -418,6 +428,11 @@
DONE;
})
+;; "xloadqi_A"
+;; "xloadhi_A"
+;; "xloadpsi_A"
+;; "xloadsi_A"
+;; "xloadsf_A"
(define_insn_and_split "xload<mode>_A"
[(set (match_operand:MOVMODE 0 "register_operand" "=r")
(match_operand:MOVMODE 1 "memory_operand" "m"))
@@ -461,7 +476,7 @@
{
return avr_out_xload (insn, operands, NULL);
}
- [(set_attr "length" "3,4")
+ [(set_attr "length" "4,4")
(set_attr "adjust_len" "*,xload")
(set_attr "isa" "lpmx,lpm")
(set_attr "cc" "none")])