diff options
| author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-30 12:23:18 +0000 |
|---|---|---|
| committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-30 12:23:18 +0000 |
| commit | a8b462d6e69b2b05ff2f0a8fc3d4097fff424d44 (patch) | |
| tree | c8758fc6c93ba74b915a04708fec331c7154a6d6 | |
| parent | 06a8a63d09b62250b61cab7509c345e4b52b6951 (diff) | |
| download | ppe42-gcc-a8b462d6e69b2b05ff2f0a8fc3d4097fff424d44.tar.gz ppe42-gcc-a8b462d6e69b2b05ff2f0a8fc3d4097fff424d44.zip | |
gcc/
Revert:
2007-06-27 Richard Sandiford <richard@codesourcery.com>
* dce.c (deletable_insn_p_1): New function, split out from...
(deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs
specially, not those inside PARALLELs. Remove BODY argument
and adjust recursive call accordingly.
(prescan_insns_for_dce): Update call to delete_insn_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126143 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 12 | ||||
| -rw-r--r-- | gcc/dce.c | 64 |
2 files changed, 36 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c3dd64f71b..7a9af4b229b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2007-06-30 Richard Sandiford <richard@codesourcery.com> + + Revert: + + 2007-06-27 Richard Sandiford <richard@codesourcery.com> + + * dce.c (deletable_insn_p_1): New function, split out from... + (deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs + specially, not those inside PARALLELs. Remove BODY argument + and adjust recursive call accordingly. + (prescan_insns_for_dce): Update call to delete_insn_p. + 2007-06-30 Rask Ingemann Lambertsen <rask@sygehus.dk> * combine.c (combine_validate_cost): New parameter NEWOTHERPAT. diff --git a/gcc/dce.c b/gcc/dce.c index 2e8b77ab33e..0252d4d5b24 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -58,15 +58,16 @@ static bitmap_obstack dce_tmp_bitmap_obstack; static sbitmap marked = NULL; -/* A subroutine for which BODY is part of the instruction being tested; - either the top-level pattern, or an element of a PARALLEL. The - instruction is known not to be a bare USE or CLOBBER. */ +/* Return true if INSN with BODY is a normal instruction that can be + deleted by the DCE pass. */ static bool -deletable_insn_p_1 (rtx body) +deletable_insn_p (rtx insn, rtx body, bool fast) { + rtx x; switch (GET_CODE (body)) { + case USE: case PREFETCH: case TRAP_IF: /* The UNSPEC case was added here because the ia-64 claims that @@ -78,35 +79,6 @@ deletable_insn_p_1 (rtx body) case UNSPEC: return false; - default: - if (volatile_insn_p (body)) - return false; - - if (flag_non_call_exceptions && may_trap_p (body)) - return false; - - return true; - } -} - -/* Return true if INSN is a normal instruction that can be deleted by - the DCE pass. */ - -static bool -deletable_insn_p (rtx insn, bool fast) -{ - rtx body, x; - int i; - - if (!NONJUMP_INSN_P (insn)) - return false; - - body = PATTERN (insn); - switch (GET_CODE (body)) - { - case USE: - return false; - case CLOBBER: if (fast) { @@ -116,20 +88,32 @@ deletable_insn_p (rtx insn, bool fast) x = XEXP (body, 0); return REG_P (x) && (!HARD_REGISTER_P (x) || reload_completed); } - else + else /* Because of the way that use-def chains are built, it is not possible to tell if the clobber is dead because it can never be the target of a use-def chain. */ return false; case PARALLEL: - for (i = XVECLEN (body, 0) - 1; i >= 0; i--) - if (!deletable_insn_p_1 (XVECEXP (body, 0, i))) - return false; - return true; + { + 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: - return deletable_insn_p_1 (body); + if (!NONJUMP_INSN_P (insn)) + return false; + + if (volatile_insn_p (body)) + return false; + + if (flag_non_call_exceptions && may_trap_p (body)) + return false; + + return true; } } @@ -385,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); |

