NetBSD-Bugs archive

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

Re: lib/39465: threads stack is not aligned properly for gcc on i386



On Sunday, at 20:15, David Holland wrote:
|  AIUI something like this patch should be committed. Although:
|  
|   : -       sp -= argc + 1;                 /* Make room for ret and args. */
|   : +       sp -= argc;                     /* Make room for ret and args. */
|   : +       sp  = (unsigned int *)((uintptr_t)sp & ~0xf);
|   : +       sp --;                  /* Make room for ret and args. */
|  
|  Separating out an extra "sp--" seems bogus

I do not remember all the details, but IIRC separating sp-- was the way to get
it right (i.e. have the test program pass). I agree that this seemed/seems
bogus to me as well... Couldn't it be because gcc assumes that the first
variable on the stack is aligned on 16 bytes, handling the ret address
differently?


Home | Main Index | Thread Index | Old Index