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



The following reply was made to PR lib/39465; it has been noted by GNATS.

From: Anthony Mallet <anthony.mallet%useless-ficus.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: lib-bug-people%netbsd.org@localhost,
    gnats-admin%netbsd.org@localhost,
    netbsd-bugs%netbsd.org@localhost
Subject: Re: lib/39465: threads stack is not aligned properly for gcc on i386
Date: Mon, 29 Aug 2011 11:18:47 +0200

 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