Alignment issue on x86_64?
Andrew Haley
aph@redhat.com
Mon Jun 23 18:09:00 GMT 2008
Rémi Cardona wrote:
> Andrew Haley a écrit :
>> Are you using optimization?
>
> No, I'm building with those CFLAGS : -g -ggdb -Wall -save-temps
> -fno-strict-aliasing
>
>> I think can see at least one bug in this function.
>>
>> ((CARD32 *)data)[i] = ((long *)retval)[i];
>
> You're absolutely right, CARD32 is defined as an "unsigned long" on x86
> but as an "unsigned int" on x86_64. Changing this does not however
> change anything in how the Xlib call done just before behaves.
>
>> Try compiling with -fno-strict-aliasing.
>
> Doesn't change anything. No additional warnings nor any change in behavior.
Then this is probably a bug in gcc. I'd debug it a bit more
then start working on a cut-down test case.
Andrew.
More information about the Gcc-help
mailing list