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


Jan,

As to your comments:
+  if (MAX_VECTORIZE_STACK_ALIGNMENT)
+    {
+      if (cfun->stack_alignment_estimated < alignment_in_bits)
+	{
+          if (!cfun->stack_realign_processed)
+            cfun->stack_alignment_estimated = alignment_in_bits;
+          else
+	    {
+	      gcc_assert (!cfun->stack_realign_finalized);
+	      if (!cfun->stack_realign_needed)
+		{
+		  /* It is OK to reduce the alignment as long as the
+		     requested size is 0 or the estimated stack
+		     alignment >= mode alignment.  */

> So basically the purpose of stack_alignment_estimated is to avoid
> wasting stack frame space by padding when LOCAL_ALIGNMENT request
> alignment greater than STACK_BOUNDARY and we believe that the function
> won't need the DRAP code?
stack_alignment_estimated is to estimate conservatively the stack
alignment requirement based on the knowledge we have before reload. We
may make mistake by underestimate the requirement, which we'd treat as
assertion failure.

Basically this piece of code is saying: if I'm called before reload,
just update my estimation; if I'm called in/after reload and the
alignment is bigger than what I estimated and the stack realignment
decision was made incorrectly, crash.

> The comment should probably mention why we ever request size of 0.  I
> don't know at least ;) 
Neither do I. HJ, can you help to answer?

Thanks - Joey

-----Original Message-----
From: Jan Hubicka [mailto:hubicka@ucw.cz] 
Sent: Friday, April 11, 2008 6:04 PM
To: Ye, Joey
Cc: GCC Patches; Lu, Hongjiu; Guo, Xuepeng; ubizjak@gmail.com
Subject: Re: [RFA]: Merge stack alignment branch


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