re PR tree-optimization/17319 (-fno-tree-dce cause ICE)
authorDiego Novillo <dnovillo@redhat.com>
Fri, 17 Sep 2004 21:30:23 +0000 (21:30 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Fri, 17 Sep 2004 21:30:23 +0000 (17:30 -0400)
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.

From-SVN: r87673

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr17319.c [new file with mode: 0644]
gcc/tree-ssa-alias.c

index 70a193ca095c27559ac020ad66876ca13e6596ea..ad206dea5da1d298e04ce1666d6da87ac20677e6 100644 (file)
@@ -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.
index db4d92d86da31b8350932dabcb737e58709b211d..815bbbf7995266d2e07a91cc6a631105fad07ea3 100644 (file)
@@ -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 (file)
index 0000000..5d39e4c
--- /dev/null
@@ -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;
+}
index d30dc38d6373f9b043b5b8c8b6887ea4cf2c7f16..2fe4069c3c046796c9518d99cfd682d9cec2a926 100644 (file)
@@ -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);