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]

Re: [PATCH] Clear DECL_GIMPLE_REG_P when making parameter copy addressable (PR tree-optimization/50735)


On Mon, Oct 17, 2011 at 08:49:34AM +0200, Richard Guenther wrote:
> On Sun, Oct 16, 2011 at 5:47 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> I think this should be exactly the other way around, using create_tmp_var,
> copying TREE_ADDRESSABLE and setting DECL_GIMPLE_REG_P if it is not addressable.
> 
> Ok with that change.

Here is what I've committed after bootstrap/regtest on x86_64-linux and
i686-linux:

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

	PR tree-optimization/50735
	* function.c (gimplify_parameters): Use create_tmp_var instead of
	create_tmp_reg.  If parm is not TREE_ADDRESSABLE and type is complex
	or vector type, set DECL_GIMPLE_REG_P.

--- gcc/function.c.jj	2011-10-17 09:20:38.000000000 +0200
+++ gcc/function.c	2011-10-18 13:54:02.000000000 +0200
@@ -3617,7 +3617,7 @@ gimplify_parameters (void)
 		       && compare_tree_int (DECL_SIZE_UNIT (parm),
 					    STACK_CHECK_MAX_VAR_SIZE) > 0))
 		{
-		  local = create_tmp_reg (type, get_name (parm));
+		  local = create_tmp_var (type, get_name (parm));
 		  DECL_IGNORED_P (local) = 0;
 		  /* If PARM was addressable, move that flag over
 		     to the local copy, as its address will be taken,
@@ -3625,6 +3625,9 @@ gimplify_parameters (void)
 		     as we'll query that flag during gimplification.  */
 		  if (TREE_ADDRESSABLE (parm))
 		    TREE_ADDRESSABLE (local) = 1;
+		  else if (TREE_CODE (type) == COMPLEX_TYPE
+			   || TREE_CODE (type) == VECTOR_TYPE)
+		    DECL_GIMPLE_REG_P (local) = 1;
 		}
 	      else
 		{

	Jakub


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