This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Build problems on Solaris 2.5.1


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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]