summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-15 11:17:37 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-15 11:17:37 +0000
commit0b37d5ece5c4a41ae7c43652158ad53b15d87bb5 (patch)
tree2df76aff858642dd504876b611f466bb766c2ad0 /gcc/tree-ssa-structalias.c
parent64e05ea9f3ffbcf7fabf42274705cada54c8bce1 (diff)
downloadgcc-0b37d5ece5c4a41ae7c43652158ad53b15d87bb5.tar.gz
2010-07-15 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44946 * tree-ssa-structalias.c (get_constraint_for_component_ref): Deal with accessing only padding properly. * gcc.c-torture/compile/pr44946.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162216 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 68e0cac7ec4..417671c7b39 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3177,13 +3177,19 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
cexpr.var = curr->id;
VEC_safe_push (ce_s, heap, *results, &cexpr);
}
- else
+ else if (VEC_length (ce_s, *results) == 0)
/* Assert that we found *some* field there. The user couldn't be
accessing *only* padding. */
/* Still the user could access one past the end of an array
embedded in a struct resulting in accessing *only* padding. */
- gcc_assert (VEC_length (ce_s, *results) >= 1
- || ref_contains_array_ref (orig_t));
+ /* Or accessing only padding via type-punning to a type
+ that has a filed just in padding space. */
+ {
+ cexpr.type = SCALAR;
+ cexpr.var = anything_id;
+ cexpr.offset = 0;
+ VEC_safe_push (ce_s, heap, *results, &cexpr);
+ }
}
else if (bitmaxsize == 0)
{