aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2006-02-27 17:25:17 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2006-02-27 17:25:17 +0000
commit6df11ca1befd286661b26a6a2a6774f4d4aa483c (patch)
tree96e2f8d02df730b6f48d1b5c2fbac3657761f0ed /gcc/tree-ssa-structalias.c
parent79ae22000f17f4cec1e1a6d27b6d648e0e37dbf5 (diff)
downloadgcc-6df11ca1befd286661b26a6a2a6774f4d4aa483c.zip
gcc-6df11ca1befd286661b26a6a2a6774f4d4aa483c.tar.gz
gcc-6df11ca1befd286661b26a6a2a6774f4d4aa483c.tar.bz2
tree-ssa-structalias.c (get_constraint_for): Move code to deal with aggregates here.
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. From-SVN: r111487
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c75
1 files changed, 24 insertions, 51 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 5d84f13..79d4f90 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -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;