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: [RFA]: Merge stack alignment branch


Hi,
I will look in detail to the patch later this weekend.  I think it would
make sense to break up neccesary changes in generic bits to separate
patches (in -x -cp format).  This will ease reviewing process since I
for instance can't approve non-i386 specific bits of your patch.

Index: tree-inline.c
===================================================================
--- tree-inline.c	(.../trunk/gcc)	(revision 133813)
+++ tree-inline.c	(.../branches/stack/gcc)	(revision 133869)
@@ -2841,8 +2841,26 @@
 	cfun->unexpanded_var_list = tree_cons (NULL_TREE, var,
 					       cfun->unexpanded_var_list);
       else
-	cfun->unexpanded_var_list = tree_cons (NULL_TREE, remap_decl (var, id),
-					       cfun->unexpanded_var_list);
+	{
+	  /* Update stack alignment requirement if needed.  */
+	  if (MAX_VECTORIZE_STACK_ALIGNMENT)
+	    {
+	      unsigned int align;
+
+	      if (TREE_STATIC (var) || DECL_EXTERNAL (var))
+		align = TYPE_ALIGN (TREE_TYPE (var));
+	      else
+		align = DECL_ALIGN (var);
+	      if (align  > cfun->stack_alignment_estimated)
+		{
+		  gcc_assert(!cfun->stack_realign_processed);
+		  cfun->stack_alignment_estimated = align;
+		}
+	    }
+	  cfun->unexpanded_var_list
+	    = tree_cons (NULL_TREE, remap_decl (var, id),
+			 cfun->unexpanded_var_list);
+	}

I think it is mistake to maintain info about stack alignment during
gimple transformations.  At expansion time we walk the list and we can
figure out the alignment once possibly some of the variables are
optimized out.

The info can also go into RTL datastructures I am trying to introduce
instead of cfun then.

Honza


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