Lähettäjä: Asko Kauppi <asko.kauppi@sci.fi>
Päiväys: 8. kesäkuuta 2005 11.32.02 GMT+03:00
Vastaanottaja: fink-devel@lists.sourceforge.net
Aihe: XCode 2.1 and -ffast-math
Has anyone else experienced this weird bug, occurring after upgrade
to the new XCode 2.1:
System:
OS X Tiger (10.4.1)
iMac G4 700MHz
XCode 2.1 (actually, using gcc from command line, but.. does it
matter)
If -ffast-math is given to gcc, it #defines floor[f] and ceil[f] to
__fastmath_floor[f] and so. These are inline functions that treat
-0.0 in a non-standard way. So what..
For me, in some places, floorf(0.7)==0.7 ! That's no use. Weird
thing is, that this is not consistent, some places work, others
don't. Possibly some variable assignment/code generation/whatever
weirdness?
Anyway, I did not have this (same code) before running XCode 2.1,
so clearly there's something wrong.
If some of you would have XCode 2.0, please send /usr/include/
architecture/ppc/math.h so I can compare them. It may be the
function hasn't changed, but gcc code generation has, though.
First aid: just stop using '-ffast-math' or #undef the macros it
defines. Regular libm functions will be used, and they work. :)
-ak