summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-24 13:47:26 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-24 13:47:26 +0000
commit2164d9d3230baf603cd0ad6621b3e6cbbb36b6be (patch)
treed59cda303be54e77c4ec9ffea649d8ef8215be09 /gcc/tree-ssa-forwprop.c
parent354af4246fbe650a00173133354185900bfaaf86 (diff)
downloadgcc-2164d9d3230baf603cd0ad6621b3e6cbbb36b6be.tar.gz
2009-09-24 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36143 PR tree-optimization/38747 * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Only create VIEW_CONVERT_EXPRs for TBAA compatible accesses. * gcc.dg/tree-ssa/fre-vce-1.c: XFAIL. * gcc.dg/tree-ssa/forwprop-6.c: Likewise. * g++.dg/torture/pr38747.C: New testcase. * g++.dg/tree-ssa/pr19637.C: Un-XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 5aec33415d4..87795a28223 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -831,7 +831,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
&& !TYPE_VOLATILE (TREE_TYPE (rhs))
&& !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
&& operand_equal_p (TYPE_SIZE (TREE_TYPE (rhs)),
- TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0))
+ TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0)
+ /* Make sure we only do TBAA compatible replacements. */
+ && get_alias_set (TREE_OPERAND (def_rhs, 0)) == get_alias_set (rhs))
{
tree def_rhs_base, new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0));
new_rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), new_rhs);