aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2007-06-20 18:19:10 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2007-06-20 18:19:10 +0000
commit3d9b47dc431c0e8b967f390f28a68fe371d47eb4 (patch)
tree9e2d4808d596fbdc61945b54d0c37a41b151ec67 /gcc/tree-ssa-alias.c
parent034bfe7a9f51a82d1eadeb037791e5f467395eba (diff)
downloadgcc-3d9b47dc431c0e8b967f390f28a68fe371d47eb4.zip
gcc-3d9b47dc431c0e8b967f390f28a68fe371d47eb4.tar.gz
gcc-3d9b47dc431c0e8b967f390f28a68fe371d47eb4.tar.bz2
re PR tree-optimization/25737 (ACATS c974001 c974013 hang with struct aliasing)
PR tree-optimization/25737 * tree.h (struct tree_struct_field_tag): Add new field alias_set. (SFT_NONADDRESSABLE_P, SFT_ALIAS_SET): New macros. * tree-flow.h (struct fieldoff): Add new field alias_set. * tree-ssa-structalias.c (push_fields_onto_fieldstack): Add new argument addressable_type. Set alias_set of fieldoff. * tree-ssa-alias.c (create_sft): Add new argument alias_set. (create_overlap_variables_for): Pass alias_set from fieldoff to create_sft. * alias.c (get_alias_set): Use alias_set from SFT if set. From-SVN: r125890
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 31911e6..46c17ea 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -3646,11 +3646,13 @@ get_or_create_used_part_for (size_t uid)
/* Create and return a structure sub-variable for field type FIELD at
- offset OFFSET, with size SIZE, of variable VAR. */
+ offset OFFSET, with size SIZE, of variable VAR. If ALIAS_SET not
+ -1 this field is non-addressable and we should use this alias set
+ with this field. */
static tree
create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset,
- unsigned HOST_WIDE_INT size)
+ unsigned HOST_WIDE_INT size, HOST_WIDE_INT alias_set)
{
tree subvar = create_tag_raw (STRUCT_FIELD_TAG, field, "SFT");
@@ -3669,6 +3671,7 @@ create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset,
SFT_PARENT_VAR (subvar) = var;
SFT_OFFSET (subvar) = offset;
SFT_SIZE (subvar) = size;
+ SFT_ALIAS_SET (subvar) = alias_set;
return subvar;
}
@@ -3688,7 +3691,8 @@ create_overlap_variables_for (tree var)
|| up->write_only)
return;
- push_fields_onto_fieldstack (TREE_TYPE (var), &fieldstack, 0, NULL);
+ push_fields_onto_fieldstack (TREE_TYPE (var), &fieldstack, 0, NULL,
+ TREE_TYPE (var));
if (VEC_length (fieldoff_s, fieldstack) != 0)
{
subvar_t *subvars;
@@ -3780,7 +3784,8 @@ create_overlap_variables_for (tree var)
continue;
sv = GGC_NEW (struct subvar);
sv->next = *subvars;
- sv->var = create_sft (var, fo->type, fo->offset, fosize);
+ sv->var =
+ create_sft (var, fo->type, fo->offset, fosize, fo->alias_set);
if (dump_file)
{