re PR tree-optimization/15108 ([tree-ssa] [regression] missed sib-calling for pointer...
authorRichard Henderson <rth@redhat.com>
Wed, 9 Jun 2004 23:48:56 +0000 (16:48 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 9 Jun 2004 23:48:56 +0000 (16:48 -0700)
        PR opt/15108
        * tree-tailcall.c (find_tail_calls): Don't check early for
        tail_recursion failure.

From-SVN: r82866

gcc/ChangeLog
gcc/tree-tailcall.c

index 637a9bfa24fa51baa605ff45d1db58fcf9606a42..4eda0b17d6e30839710599078f1cc81f532eb61f 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-09  Richard Henderson  <rth@redhat.com>
+
+       PR opt/15108
+       * tree-tailcall.c (find_tail_calls): Don't check early for
+       tail_recursion failure.
+
 2004-06-09  Diego Novillo  <dnovillo@redhat.com>
 
        Move SSA_NAME annotations into tree_ssa_name.
index 5027c2b6f414cbf655ee0e2e749e7d461a3afcf5..47d707682b3edabeb87a9140c9d3ded7d0021173 100644 (file)
@@ -460,11 +460,6 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
       if (TREE_CODE (stmt) != MODIFY_EXPR)
        return;
 
-      /* Unless this is a tail recursive call, we cannot do anything with
-        the statement anyway.  */
-      if (!tail_recursion)
-       return;
-
       if (!process_assignment (stmt, stmt, bsi, &m, &a, &ass_var))
        return;
     }
@@ -491,6 +486,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
       && (ret_var != ass_var))
     return;
 
+  /* If this is not a tail recursive call, we cannot handle addends or
+     multiplicands.  */
+  if (!tail_recursion && (m || a))
+    return;
+
   nw = xmalloc (sizeof (struct tailcall));
 
   nw->call_block = bb;