aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-01-16 23:10:36 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-01-16 18:10:36 -0500
commit50e9b3f17a56d615fa97b394de50f7ddb1e21868 (patch)
tree85ad051aa23b4802d7d4a98df66018876487047b
parent6953fdb48e46ebc61b7a4f762e19af1c6a42f36e (diff)
downloadgcc-50e9b3f17a56d615fa97b394de50f7ddb1e21868.zip
gcc-50e9b3f17a56d615fa97b394de50f7ddb1e21868.tar.gz
gcc-50e9b3f17a56d615fa97b394de50f7ddb1e21868.tar.bz2
flow.c (propagate_on_insn): Make trying to delete a prologue or epilogue insn an ICE, not a warning.
* flow.c (propagate_on_insn): Make trying to delete a prologue or epilogue insn an ICE, not a warning. Allow doing this if the current function returns with stack pointer depressed. From-SVN: r39078
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/flow.c38
2 files changed, 21 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2fe96be..f04fde6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
Tue Jan 16 17:20:43 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * flow.c (propagate_on_insn): Make trying to delete a prologue
+ or epilogue insn an ICE, not a warning. Allow doing this if
+ the current function returns with stack pointer depressed.
+
* combine.c (try_combine): If i3_subst_into_i2, properly check for
I3 having more than one SET.
diff --git a/gcc/flow.c b/gcc/flow.c
index acd25f2..4d0bdff 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -3764,35 +3764,31 @@ propagate_one_insn (pbi, insn)
note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
if (flags & PROP_SCAN_DEAD_CODE)
{
- insn_is_dead = insn_dead_p (pbi, PATTERN (insn), 0,
- REG_NOTES (insn));
+ insn_is_dead = insn_dead_p (pbi, PATTERN (insn), 0, REG_NOTES (insn));
libcall_is_dead = (insn_is_dead && note != 0
&& libcall_dead_p (pbi, note, insn));
}
- /* We almost certainly don't want to delete prologue or epilogue
- instructions. Warn about probable compiler losage. */
- if (insn_is_dead
- && reload_completed
- && (((HAVE_epilogue || HAVE_prologue)
- && prologue_epilogue_contains (insn))
- || (HAVE_sibcall_epilogue
- && sibcall_epilogue_contains (insn)))
- && find_reg_note (insn, REG_MAYBE_DEAD, NULL_RTX) == 0)
- {
- if (flags & PROP_KILL_DEAD_CODE)
- {
- warning ("ICE: would have deleted prologue/epilogue insn");
- if (!inhibit_warnings)
- debug_rtx (insn);
- }
- libcall_is_dead = insn_is_dead = 0;
- }
-
/* If an instruction consists of just dead store(s) on final pass,
delete it. */
if ((flags & PROP_KILL_DEAD_CODE) && insn_is_dead)
{
+ /* If we're trying to delete a prologue or epilogue instruction
+ that isn't flagged as possibly being dead, something is wrong.
+ But if we are keeping the stack pointer depressed, we might well
+ be deleting insns that are used to compute the amount to update
+ it by, so they are fine. */
+ if (reload_completed
+ && !(TREE_CODE (TREE_TYPE (current_function_decl)) == FUNCTION_TYPE
+ && (TYPE_RETURNS_STACK_DEPRESSED
+ (TREE_TYPE (current_function_decl))))
+ && (((HAVE_epilogue || HAVE_prologue)
+ && prologue_epilogue_contains (insn))
+ || (HAVE_sibcall_epilogue
+ && sibcall_epilogue_contains (insn)))
+ && find_reg_note (insn, REG_MAYBE_DEAD, NULL_RTX) == 0)
+ abort ();
+
/* Record sets. Do this even for dead instructions, since they
would have killed the values if they hadn't been deleted. */
mark_set_regs (pbi, PATTERN (insn), insn);