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
This commit is contained in:
Georg-Johann Lay 2012-03-07 10:36:30 +00:00 committed by Georg-Johann Lay
parent b30e10aba7
commit 611082257d
5 changed files with 34 additions and 4 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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);

View File

@ -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")])

View File

@ -1,3 +1,9 @@
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
PR target/52505
* config/avr/lib1funcs.S (__xload_1): Don't read unintentionally
from RAM.
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
PR target/52461

View File

@ -2131,6 +2131,7 @@ ENDF __load_4
#if defined (L_xload_1)
DEFUN __xload_1
#if defined (__AVR_HAVE_LPMX__) && !defined (__AVR_HAVE_ELPM__)
sbrc HHI8, 7
ld D0, Z
sbrs HHI8, 7
lpm D0, Z