diff options
author | Richard Guenther <rguenther@suse.de> | 2010-07-29 12:30:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-29 12:30:09 +0000 |
commit | 1c09321ca033a4094193fe9ce4e54e3344ac5360 (patch) | |
tree | a8834fc2b29c7c0312c6fb656e8026cacadceb17 /gcc/tree-ssa-structalias.c | |
parent | 81fb8a483c2c59c5c301f1c0e48deb849ed2aeb0 (diff) | |
download | gcc-1c09321ca033a4094193fe9ce4e54e3344ac5360.zip gcc-1c09321ca033a4094193fe9ce4e54e3344ac5360.tar.gz gcc-1c09321ca033a4094193fe9ce4e54e3344ac5360.tar.bz2 |
re PR tree-optimization/45120 (-fipa-pta causes FAIL: gcc.c-torture/execute/pta-field-2.c execution)
2010-07-29 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45120
* tree-ssa-structalias.c (get_constraint_for_component_ref):
Handle offset in DEREFs properly.
(get_constraint_for_1): Handle MEM_REF offset properly.
* gcc.dg/ipa/ipa-pta-15.c: New testcase.
From-SVN: r162676
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index cf5815f..37fc6f8 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3208,10 +3208,11 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results, at most one subfiled of any variable. */ if (bitpos == -1 || bitsize != bitmaxsize - || AGGREGATE_TYPE_P (TREE_TYPE (orig_t))) + || AGGREGATE_TYPE_P (TREE_TYPE (orig_t)) + || result->offset == UNKNOWN_OFFSET) result->offset = UNKNOWN_OFFSET; else - result->offset = bitpos; + result->offset += bitpos; } else if (result->type == ADDRESSOF) { @@ -3345,8 +3346,8 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p) { case MEM_REF: { - get_constraint_for_ptr_offset (TREE_OPERAND (t, 0), - TREE_OPERAND (t, 1), results); + tree off = double_int_to_tree (sizetype, mem_ref_offset (t)); + get_constraint_for_ptr_offset (TREE_OPERAND (t, 0), off, results); do_deref (results); return; } |