OSDN Git Service

PR tree-optimization/52285
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Feb 2012 22:20:27 +0000 (22:20 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Feb 2012 22:20:27 +0000 (22:20 +0000)
* tree-tailcall.c (find_tail_calls): Ignore gimple_clobber_p stmts
when deciding if a call is a tail call or tail recursion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184317 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-tailcall.c

index a75204c..c4790d2 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/52285
+       * tree-tailcall.c (find_tail_calls): Ignore gimple_clobber_p stmts
+       when deciding if a call is a tail call or tail recursion.
+
 2012-02-16  Kai Tietz  <ktietz@redhat.com>
 
        * config/i386/i386.c (legitimate_pic_address_disp_p): Allow
index 87fc566..02e1113 100644 (file)
@@ -1,5 +1,5 @@
 /* Tail call optimization on trees.
-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -400,9 +400,10 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
     {
       stmt = gsi_stmt (gsi);
 
-      /* Ignore labels, returns and debug stmts.  */
+      /* Ignore labels, returns, clobbers and debug stmts.  */
       if (gimple_code (stmt) == GIMPLE_LABEL
          || gimple_code (stmt) == GIMPLE_RETURN
+         || gimple_clobber_p (stmt)
          || is_gimple_debug (stmt))
        continue;
 
@@ -523,6 +524,9 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
       if (gimple_code (stmt) == GIMPLE_RETURN)
        break;
 
+      if (gimple_clobber_p (stmt))
+       continue;
+
       if (is_gimple_debug (stmt))
        continue;