summaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-29 19:06:48 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-29 19:06:48 +0000
commita62c96dd9e34583f47eacda509f81ea78fb33b92 (patch)
tree3c29708e3ea9d938be6b03a4cef25d59127fa5d3 /gcc/haifa-sched.c
parent557795c6b50d287c2989e1ad607fa3b0660069b1 (diff)
downloadgcc-a62c96dd9e34583f47eacda509f81ea78fb33b92.tar.gz
Fix sched REG_DEAD note handling bug found by post-reload-flow pass.
* sched.c (update_flow_info): Add code to ! found_orig_dest case to handle deleted no-op moves of hard registers. * haifa-sched.c (update_flow_info): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23431 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 806bb396d88..ea043907262 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8340,8 +8340,28 @@ update_flow_info (notes, first, last, orig_insn)
}
else if (!found_orig_dest)
{
- /* This should never happen. */
- abort ();
+ int i, regno;
+
+ /* Should never reach here for a pseudo reg. */
+ if (REGNO (orig_dest) >= FIRST_PSEUDO_REGISTER)
+ abort ();
+
+ /* This can happen for a hard register, if the splitter
+ does not bother to emit instructions which would be no-ops.
+ We try to verify that this is the case by checking to see if
+ the original instruction uses all of the registers that it
+ set. This case is OK, because deleting a no-op can not affect
+ REG_DEAD notes on other insns. If this is not the case, then
+ abort. */
+
+ regno = REGNO (orig_dest);
+ for (i = HARD_REGNO_NREGS (regno, GET_MODE (orig_dest)) - 1;
+ i >= 0; i--)
+ if (! refers_to_regno_p (regno + i, regno + i + 1, orig_insn,
+ NULL_PTR))
+ break;
+ if (i >= 0)
+ abort ();
}
}