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] Clear DECL_GIMPLE_REG_P when making parameter copy addressable (PR tree-optimization/50735)


Hi!

gimplify_parameters uses create_tmp_reg, but sometimes it decides to make
it addressable (if the PARM_DECL is addressable).  If so, it must not be
DECL_GIMPLE_REG_P.

Alternatively we could call create_tmp_reg only if !TREE_ADDRESSABLE and
call create_tmp_var instead for TREE_ADDRESSABLE (+ set TREE_ADDRESSABLE).

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

2011-10-16  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/50735
	* function.c (gimplify_parameters): When making local TREE_ADDRESSABLE,
	also clear DECL_GIMPLE_REG_P.

--- gcc/function.c.jj	2011-10-14 08:21:56.000000000 +0200
+++ gcc/function.c	2011-10-15 12:43:23.000000000 +0200
@@ -3624,7 +3624,10 @@ gimplify_parameters (void)
 		     not the PARMs.  Keep the parms address taken
 		     as we'll query that flag during gimplification.  */
 		  if (TREE_ADDRESSABLE (parm))
-		    TREE_ADDRESSABLE (local) = 1;
+		    {
+		      TREE_ADDRESSABLE (local) = 1;
+		      DECL_GIMPLE_REG_P (local) = 0;
+		    }
 		}
 	      else
 		{

	Jakub


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