diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-15 11:15:08 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-15 11:15:08 +0000 |
commit | babe10fa79e4cfa0e1e7e736a35aac6090e3c705 (patch) | |
tree | 5df9a1aee16895e76cfd432e23a15621197d36a8 /gcc | |
parent | e66c4ec1e3deb257920a3027451fbf4e06430750 (diff) | |
download | gcc-babe10fa79e4cfa0e1e7e736a35aac6090e3c705.tar.gz |
2007-11-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (create_overlap_variables_for): Make sure
to only create SFTs if we also create variable infos for PTA.
* tree-ssa-structalias.c (set_uids_in_ptset): Add all overlapping
SFTs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-alias.c | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 17 |
3 files changed, 24 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9e518393be..c3aa6ec96b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2007-11-15 Richard Guenther <rguenther@suse.de> + * tree-ssa-alias.c (create_overlap_variables_for): Make sure + to only create SFTs if we also create variable infos for PTA. + * tree-ssa-structalias.c (set_uids_in_ptset): Add all overlapping + SFTs. + +2007-11-15 Richard Guenther <rguenther@suse.de> + * tree-ssa-structalias.c (set_uids_in_ptset): Use the pointed-to type for TBAA pruning. (find_what_p_points_to): Call set_uids_in_ptset with the original diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 31e04bcca29..43d5ab23ea7 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3834,7 +3834,10 @@ create_overlap_variables_for (tree var) push_fields_onto_fieldstack (TREE_TYPE (var), &fieldstack, 0, NULL, TREE_TYPE (var), 0); - if (VEC_length (fieldoff_s, fieldstack) != 0) + /* 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 + && VEC_length (fieldoff_s, fieldstack) <= MAX_FIELDS_FOR_FIELD_SENSITIVE) { subvar_t *subvars; fieldoff_s *fo; diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 3820b1907cb..90c1d47f2ab 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4749,15 +4749,24 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed, || TREE_CODE (vi->decl) == PARM_DECL || TREE_CODE (vi->decl) == RESULT_DECL) { + subvar_t sv; if (var_can_have_subvars (vi->decl) - && get_subvars_for_var (vi->decl)) + && (sv = get_subvars_for_var (vi->decl))) { /* If VI->DECL is an aggregate for which we created - SFTs, add the SFT corresponding to VI->OFFSET. */ - tree sft = get_subvar_at (vi->decl, vi->offset); + SFTs, add the SFT corresponding to VI->OFFSET. + If we didn't do field-sensitive PTA we need to to + add all overlapping SFTs. */ + unsigned int j; + tree sft = get_first_overlapping_subvar (sv, vi->offset, + vi->size, &j); gcc_assert (sft); - if (sft) + for (; VEC_iterate (tree, sv, j, sft); ++j) { + if (SFT_OFFSET (sft) > vi->offset + && vi->size <= SFT_OFFSET (sft) - vi->offset) + break; + var_alias_set = get_alias_set (sft); if (no_tbaa_pruning || (!is_derefed && !vi->directly_dereferenced) |