diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 22:09:45 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-15 22:09:45 +0000 |
commit | 0b3f639dba8d8de709f155e4281e709ddb3b0070 (patch) | |
tree | da2b2114c7702693918635be6c7ae1407c8010c8 /gcc/tree-ssa-alias.c | |
parent | e87210bbabb7f59320cfa270596162c3b3f5e4ef (diff) | |
download | gcc-0b3f639dba8d8de709f155e4281e709ddb3b0070.tar.gz |
2006-02-15 Daniel Berlin <dberlin@dberlin.org>
* tree.c (init_ttree): Add STRUCT_FIELD_TAG handling.
(tree_code_size): Ditto.
* tree.h (struct tree_memory_tag): Remove parent_var.
(struct tree_struct_field_tag): New.
(SFT_OFFSET): New.
(SFT_SIZE): New.
(union tree_node): Add sft member.
* tree-ssa-alias.c (get_tmt_for): Don't handle TYPE_READONLY
specially here.
(create_sft): Add size and offset argument, set SFT_OFFSET and
SFT_SIZE.
(create_overlap_variables_for): Update for SFT_OFFSET/SFT_SIZE.
* treestruct.def: Add TS_STRUCT_FIELD_TAG.
* tree-flow-inline.h (get_subvar_at): Update for
SFT_OFFSET/SFT_SIZE.
(var_can_have_subvars): Ditto.
(overlap_subvar): Ditto.
* print-tree.c (print_node): Print out interesting things for
SFT's.
* tree-flow.h (struct subvar): Remove offset and size members.
* tree-ssa-operands.c (get_expr_operands): Update for
get_indirect_ref_operands changes.
(get_indirect_ref_operands): Call add_virtual_operand instead of
add_stmt_operand. Only recurse on base var if requested.
(access_can_touch_variable): New function.
(add_stmt_operand): Split virtual operand handling into ...
(add_virtual_operand): Here. Add offset, size, and for_clobber
arguments. Prune alias sets.
(add_call_clobber_ops): Call add_virtual_operand.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111120 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 75a5ae57674..b262fd0f0fd 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2061,8 +2061,7 @@ get_tmt_for (tree ptr, struct alias_info *ai) { struct alias_map_d *curr = ai->pointers[i]; tree curr_tag = var_ann (curr->var)->type_mem_tag; - if (tag_set == curr->set - && TYPE_READONLY (tag_type) == TYPE_READONLY (TREE_TYPE (curr_tag))) + if (tag_set == curr->set) { tag = curr_tag; break; @@ -2099,10 +2098,6 @@ get_tmt_for (tree ptr, struct alias_info *ai) pointed-to type. */ gcc_assert (tag_set == get_alias_set (tag)); - /* If PTR's pointed-to type is read-only, then TAG's type must also - be read-only. */ - gcc_assert (TYPE_READONLY (tag_type) == TYPE_READONLY (TREE_TYPE (tag))); - return tag; } @@ -2749,11 +2744,12 @@ get_or_create_used_part_for (size_t uid) } -/* Create and return a structure sub-variable for field type FIELD of - variable VAR. */ +/* Create and return a structure sub-variable for field type FIELD at + offset OFFSET, with size SIZE, of variable VAR. */ static tree -create_sft (tree var, tree field) +create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset, + unsigned HOST_WIDE_INT size) { var_ann_t ann; tree subvar = create_tag_raw (STRUCT_FIELD_TAG, field, "SFT"); @@ -2771,7 +2767,8 @@ create_sft (tree var, tree field) ann->type_mem_tag = NULL; add_referenced_tmp_var (subvar); SFT_PARENT_VAR (subvar) = var; - + SFT_OFFSET (subvar) = offset; + SFT_SIZE (subvar) = size; return subvar; } @@ -2882,19 +2879,17 @@ create_overlap_variables_for (tree var) && currfotype == lastfotype)) continue; sv = GGC_NEW (struct subvar); - sv->offset = fo->offset; - sv->size = fosize; sv->next = *subvars; - sv->var = create_sft (var, fo->type); + sv->var = create_sft (var, fo->type, fo->offset, fosize); if (dump_file) { fprintf (dump_file, "structure field tag %s created for var %s", get_name (sv->var), get_name (var)); fprintf (dump_file, " offset " HOST_WIDE_INT_PRINT_DEC, - sv->offset); + SFT_OFFSET (sv->var)); fprintf (dump_file, " size " HOST_WIDE_INT_PRINT_DEC, - sv->size); + SFT_SIZE (sv->var)); fprintf (dump_file, "\n"); } |