OSDN Git Service

2007-11-15 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Nov 2007 11:15:08 +0000 (11:15 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Nov 2007 11:15:08 +0000 (11:15 +0000)
* 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

gcc/ChangeLog
gcc/tree-ssa-alias.c
gcc/tree-ssa-structalias.c

index c9e5183..c3aa6ec 100644 (file)
@@ -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
index 31e04bc..43d5ab2 100644 (file)
@@ -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;
index 3820b19..90c1d47 100644 (file)
@@ -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)