diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-22 15:41:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-22 15:41:48 +0000 |
commit | 65c463fdf256f2a345be5be7f1703d834746e208 (patch) | |
tree | 830677aad4b37fb8c1aebd51f53cf58a6b139f58 /gcc/tree-ssa-ccp.c | |
parent | ba99525e53848ffd9a25a0c737cbbefcb3f5d436 (diff) | |
download | gcc-65c463fdf256f2a345be5be7f1703d834746e208.tar.gz |
2009-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39824
* tree-ssa-ccp.c (fold_const_aggregate_ref): For INDIRECT_REFs
make sure the types are compatible.
* gcc.c-torture/compile/pr39824.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146592 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 9cf2f83546b..437d4267dd3 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; } |