Commit 6cad9859 by Kenneth Zadeck Committed by Kenneth Zadeck

re PR target/32437 (MIPS: FAIL in gcc.dg/cleanup-[8|9|10|11].c)

2007-06-23  Kenneth Zadeck <zadeck@naturalbridge.com>

	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.

From-SVN: r125972
parent 936d04b6
2007-06-23 Kenneth Zadeck <zadeck@naturalbridge.com>
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 <jh@suse.cz> 2007-06-23 Jan Hubicka <jh@suse.cz>
PR middle-end/31541 PR middle-end/31541
......
...@@ -58,15 +58,14 @@ static bitmap_obstack dce_tmp_bitmap_obstack; ...@@ -58,15 +58,14 @@ static bitmap_obstack dce_tmp_bitmap_obstack;
static sbitmap marked = NULL; static sbitmap marked = NULL;
/* Return true if INSN a normal instruction that can be deleted by the /* Return true if INSN with BODY is a normal instruction that can be
DCE pass. */ deleted by the DCE pass. */
static bool static bool
deletable_insn_p (rtx insn, bool fast) deletable_insn_p (rtx insn, rtx body, bool fast)
{ {
rtx x; rtx x;
switch (GET_CODE (body))
switch (GET_CODE (PATTERN (insn)))
{ {
case USE: case USE:
case PREFETCH: case PREFETCH:
...@@ -86,7 +85,7 @@ deletable_insn_p (rtx insn, bool fast) ...@@ -86,7 +85,7 @@ deletable_insn_p (rtx insn, bool fast)
/* A CLOBBER of a dead pseudo register serves no purpose. /* A CLOBBER of a dead pseudo register serves no purpose.
That is not necessarily true for hard registers until That is not necessarily true for hard registers until
after reload. */ after reload. */
x = XEXP (PATTERN (insn), 0); x = XEXP (body, 0);
return REG_P (x) && (!HARD_REGISTER_P (x) || reload_completed); return REG_P (x) && (!HARD_REGISTER_P (x) || reload_completed);
} }
else else
...@@ -95,14 +94,23 @@ deletable_insn_p (rtx insn, bool fast) ...@@ -95,14 +94,23 @@ deletable_insn_p (rtx insn, bool fast)
never be the target of a use-def chain. */ never be the target of a use-def chain. */
return false; 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: default:
if (!NONJUMP_INSN_P (insn)) if (!NONJUMP_INSN_P (insn))
return false; return false;
if (volatile_insn_p (PATTERN (insn))) if (volatile_insn_p (body))
return false; return false;
if (flag_non_call_exceptions && may_trap_p (PATTERN (insn))) if (flag_non_call_exceptions && may_trap_p (body))
return false; return false;
return true; return true;
...@@ -361,7 +369,7 @@ prescan_insns_for_dce (bool fast) ...@@ -361,7 +369,7 @@ prescan_insns_for_dce (bool fast)
rtx note = find_reg_note (insn, REG_LIBCALL_ID, NULL_RTX); rtx note = find_reg_note (insn, REG_LIBCALL_ID, NULL_RTX);
if (note) if (note)
mark_libcall (insn, fast); 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); mark_nonreg_stores (PATTERN (insn), insn, fast);
else else
mark_insn (insn, fast); mark_insn (insn, fast);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment