[Numpy-discussion] strict aliasing?

Charles R Harris charlesr.harris@gmail....
Sun May 4 11:25:46 CDT 2008


On Sun, May 4, 2008 at 3:11 AM, Neal Becker <ndbecker2@gmail.com> wrote:

> Is it safe to compile numpy with gcc 'strict aliasing'?
>

No!  And depending on the compiler version you might find whole bits of code
disappearing during optimization without warning, yielding fantastic
benchmarks but questionable results. The linux kernel won't compile
correctly with that flag either, and it has been a longstanding cause of
contention with gnu that it is the default. If you search the mailing lists
you can find Linus making some nasty comments about it.

As far as I can tell, strict aliasing assumes that pointers are only cast
between types of the same length. This is a problem in code that casts
pointers with abandon between all types.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080504/1d4a38f1/attachment.html 


More information about the Numpy-discussion mailing list