aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 9cf2f83..437d426 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1329,7 +1329,9 @@ fold_const_aggregate_ref (tree t)
if (TREE_CODE (base) == SSA_NAME
&& (value = get_value (base))
&& value->lattice_val == CONSTANT
- && TREE_CODE (value->value) == ADDR_EXPR)
+ && TREE_CODE (value->value) == ADDR_EXPR
+ && useless_type_conversion_p (TREE_TYPE (t),
+ TREE_TYPE (TREE_TYPE (value->value))))
return fold_const_aggregate_ref (TREE_OPERAND (value->value, 0));
break;
}