This is the mail archive of the
mailing list for the GCC project.
Re: RFC: __attribute__ ((forced_stack_boundary))
- From: Richard Henderson <rth at redhat dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 21 Dec 2004 04:35:30 -0800
- Subject: Re: RFC: __attribute__ ((forced_stack_boundary))
- References: <41C7D209.firstname.lastname@example.org>
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.