diff options
author | Richard Guenther <rguenther@suse.de> | 2007-11-16 14:40:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-11-16 14:40:04 +0000 |
commit | 99739a3e63eb906c77b8acdb76d4f40485eb56fe (patch) | |
tree | b456fc38c0a138350839b7ebdcbf56a53752ed5d /gcc/tree-ssa-alias.c | |
parent | bf3bde19e0bf954db21ec98ee179262ec68c5ded (diff) | |
download | gcc-99739a3e63eb906c77b8acdb76d4f40485eb56fe.zip gcc-99739a3e63eb906c77b8acdb76d4f40485eb56fe.tar.gz gcc-99739a3e63eb906c77b8acdb76d4f40485eb56fe.tar.bz2 |
re PR tree-optimization/33870 (miscompiles sqlite)
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33870
* tree.h (struct tree_memory_tag): Add base_for_components flag.
(struct tree_struct_field_tag): Remove nesting_level field.
(SFT_NESTING_LEVEL): Remove.
(SFT_BASE_FOR_COMPONENTS_P): Add.
* tree-flow.h (struct fieldoff): Remove nesting_level field. Add
base_for_components flag.
(push_fields_onto_fieldstack): Remove nesting_level parameter.
* tree-ssa-alias.c (create_sft): Likewise. Add base_for_components
parameter.
(create_overlap_variables_for): Deal with it.
* tree-dfa.c (dump_subvars_for): Likewise.
(dump_variable): Likewise.
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Likewise.
Set base_for_components for first elements of sub-structures.
(create_variable_info_for): Handle base_for_components.
(set_uids_in_ptset): Always set SFT_UNPARTITIONABLE_P for
pointed-to SFTs if SFT_BASE_FOR_COMPONENTS_P is set.
* tree-ssa-operands.c (ref_nesting_level): Remove.
(add_vars_for_offset): Remove full_ref parameter, always add
the offset of the pointed-to SFT.
(add_virtual_operand): Adjust for changed signature of
add_vars_for_offset.
* gcc.dg/torture/pr33870.c: New testcase.
From-SVN: r130231
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 43d5ab2..7d6c0e1 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3791,7 +3791,7 @@ get_or_create_used_part_for (size_t uid) static tree create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT size, alias_set_type alias_set, - unsigned nesting_level) + bool base_for_components) { tree subvar = create_tag_raw (STRUCT_FIELD_TAG, field, "SFT"); @@ -3811,7 +3811,8 @@ create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset, SFT_OFFSET (subvar) = offset; SFT_SIZE (subvar) = size; SFT_ALIAS_SET (subvar) = alias_set; - SFT_NESTING_LEVEL (subvar) = nesting_level; + SFT_BASE_FOR_COMPONENTS_P (subvar) = base_for_components; + SFT_UNPARTITIONABLE_P (subvar) = false; return subvar; } @@ -3833,7 +3834,7 @@ create_overlap_variables_for (tree var) return; push_fields_onto_fieldstack (TREE_TYPE (var), &fieldstack, 0, NULL, - TREE_TYPE (var), 0); + TREE_TYPE (var)); /* Make sure to not create SFTs for structs we won't generate variable infos for. See tree-ssa-structalias.c:create_variable_info_for (). */ if (VEC_length (fieldoff_s, fieldstack) != 0 @@ -3919,6 +3920,7 @@ create_overlap_variables_for (tree var) field, skip it. Note that we always need the field at offset 0 so we can properly handle pointers to the structure. */ + if ((fo->offset != 0 && ((fo->offset <= up->minused && fo->offset + fosize <= up->minused) @@ -3927,9 +3929,8 @@ create_overlap_variables_for (tree var) && fosize == lastfosize && currfotype == lastfotype)) continue; - - subvar = create_sft (var, fo->type, fo->offset, fosize, - fo->alias_set, fo->nesting_level); + subvar = create_sft (var, fo->type, fo->offset, + fosize, fo->alias_set, fo->base_for_components); VEC_quick_push (tree, *subvars, subvar); if (dump_file) @@ -3940,8 +3941,7 @@ create_overlap_variables_for (tree var) SFT_OFFSET (subvar)); fprintf (dump_file, " size " HOST_WIDE_INT_PRINT_DEC, SFT_SIZE (subvar)); - fprintf (dump_file, " nesting level %d\n", - SFT_NESTING_LEVEL (subvar)); + fprintf (dump_file, "\n"); } lastfotype = currfotype; |