Re: Problem with optimization setting -O3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oliver Schneider <oliver@xxxxxxxxxx> writes:

> Here the macros. As I mentioned before, the behavior differs between
> little and big Endian platforms. x64 is a little Endian platform, though.
>
> /* Little Endian */
> #define LEND32(X) (uint32_t)(X)
> #define PUT32(X,Y) (*(uint32_t*)(X)) = LEND32(Y)
> #define GET32(X) (*(uint32_t*)(X))

That is indeed an aliasing violation.  However, since you are using
-fno-strict-aliasing I guess that is not the problem in itself.  From
your earlier description, gcc is somehow deciding that the alignment
is greater than it really is.  I don't know what would cause that.  My
guess would some combination of inlining with the type casting in the
macros.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux