mips gcc -O1: Address exception error on store doubleword
Paul Brook
paul@codesourcery.com
Thu Aug 9 16:55:00 GMT 2007
On Thursday 09 August 2007, Alex Gonzalez wrote:
> Hi,
>
> I'll try to come up with a short test.
>
> I have narrowed it a bit more. The PVAR structure contains a long long
> variable ( with a sizeof 8 and an alignof 8 for my architecture). If I
> take out the long long variable, the compiler uses sdl instructions
> instead of sd and the exception doesn't happen.
>
> Also, if I do
>
> static void varcopy(void *pvar1, void *pvar2)
>
> the compiler uses sdl and avoids the crash.
>
> I am compiling for n32 ABI, so the register size is 64bits.
>
> Any ideas?
This is a bug in whatever calls varcopy. You told the complier that both were
pointers to 8-byte aligned structures. If you lied, then the compiler is
eintirely within its rights to generate code that explodes. You need to trace
the values back to find out where the misalignment is coming from.
Paul
More information about the Gcc
mailing list