[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: David Holland <dholland-bugs%netbsd.org@localhost>
Subject: Re: lib/39465: threads stack is not aligned properly for gcc on i386
Date: Sun, 28 Aug 2011 20:12:28 +0000
On Sun, Aug 28, 2011 at 07:45:02AM +0000, Matthew Mondor wrote:
> I ran the test and this still occurs on recent netbsd-5. I cannot test
> it on -current, though. The fix appears simple, harmless and might
> enhance performance.
The code in -current doesn't appear to be different.
> Perhaps that this would also fix warnings sent by ffmpeg about it
> possibly being slow because the stacks aren't aligned optimally...
As I recall there's an issue about sse/mmx requiring this stack
alignment and there was a lengthy discussion about it somewhere, but I
forget the details.
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, and that should be
(unsigned int *)((uintptr_t)sp & ~(uintptr_t)0xf);
particularly if the code is going to get shared with or pasted into
the amd64 version.
David A. Holland
Main Index |
Thread Index |