aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-05-14 15:30:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-05-14 15:30:14 +0000
commitf403a4a270a54f42ce8bddabbce58797adfd5c07 (patch)
tree59eb033c208b4ca85fcdb4e8a2c19f07886bb073 /gcc/tree-ssa-dse.c
parent2627042d9aeed56f7d03429eb439ab1c528f7016 (diff)
downloadgcc-f403a4a270a54f42ce8bddabbce58797adfd5c07.zip
gcc-f403a4a270a54f42ce8bddabbce58797adfd5c07.tar.gz
gcc-f403a4a270a54f42ce8bddabbce58797adfd5c07.tar.bz2
tree-ssa-dse.c (dse_possible_dead_store_p): Remove dead code.
2008-05-14 Richard Guenther <rguenther@suse.de> * tree-ssa-dse.c (dse_possible_dead_store_p): Remove dead code. Make sure to register the store if the use is a PHI_NODE. From-SVN: r135298
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r--gcc/tree-ssa-dse.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 8c96004..a4e507c 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -313,6 +313,14 @@ dse_possible_dead_store_p (tree stmt,
gcc_assert (*use_p != NULL_USE_OPERAND_P);
*first_use_p = *use_p;
+ /* ??? If we hit a PHI_NODE we could skip to the PHI_RESULT uses.
+ Don't bother to do that for now. */
+ if (TREE_CODE (temp) == PHI_NODE)
+ {
+ fail = true;
+ break;
+ }
+
/* In the case of memory partitions, we may get:
# MPT.764_162 = VDEF <MPT.764_161(D)>
@@ -360,29 +368,6 @@ dse_possible_dead_store_p (tree stmt,
return false;
}
- /* Skip through any PHI nodes we have already seen if the PHI
- represents the only use of this store.
-
- Note this does not handle the case where the store has
- multiple VDEFs which all reach a set of PHI nodes in the same block. */
- while (*use_p != NULL_USE_OPERAND_P
- && TREE_CODE (*use_stmt) == PHI_NODE
- && bitmap_bit_p (dse_gd->stores, get_stmt_uid (*use_stmt)))
- {
- /* A PHI node can both define and use the same SSA_NAME if
- the PHI is at the top of a loop and the PHI_RESULT is
- a loop invariant and copies have not been fully propagated.
-
- The safe thing to do is exit assuming no optimization is
- possible. */
- if (SSA_NAME_DEF_STMT (PHI_RESULT (*use_stmt)) == *use_stmt)
- return false;
-
- /* Skip past this PHI and loop again in case we had a PHI
- chain. */
- single_imm_use (PHI_RESULT (*use_stmt), use_p, use_stmt);
- }
-
return true;
}