This is the mail archive of the 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: RFC: __attribute__ ((forced_stack_boundary))

On Tue, Dec 21, 2004 at 08:34:33AM +0100, Uros Bizjak wrote:
> In above example, the only change would be the addition of one line:
> void * f(void *p) __attribute__ ((forced_stack_boundary));

Not true.  The frame for F itself is still unaligned.  Just that
the frame for all further functions would be aligned.  So the
transformation would have to be 

	static void * __attribute__((noinline)) f_prime (void *p)
	  /* old code from f */

	void * __attribute__ ((forced_stack_boundary)) f (void *p)
	  return f_prime (p);

> The code works as expected with Intel's compiler (build 7.1.011), I guess 
> it uses the same libpthread as gcc does. 

No, ICC knows how to *really* force the *current* function's stack frame
to be aligned.  Which puts a variable space between the top of the stack
frame and the return address and arguments.

We tried to implement this once at Cygnus.  IIRC we kinda sorta got it
working, but it was truely ugly.

There are several ways that we *could* approach this, but all of them
are inferior to installing a fixed thread library.


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