I think that the following may explain why your gcc is producing code that doesn't work. The code in ieee_init may be violating strict aliasing rules and unless code is compiled with -fno-strict-aliasing the results may be undefined. See http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html Apologies in advance if you already know about this and it is not relevant. They suggest using a union, which although is not technically allowed seems to work with all major compilers.