diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-05 09:58:57 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-05 09:58:57 +0000 |
commit | 731d55e7ce85ec145d390e8ab6923af321d854b2 (patch) | |
tree | ee642046af609460b576d110ce148485977f3ce5 /gcc/tree-ssa-structalias.c | |
parent | 3c77e0170281fba1c80ddd18365ef7bcd162128f (diff) | |
download | gcc-731d55e7ce85ec145d390e8ab6923af321d854b2.tar.gz |
2006-01-05 Richard Guenther <rguenther@suse.de>
* tree-flow.h (struct fieldoff): Decompose field to
type, size and decl.
* tree-ssa-alias.c (create_sft): Take type as parameter.
(create_overlap_variables_for): Store type, size and decl
in the fieldoff structure.
* tree-ssa-structalias.c (fieldoff_compare): Adjust users
of struct fieldoff.
(push_fields_onto_fieldstack): Likewise.
(create_variable_info_for): Likewise. Use offset for the
SFT name if the decl is not available.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109376 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index a3c655cfda1..bae21a02518 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3540,8 +3540,8 @@ fieldoff_compare (const void *pa, const void *pb) if (foa->offset != fob->offset) return foa->offset - fob->offset; - foasize = TREE_INT_CST_LOW (DECL_SIZE (foa->field)); - fobsize = TREE_INT_CST_LOW (DECL_SIZE (fob->field)); + foasize = TREE_INT_CST_LOW (foa->size); + fobsize = TREE_INT_CST_LOW (fob->size); return foasize - fobsize; } @@ -3597,7 +3597,9 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack, fieldoff_s *pair; pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL); - pair->field = field; + pair->type = TREE_TYPE (field); + pair->size = DECL_SIZE (field); + pair->decl = field; pair->offset = offset + bitpos_of_field (field); count++; } @@ -3842,12 +3844,11 @@ create_variable_info_for (tree decl, const char *name) unsigned int newindex = VEC_length (varinfo_t, varmap); fieldoff_s *fo = NULL; unsigned int i; - tree field; for (i = 0; !notokay && VEC_iterate (fieldoff_s, fieldstack, i, fo); i++) { - if (!DECL_SIZE (fo->field) - || TREE_CODE (DECL_SIZE (fo->field)) != INTEGER_CST + if (! fo->size + || TREE_CODE (fo->size) != INTEGER_CST || fo->offset < 0) { notokay = true; @@ -3882,8 +3883,7 @@ create_variable_info_for (tree decl, const char *name) return index; } - field = fo->field; - vi->size = TREE_INT_CST_LOW (DECL_SIZE (field)); + vi->size = TREE_INT_CST_LOW (fo->size); vi->offset = fo->offset; for (i = 1; VEC_iterate (fieldoff_s, fieldstack, i, fo); i++) { @@ -3891,14 +3891,16 @@ create_variable_info_for (tree decl, const char *name) const char *newname; char *tempname; - field = fo->field; newindex = VEC_length (varinfo_t, varmap); - asprintf (&tempname, "%s.%s", vi->name, alias_get_name (field)); + if (fo->decl) + asprintf (&tempname, "%s.%s", vi->name, alias_get_name (fo->decl)); + else + asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC, vi->name, fo->offset); newname = ggc_strdup (tempname); free (tempname); newvi = new_var_info (decl, newindex, newname, newindex); newvi->offset = fo->offset; - newvi->size = TREE_INT_CST_LOW (DECL_SIZE (field)); + newvi->size = TREE_INT_CST_LOW (fo->size); newvi->fullsize = vi->fullsize; insert_into_field_list (vi, newvi); VEC_safe_push (varinfo_t, heap, varmap, newvi); |