summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:30:23 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:30:23 +0000
commiteac34d04970c0b0ceaaa267f8c586ada702839be (patch)
tree6785cb84202c00e716d03fe97bfca3a1951193dd
parentda43203c00f22e28d5a496ea502f8a3fce46e39c (diff)
downloadgcc-eac34d04970c0b0ceaaa267f8c586ada702839be.tar.gz
PR tree-optimization/17319
* tree-ssa-alias.c (compute_points_to_and_addr_escape): Also examine pointers on the LHS of an assignment. (collect_points_to_info_r): Handle RETURN_EXPR. testsuite/ChangeLog PR tree-optimization/17319 * gcc.dg/pr17319.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87673 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr17319.c12
-rw-r--r--gcc/tree-ssa-alias.c9
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70a193ca095..ad206dea5da 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-17 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/17319
+ * tree-ssa-alias.c (compute_points_to_and_addr_escape): Also
+ examine pointers on the LHS of an assignment.
+ (collect_points_to_info_r): Handle RETURN_EXPR.
+
2004-09-17 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (const_and_copies_stack): New.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index db4d92d86da..815bbbf7995 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-17 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/17319
+ * gcc.dg/pr17319.c: New test.
+
2004-09-17 Devang Patel <dpatel@apple.com>
* gcc.dg/20040813-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr17319.c b/gcc/testsuite/gcc.dg/pr17319.c
new file mode 100644
index 00000000000..5d39e4c5707
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr17319.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+typedef unsigned long long HARD_REG_ELT_TYPE;
+typedef HARD_REG_ELT_TYPE HARD_REG_SET[2];
+static HARD_REG_SET newpat_used_regs;
+int try_combine (void)
+{
+ HARD_REG_ELT_TYPE *scan_tp_ = newpat_used_regs;
+ scan_tp_[0] = 0;
+ scan_tp_[1] = 0;
+}
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index d30dc38d637..2fe4069c3c0 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -694,6 +694,9 @@ compute_points_to_and_addr_escape (struct alias_info *ai)
bitmap_set_bit (ai->written_vars, ann->uid);
if (may_be_aliased (var))
(VARRAY_UINT (ai->num_references, ann->uid))++;
+
+ if (POINTER_TYPE_P (TREE_TYPE (op)))
+ collect_points_to_info_for (ai, op);
}
/* Mark variables in V_MAY_DEF operands as being written to. */
@@ -1831,6 +1834,12 @@ collect_points_to_info_r (tree var, tree stmt, void *data)
switch (TREE_CODE (stmt))
{
+ case RETURN_EXPR:
+ if (TREE_CODE (TREE_OPERAND (stmt, 0)) != MODIFY_EXPR)
+ abort ();
+ stmt = TREE_OPERAND (stmt, 0);
+ /* FALLTHRU */
+
case MODIFY_EXPR:
{
tree rhs = TREE_OPERAND (stmt, 1);