aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-02-16 23:20:27 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-02-16 23:20:27 +0100
commitca786352c5961c44a5aac91a47cb5a5d154c7be2 (patch)
tree51d84de4276e6871cb16c3e6a7750115741287fa /gcc/tree-tailcall.c
parent60a3da27fef24089ae0b77cc2a006c46419882a5 (diff)
downloadgcc-ca786352c5961c44a5aac91a47cb5a5d154c7be2.zip
gcc-ca786352c5961c44a5aac91a47cb5a5d154c7be2.tar.gz
gcc-ca786352c5961c44a5aac91a47cb5a5d154c7be2.tar.bz2
re PR middle-end/52285 (libgcrypt _gcry_burn_stack slowdown)
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. From-SVN: r184317
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 87fc566..02e1113 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -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;