OSDN Git Service

2006-02-27 Daniel Berlin <dberlin@dberlin.org>
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Feb 2006 17:25:17 +0000 (17:25 +0000)
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Feb 2006 17:25:17 +0000 (17:25 +0000)
* tree-ssa-structalias.c (get_constraint_for): Move code to deal
with aggregates here.
(find_func_aliases): Remove code for &<aggregate> from here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111487 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d54a48f..ca154bd 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-27  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree-ssa-structalias.c (get_constraint_for): Move code to deal
+       with aggregates here.
+       (find_func_aliases): Remove code for &<aggregate> from here.
+
 2006-02-26  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (fold_binary) <EQ_EXPR>:  Fold (~X & C) eq/ne 0 as
index 5d84f13..79d4f90 100644 (file)
@@ -2484,6 +2484,7 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results)
              struct constraint_expr *c;
              unsigned int i;
              tree exp = TREE_OPERAND (t, 0);
+             tree pttype = TREE_TYPE (TREE_TYPE (t));
 
              get_constraint_for (exp, results);
              /* Make sure we capture constraints to all elements
@@ -2507,6 +2508,26 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results)
                      VEC_safe_push (ce_s, heap, *results, &tmp);
                    }
                }
+             else if (VEC_length (ce_s, *results) == 1
+                      && (AGGREGATE_TYPE_P (pttype)
+                          || TREE_CODE (pttype) == COMPLEX_TYPE))
+               {
+                 struct constraint_expr *origrhs;
+                 varinfo_t origvar;
+                 struct constraint_expr tmp;
+
+                 gcc_assert (VEC_length (ce_s, *results) == 1);
+                 origrhs = VEC_last (ce_s, *results);
+                 tmp = *origrhs;
+                 VEC_pop (ce_s, *results);
+                 origvar = get_varinfo (origrhs->var);
+                 for (; origvar; origvar = origvar->next)
+                   {
+                     tmp.var = origvar->id;
+                     VEC_safe_push (ce_s, heap, *results, &tmp);
+                   }
+               }
+             
              for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
                {
                  if (c->type == DEREF)
@@ -3220,10 +3241,11 @@ find_func_aliases (tree origt)
   /* Now build constraints expressions.  */
   if (TREE_CODE (t) == PHI_NODE)
     {
+      gcc_assert (!AGGREGATE_TYPE_P (TREE_TYPE (PHI_RESULT (t))));
+
       /* Only care about pointers and structures containing
         pointers.  */
       if (POINTER_TYPE_P (TREE_TYPE (PHI_RESULT (t)))
-         || AGGREGATE_TYPE_P (TREE_TYPE (PHI_RESULT (t)))
          || TREE_CODE (TREE_TYPE (PHI_RESULT (t))) == COMPLEX_TYPE)
        {
          int i;
@@ -3241,27 +3263,6 @@ find_func_aliases (tree origt)
              rhstype = TREE_TYPE (strippedrhs);
              get_constraint_for (PHI_ARG_DEF (t, i), &rhsc);
 
-             if (TREE_CODE (strippedrhs) == ADDR_EXPR
-                && (AGGREGATE_TYPE_P (TREE_TYPE (rhstype))
-                    || TREE_CODE (TREE_TYPE (rhstype)) == COMPLEX_TYPE)
-                && VEC_length (ce_s, rhsc) == 1)
-               {
-                 struct constraint_expr *origrhs;
-                 varinfo_t origvar;
-                 struct constraint_expr tmp;
-
-                 gcc_assert (VEC_length (ce_s, rhsc) == 1);
-                 origrhs = VEC_last (ce_s, rhsc);
-                 tmp = *origrhs;
-                 VEC_pop (ce_s, rhsc);
-                 origvar = get_varinfo (origrhs->var);
-                 for (; origvar; origvar = origvar->next)
-                   {
-                     tmp.var = origvar->id;
-                     VEC_safe_push (ce_s, heap, rhsc, &tmp);
-                   }
-               }
-
              for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
                {
                  struct constraint_expr *c2;
@@ -3413,36 +3414,8 @@ find_func_aliases (tree origt)
                  case tcc_unary:
                      {
                        unsigned int j;
-                       tree strippedrhs = rhsop;
-                       tree rhstype;
-
-                       /* XXX: Push this back into the ADDR_EXPR
-                          case, and remove anyoffset handling.  */
-                       STRIP_NOPS (strippedrhs);
-                       rhstype = TREE_TYPE (strippedrhs);
-                       
-                       get_constraint_for (rhsop, &rhsc);
-                       if (TREE_CODE (strippedrhs) == ADDR_EXPR
-                           && (AGGREGATE_TYPE_P (TREE_TYPE (rhstype))
-                               || TREE_CODE (TREE_TYPE (rhstype)) == COMPLEX_TYPE)
-                           && VEC_length (ce_s, rhsc) == 1)
-                         {
-                           struct constraint_expr *origrhs;
-                           varinfo_t origvar;
-                           struct constraint_expr tmp;
-
-                           gcc_assert (VEC_length (ce_s, rhsc) == 1);
-                           origrhs = VEC_last (ce_s, rhsc);
-                           tmp = *origrhs;
-                           VEC_pop (ce_s, rhsc);
-                           origvar = get_varinfo (origrhs->var);
-                           for (; origvar; origvar = origvar->next)
-                             {
-                               tmp.var = origvar->id;
-                               VEC_safe_push (ce_s, heap, rhsc, &tmp);
-                             }
-                         }
 
+                       get_constraint_for (rhsop, &rhsc);
                        for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
                          {
                            struct constraint_expr *c2;