This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Ignore gimple_clobber_p stmts in tail[cr] passes (PR tree-optimization/52285)


Hi!

We should IMHO ignore the clobber stmts when deciding if we can tail
call optimize or tail recurse.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

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.

--- gcc/tree-tailcall.c.jj	2011-06-17 11:02:19.000000000 +0200
+++ gcc/tree-tailcall.c	2012-02-16 19:33:49.468926680 +0100
@@ -400,9 +400,10 @@ find_tail_calls (basic_block bb, struct
     {
       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
       if (gimple_code (stmt) == GIMPLE_RETURN)
 	break;
 
+      if (gimple_clobber_p (stmt))
+	continue;
+
       if (is_gimple_debug (stmt))
 	continue;
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]