This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: x86 _Decimal128 return value alignment
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: joseph at codesourcery dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 23 Sep 2011 10:10:45 +0200 (CEST)
- Subject: Re: x86 _Decimal128 return value alignment
- References: <Pine.LNX.4.64.1109222246110.1198@digraph.polyomino.org.uk>
> Date: Thu, 22 Sep 2011 22:48:57 +0000 (UTC)
> From: "Joseph S. Myers" <joseph@codesourcery.com>
>
> On 32-bit x86, _Decimal128 function return values are stored in a
> location whose address is passed as a hidden parameter. This location
> must be 16-byte aligned. Although GDB knows about 16-byte alignment
> for parameters, it fails to achieve this for this stack slot,
> resulting in problems if, for example, the function called from GDB
> with a _Decimal128 return value uses an SSE store instruction to
> store the return value.
>
> This patch fixes this with an appropriate frame_align function, since
> that's the setting used to control alignment of return value slots.
> Tested on i686-pc-linux-gnu. OK to commit?
Interesting how the ultimate unaligned architecture is slowly turning
into a "strict alignment" architecture.
Anyway, there is no harm in this besides wasting a few bytes on
systems without _Decimal128 support, so sure, go ahead.
> 2011-09-22 Joseph Myers <joseph@codesourcery.com>
>
> * i386-tdep.c (i386_frame_align): New.
> (i386_gdbarch_init): Use i386_frame_align.