summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-01 09:47:21 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-01 09:47:21 +0000
commitf82bdab4272a3d1e4981779a27774f4e1613f32f (patch)
tree7d8501382557fc2411e882ec6b7f73fbd06eabac /gcc/tree-ssa-structalias.c
parent9b960a7bf2ede95bb66456fba9c76c0e57434df7 (diff)
downloadgcc-f82bdab4272a3d1e4981779a27774f4e1613f32f.tar.gz
2011-02-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47541 * tree-ssa-structalias.c (push_fields_onto_fieldstack): Make sure to have a field at offset zero. * g++.dg/torture/pr47541.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169468 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index cf1e817f377..97719ff8473 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5083,6 +5083,19 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (!VEC_empty (fieldoff_s, *fieldstack))
pair = VEC_last (fieldoff_s, *fieldstack);
+ /* If there isn't anything at offset zero, create sth. */
+ if (!pair
+ && offset + foff != 0)
+ {
+ pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
+ pair->offset = 0;
+ pair->size = offset + foff;
+ pair->has_unknown_size = false;
+ pair->must_have_pointers = false;
+ pair->may_have_pointers = false;
+ pair->only_restrict_pointers = false;
+ }
+
if (!DECL_SIZE (field)
|| !host_integerp (DECL_SIZE (field), 1))
has_unknown_size = true;