From 678584fc80fc69fbd3c4f5f15d484ed6006f41be Mon Sep 17 00:00:00 2001 From: Denis Chertykov Date: Tue, 31 Aug 2004 20:25:32 +0000 Subject: [PATCH] re PR target/15417 (ICE while building an avr-cross compiler) PR target/15417 * config/avr/avr.c (avr_hard_regno_mode_ok): Enable usage of frame pointer register only in Pmode while reload in progress. From-SVN: r86842 --- gcc/ChangeLog | 6 ++++++ gcc/config/avr/avr.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc2d7bd1665..26916e81b38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-31 Denis Chertykov + + PR target/15417 + * config/avr/avr.c (avr_hard_regno_mode_ok): Enable usage of + frame pointer register only in Pmode while reload in progress. + 2004-08-31 Stephane Carrez PR target/15334 diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 26d6fdb73fc..509980559c4 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -5125,6 +5125,12 @@ avr_hard_regno_mode_ok (int regno, enum machine_mode mode) if (regno == REG_Y + 1) return 0; + /* Reload can use r28:r29 for reload register and for frame pointer + in one insn. It's wrong. We must disable it. */ + if (mode != Pmode && reload_in_progress && frame_pointer_required_p () + && regno <= REG_Y && (regno + GET_MODE_SIZE (mode)) >= (REG_Y + 1)) + return 0; + if (mode == QImode) return 1; /* if (regno < 24 && !AVR_ENHANCED) -- 2.30.2