summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-01-23 04:51:28 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-01-23 04:51:28 +0000
commitd2ebe27c9a8f400036d9f6a750af21638866c563 (patch)
tree986473ca6fe688ccd6093f364c63d788bd1c2ece
parent0e69bba9fc926fd529f51aa9e7f585c27b88c1e3 (diff)
downloadgcc-d2ebe27c9a8f400036d9f6a750af21638866c563.tar.gz
re PR target/19378 (ICE during bootstrap compiling __fixdfdi)
PR middle-end/19378 * config/avr/avr.c (avr_hard_regno_mode_ok): Rewrite. From-SVN: r94102
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/avr/avr.c23
2 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 10018db6472..07c5b17c5f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-22 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/19378
+ * config/avr/avr.c (avr_hard_regno_mode_ok): Rewrite.
+
2005-01-22 Richard Henderson <rth@redhat.com>
PR target/19506
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 061a81e6524..0f6b2dee90a 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -5121,23 +5121,22 @@ jump_over_one_insn_p (rtx insn, rtx dest)
int
avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
- /* Bug workaround: recog.c (peep2_find_free_register) and probably
- a few other places assume that the frame pointer is a single hard
- register, so r29 may be allocated and overwrite the high byte of
- the frame pointer. Do not allow any value to start in r29. */
- if (regno == REG_Y + 1)
- return 0;
+ /* The only thing that can go into registers r28:r29 is a Pmode. */
+ if (regno == REG_Y && mode == Pmode)
+ return 1;
- /* 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))
+ /* Otherwise disallow all regno/mode combinations that span r28:r29. */
+ if (regno <= (REG_Y + 1) && (regno + GET_MODE_SIZE (mode)) >= (REG_Y + 1))
return 0;
if (mode == QImode)
return 1;
- /* if (regno < 24 && !AVR_ENHANCED)
- return 1;*/
+
+ /* Modes larger than QImode occupy consecutive registers. */
+ if (regno + GET_MODE_SIZE (mode) > FIRST_PSEUDO_REGISTER)
+ return 0;
+
+ /* All modes larger than QImode should start in an even register. */
return !(regno & 1);
}