This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Build problems on Solaris 2.5.1
- To: rearnsha at arm dot com
- Subject: Re: Build problems on Solaris 2.5.1
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 10 Nov 2000 10:46:16 -0800
- CC: gcc-bugs at gcc dot gnu dot org
- References: <200011101350.NAA21813@cam-mail2.cambridge.arm.com>
Richard Earnshaw <rearnsha@arm.com> writes:
> ptr = ((struct constant_descriptor *)
> xcalloc (1,
> (sizeof (struct constant_descriptor)
> + sizeof (struct rtx_const) - 1)));
> decode_rtx_const (mode, x, (struct rtx_const *) ptr->contents);
>
> Now the native compiler is optimizing the memset into two "std"
> instructions. Unfortunately, the pointer is only word aligned, not dword
> aligned, so the std instruction is generating a bus error.
>
> Now it looks to me that the code in record_constant_rtx is doing the dodgy
> thing (since after all, it is messing around with casts), but I could be
> wrong.
You are correct, this code is wrong.
> Is it reasonable to expect struct rtx_const to be dword aligned on
> a sparc?
Yes. It contains a 'union real_extract' as one of its members, which
itself contains a double, so the whole thing has to be dword aligned.
--
- Geoffrey Keating <geoffk@geoffk.org>