Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Stack alignment with pthreads



On Friday, at 15:00, Martin Husemann wrote:
| Maybe a better solution would be to add the lid-dependend jitter before
| makecontext() already, and leave everything starting with the trampoline
| alone and to gcc.

Well, I did some new tests, with not much success ...

- compiling my test program + some bits of libpthread + makecontext with
gcc-4.2.3 didn't change anything. The generated code is the same, and the
aligned(16) variables are still not aligned in the threads.

- changing the alloca() amount in pthread__create_tramp() didn't change
anything (as expected: libc+gcc round up the current stack pointer anyway).

- The only thing that had some effect was to artificially substract 4 bytes
from the sp in makecontext, just before 'pushing' the args. (i.e. replaced
 ``sp -= argc + 1'' by ``sp -= argc + 2'' in arch/i386/gen/makecontext.c). Then
the aligned(16) variables where properly aligned (tested on a P4 and a core
quad machine). But I have no  idea why it should be so and this change doesn't
make any sense to me.

-- 
Anthony


Home | Main Index | Thread Index | Old Index