re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted...
authorRichard Guenther <rguenther@suse.de>
Fri, 23 Apr 2010 15:46:23 +0000 (15:46 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 23 Apr 2010 15:46:23 +0000 (15:46 +0000)
2010-04-23  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/43572
* tree-tailcall.c (find_tail_calls): Allow PARM_DECL uses.

From-SVN: r158671

gcc/ChangeLog
gcc/tree-tailcall.c

index 586f1e6..c7eecfb 100644 (file)
@@ -1,5 +1,10 @@
 2010-04-23  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/43572
+       * tree-tailcall.c (find_tail_calls): Allow PARM_DECL uses.
+
+2010-04-23  Richard Guenther  <rguenther@suse.de>
+
        PR lto/43455
        * tree-inline.c (tree_can_inline_p): Also check compatibility
        of return types.
index 4d2422a..a9f0191 100644 (file)
@@ -458,7 +458,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
      to local variables.  */
   FOR_EACH_REFERENCED_VAR (var, rvi)
     {
-      if (!is_global_var (var)
+      if (TREE_CODE (var) != PARM_DECL
+         && auto_var_in_fn_p (var, cfun->decl)
          && ref_maybe_used_by_stmt_p (call, var))
        return;
     }