summaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-01 00:43:16 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-01 00:43:16 +0000
commitcb6906193ba41211ed46c16e48f72ae2748bda29 (patch)
treed4fc182665387c2a3682d06ffa7ed405877477f2 /gcc/resource.c
parentb995c337fde8b193359291a3f9631f80aaad69d0 (diff)
downloadgcc-cb6906193ba41211ed46c16e48f72ae2748bda29.tar.gz
* resource.c (mark_referenced_resources): Abort() before
attempting to mark a pseudo register. (mark_set_resources): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38581 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index 979de4d5cc9..fa7e9573061 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -212,14 +212,24 @@ mark_referenced_resources (x, res, include_delayed_effects)
unsigned int last_regno
= regno + HARD_REGNO_NREGS (regno, GET_MODE (x));
+ if (last_regno > FIRST_PSEUDO_REGISTER)
+ abort ();
for (r = regno; r < last_regno; r++)
SET_HARD_REG_BIT (res->regs, r);
}
return;
case REG:
- for (r = 0; r < HARD_REGNO_NREGS (REGNO (x), GET_MODE (x)); r++)
- SET_HARD_REG_BIT (res->regs, REGNO (x) + r);
+ {
+ unsigned int regno = REGNO (x);
+ unsigned int last_regno
+ = regno + HARD_REGNO_NREGS (regno, GET_MODE (x));
+
+ if (last_regno > FIRST_PSEUDO_REGISTER)
+ abort ();
+ for (r = regno; r < last_regno; r++)
+ SET_HARD_REG_BIT (res->regs, r);
+ }
return;
case MEM:
@@ -760,6 +770,8 @@ mark_set_resources (x, res, in_dest, mark_type)
unsigned int last_regno
= regno + HARD_REGNO_NREGS (regno, GET_MODE (x));
+ if (last_regno > FIRST_PSEUDO_REGISTER)
+ abort ();
for (r = regno; r < last_regno; r++)
SET_HARD_REG_BIT (res->regs, r);
}
@@ -768,8 +780,16 @@ mark_set_resources (x, res, in_dest, mark_type)
case REG:
if (in_dest)
- for (r = 0; r < HARD_REGNO_NREGS (REGNO (x), GET_MODE (x)); r++)
- SET_HARD_REG_BIT (res->regs, REGNO (x) + r);
+ {
+ unsigned int regno = REGNO (x);
+ unsigned int last_regno
+ = regno + HARD_REGNO_NREGS (regno, GET_MODE (x));
+
+ if (last_regno > FIRST_PSEUDO_REGISTER)
+ abort ();
+ for (r = regno; r < last_regno; r++)
+ SET_HARD_REG_BIT (res->regs, r);
+ }
return;
case STRICT_LOW_PART: