diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-03-02 10:03:06 +0100 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-03-02 10:14:21 +0100 |
commit | 96bad6c06d0108014a2b0e5d0921cb18066bb789 (patch) | |
tree | ae1bf48d5e8e1a78e0bdf256fdfca7e4b363aa4b | |
parent | 282455d3132322885160d21e8d1da341de6b4484 (diff) |
AVR: target/114100 - Factor in -mtiny-stack in frame pointer adjustments
gcc/
PR target/114100
* config/avr/avr.cc (avr_out_plus_1) [-mtiny-stack]: Only adjust
the low part of the frame pointer with 8-bit stack pointer.
-rw-r--r-- | gcc/config/avr/avr.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 94ef7c591a9..d39d6707c97 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -8983,14 +8983,17 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc, && frame_pointer_needed && REGNO (xop[0]) == FRAME_POINTER_REGNUM) { - rtx xval16 = simplify_gen_subreg (HImode, xval, imode, i); - if (xval16 == const1_rtx || xval16 == constm1_rtx) + if (AVR_HAVE_8BIT_SP) + { + avr_asm_len ("subi %A0,%n2", xop, plen, 1); + return; + } + else if (xop[2] == const1_rtx || xop[2] == constm1_rtx) { - avr_asm_len ((code == PLUS) == (xval16 == const1_rtx) + avr_asm_len (xop[2] == const1_rtx ? "ld __tmp_reg__,%a0+" : "ld __tmp_reg__,-%a0", xop, plen, 1); - i++; - continue; + return; } } |