Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2003 23:45:43 +0100 (MET)
From:      Adriaan de Groot <adridg@cs.kun.nl>
To:        freebsd-amd64@freebsd.org
Subject:   Re: Varargs issues
Message-ID:  <Pine.GSO.4.44.0312012331250.24115-100000@odin.cs.kun.nl>
In-Reply-To: <200312012208.hB1M8V1O064328@bigtex.jrv.org>

next in thread | previous in thread | raw e-mail | index | archive | help
'avond, James,

On Mon, 1 Dec 2003, James Van Artsdalen wrote:
> I don't have my Opteron hardware yet but I did build a gcc
> cross-compiler to look at your earlier bug report.

Ah, thanks.

> point values passed in registers as opposed to on the stack.
> The function prologue writes those registers to stack slots so
> var_args can refer to them later.

OK, that's pretty sure to be it. You can see in the disassembly in the PR
that it _is_ a movaps instruction causing the bus error.

> The trick is that gcc 3.3 doesn't seem to try to keep the stack
> aligned to 16-bytes, so on entry to a function the stack may be 8-byte
> aligned, 16-byte aligned, etc.  If the AMD book is not out-of-date
> then a fault is bound to happen on MOVAPS at some point.

The $rbp and $rsp are both 8-aligned when it bus errors. In the main
thread, the stack is 16-aligned at every call to PrintF (I'm working with
the third example program, maybe I should attach iot somewhere).

I'll get the hard numbers for you in a minute, next message.

-- 
 Adriaan de Groot    adridg@cs.kun.nl     Kamer A6020     024-3652272
GPG Key Fingerprint 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE
               http://www.cs.kun.nl/~adridg/research/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.44.0312012331250.24115-100000>