summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-27 11:15:32 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-27 11:15:32 +0000
commit69ce48b2736f87d545f37562d6b712628517bba3 (patch)
tree499a49f46ba444c4803938d2d0509e5a563ef429 /gcc/tree-ssa-structalias.c
parent79a0f5ea63ff0ad09e2264fed94f3c3379424be3 (diff)
downloadgcc-69ce48b2736f87d545f37562d6b712628517bba3.tar.gz
2005-07-27 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Avoid pushing again if current struct contains only fields we decomposed. * gcc.dg/tree-ssa/salias-1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 76ce7ab83c0..b01e9e70550 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2972,6 +2972,7 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (TREE_CODE (field) == FIELD_DECL)
{
bool push = false;
+ int pushed = 0;
if (has_union
&& (TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE
@@ -2980,7 +2981,7 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (!var_can_have_subvars (field))
push = true;
- else if (!(push_fields_onto_fieldstack
+ else if (!(pushed = push_fields_onto_fieldstack
(TREE_TYPE (field), fieldstack,
offset + bitpos_of_field (field), has_union))
&& DECL_SIZE (field)
@@ -2999,6 +3000,8 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
pair->offset = offset + bitpos_of_field (field);
count++;
}
+ else
+ count += pushed;
}
return count;