Build problems on Solaris 2.5.1
Geoff Keating
geoffk@geoffk.org
Fri Nov 10 10:46:00 GMT 2000
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>
More information about the Gcc-bugs
mailing list