This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA]: Merge stack alignment branch
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: "Ye, Joey" <joey dot ye at intel dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, "Lu, Hongjiu" <hongjiu dot lu at intel dot com>, "Guo, Xuepeng" <xuepeng dot guo at intel dot com>, ubizjak at gmail dot com
- Date: Fri, 4 Apr 2008 20:39:27 +0200
- Subject: Re: [RFA]: Merge stack alignment branch
- References: <BB577BF501703042AD7E08EADD8E514FF5DBF0@pdsmsx415.ccr.corp.intel.com>
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