From: Richard Kenner Date: Tue, 16 Jan 2001 23:10:36 +0000 (+0000) Subject: flow.c (propagate_on_insn): Make trying to delete a prologue or epilogue insn an... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50e9b3f17a56d615fa97b394de50f7ddb1e21868;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fe96be3c1f..f04fde68eba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ Tue Jan 16 17:20:43 2001 Richard Kenner + * 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 acd25f2b410..4d0bdff92ed 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);