diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-07 21:03:55 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-07 21:03:55 +0000 |
commit | 1b2f34a99bab9910814dc196e442cc9251392e51 (patch) | |
tree | 73589bc29516aec8ae6263c78c3d383887aaa764 /gcc/tree-ssa-structalias.c | |
parent | 3dc8dd34c6aeaee6d08c8a16514371c5825b9e55 (diff) | |
download | gcc-1b2f34a99bab9910814dc196e442cc9251392e51.tar.gz |
2006-05-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27409
* tree-ssa-structalias.c (get_constraint_for_component_ref):
Do not try to find zero-sized subvars.
* gcc.dg/torture/pr27409.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113607 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index c5b6cabaadb..26dbd0dcca7 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2378,7 +2378,8 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results) ignore this constraint. When we handle pointer subtraction, we may have to do something cute here. */ - if (result->offset < get_varinfo (result->var)->fullsize) + if (result->offset < get_varinfo (result->var)->fullsize + && bitmaxsize != 0) { /* It's also not true that the constraint will actually start at the right offset, it may start in some padding. We only care about @@ -2400,6 +2401,12 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results) embedded in a struct resulting in accessing *only* padding. */ gcc_assert (curr || ref_contains_array_ref (orig_t)); } + else if (bitmaxsize == 0) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "Access to zero-sized part of variable," + "ignoring\n"); + } else if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Access to past the end of variable, ignoring\n"); |