From d49ffcf44b9a9e566fe8417c36ed2f130460326f Mon Sep 17 00:00:00 2001 From: zadeck Date: Sat, 23 Jun 2007 16:21:43 +0000 Subject: [PATCH] 2007-06-23 Kenneth Zadeck PR middle-end/32437 *dce.c (deletable_insn_p): Add extra parameter and recurse if insn is a PARALLEL. (prescan_insns_for_dce): Add extra parameter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125972 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/dce.c | 26 +++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 204a37f..eff5188 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-06-23 Kenneth Zadeck + + PR middle-end/32437 + *dce.c (deletable_insn_p): Add extra parameter and recurse if insn + is a PARALLEL. + (prescan_insns_for_dce): Add extra parameter. + 2007-06-23 Jan Hubicka PR middle-end/31541 diff --git a/gcc/dce.c b/gcc/dce.c index 902dbd9..0252d4d 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -58,15 +58,14 @@ static bitmap_obstack dce_tmp_bitmap_obstack; static sbitmap marked = NULL; -/* Return true if INSN a normal instruction that can be deleted by the - DCE pass. */ +/* Return true if INSN with BODY is a normal instruction that can be + deleted by the DCE pass. */ static bool -deletable_insn_p (rtx insn, bool fast) +deletable_insn_p (rtx insn, rtx body, bool fast) { rtx x; - - switch (GET_CODE (PATTERN (insn))) + switch (GET_CODE (body)) { case USE: case PREFETCH: @@ -86,7 +85,7 @@ deletable_insn_p (rtx insn, bool fast) /* A CLOBBER of a dead pseudo register serves no purpose. That is not necessarily true for hard registers until after reload. */ - x = XEXP (PATTERN (insn), 0); + x = XEXP (body, 0); return REG_P (x) && (!HARD_REGISTER_P (x) || reload_completed); } else @@ -95,14 +94,23 @@ deletable_insn_p (rtx insn, bool fast) never be the target of a use-def chain. */ return false; + case PARALLEL: + { + int i; + for (i = XVECLEN (body, 0) - 1; i >= 0; i--) + if (!deletable_insn_p (insn, XVECEXP (body, 0, i), fast)) + return false; + return true; + } + default: if (!NONJUMP_INSN_P (insn)) return false; - if (volatile_insn_p (PATTERN (insn))) + if (volatile_insn_p (body)) return false; - if (flag_non_call_exceptions && may_trap_p (PATTERN (insn))) + if (flag_non_call_exceptions && may_trap_p (body)) return false; return true; @@ -361,7 +369,7 @@ prescan_insns_for_dce (bool fast) rtx note = find_reg_note (insn, REG_LIBCALL_ID, NULL_RTX); if (note) mark_libcall (insn, fast); - else if (deletable_insn_p (insn, fast)) + else if (deletable_insn_p (insn, PATTERN (insn), fast)) mark_nonreg_stores (PATTERN (insn), insn, fast); else mark_insn (insn, fast); -- 2.7.4