aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-08-29 13:04:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-08-29 13:04:19 +0000
commit301bbc16628d9ca57cd7b0af306fde6753f04911 (patch)
tree0a21cee48f6a9e573e775c87ff8e1a9a4c321ae4 /gcc/tree-ssa-dce.c
parent4860a46271bd50674a3adf1bc33704b98d7efffc (diff)
downloadgcc-301bbc16628d9ca57cd7b0af306fde6753f04911.zip
gcc-301bbc16628d9ca57cd7b0af306fde6753f04911.tar.gz
gcc-301bbc16628d9ca57cd7b0af306fde6753f04911.tar.bz2
re PR tree-optimization/58246 (wrong code at -O1 and above)
2013-08-29 Richard Biener <rguenther@suse.de> PR tree-optimization/58246 * tree-ssa-dce.c (mark_aliased_reaching_defs_necessary_1): Properly handle the dominance check inside a basic-block. * gcc.dg/torture/pr58246.c: New testcase. From-SVN: r202071
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 4fd3cd8..22ae50b 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -574,6 +574,11 @@ mark_aliased_reaching_defs_necessary_1 (ao_ref *ref, tree vdef, void *data)
in the references (gcc.c-torture/execute/pr42142.c).
The simplest way is to check if the kill dominates
the use. */
+ /* But when both are in the same block we cannot
+ easily tell whether we came from a backedge
+ unless we decide to compute stmt UIDs
+ (see PR58246). */
+ && (basic_block) data != gimple_bb (def_stmt)
&& dominated_by_p (CDI_DOMINATORS, (basic_block) data,
gimple_bb (def_stmt))
&& operand_equal_p (ref->ref, lhs, 0))