aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-11-21 19:19:34 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-11-21 19:19:34 -0800
commita125d8555a7c049962de97f73829f5938e7fb4e9 (patch)
tree6614a05f9eaaaefc3fb6c56d73430679467f6009 /gcc
parent4dc16355495fed26d2ff551dddcb44e84fddf374 (diff)
downloadgcc-a125d8555a7c049962de97f73829f5938e7fb4e9.zip
gcc-a125d8555a7c049962de97f73829f5938e7fb4e9.tar.gz
gcc-a125d8555a7c049962de97f73829f5938e7fb4e9.tar.bz2
regrename.c (scan_rtx_reg): Terminate the chain rather than abort on mark_read with NO_REGS.
* regrename.c (scan_rtx_reg): Terminate the chain rather than abort on mark_read with NO_REGS. From-SVN: r37644
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/regrename.c40
2 files changed, 30 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a925bac..2cbd967 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-21 Richard Henderson <rth@redhat.com>
+
+ * regrename.c (scan_rtx_reg): Terminate the chain rather than
+ abort on mark_read with NO_REGS.
+
2000-11-21 Mike Stump <mrs@wrs.com>
* fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Fix to allow
diff --git a/gcc/regrename.c b/gcc/regrename.c
index c444af8..19cc9e8 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -325,26 +325,36 @@ scan_rtx_reg (insn, loc, class, action, type)
if (regno + nregs <= this_regno
|| this_regno + this_nregs <= regno)
- p = &this->next_chain;
- else if (action == mark_read)
+ {
+ p = &this->next_chain;
+ continue;
+ }
+
+ if (action == mark_read)
{
if (! exact_match)
abort ();
- if (class == NO_REGS)
- abort ();
- this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
- this->next_use = *p;
- this->next_chain = (*p)->next_chain;
- this->loc = loc;
- this->insn = insn;
- this->class = class;
- this->need_caller_save_reg = 0;
- *p = this;
- return;
+ /* ??? Class NO_REGS can happen if the md file makes use of
+ EXTRA_CONSTRAINTS to match registers. Which is arguably
+ wrong, but there we are. Since we know not what this may
+ be replaced with, terminate the chain. */
+ if (class != NO_REGS)
+ {
+ this = (struct du_chain *)
+ obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ this->next_use = *p;
+ this->next_chain = (*p)->next_chain;
+ this->loc = loc;
+ this->insn = insn;
+ this->class = class;
+ this->need_caller_save_reg = 0;
+ *p = this;
+ return;
+ }
}
- else if (action != terminate_overlapping_read || ! exact_match)
+
+ if (action != terminate_overlapping_read || ! exact_match)
{
struct du_chain *next = this->next_chain;