Skip to contentSkip to conversation

Somewhat OT: gcc, x86, -ffast-math, and Linux

DISCUSSION Nick Warne 1 participant 1 message Mar 27, 2004

lore
Share & tools
lore

Nick Warne

author
#0 lore raw

I had very funny results building a Quake2 MOD I am coder on (Quake2 dday).

Using -ffast-math made the HMG (e.g.) fire off aim by say 25º. Do a recompile with NO code change, and the HMG would be OK... but then the pistol starting firing all over the show. Do another rebuild (NO code change) and then the rifle showed this... etc. etc.

Every new build produced a different result, although the code was untouched.

I had to build leaving `--fast-math' option out in the end to get it to work correctly.

Maybe bad coding here, but what I didn't understand was why the result was so random (like each weapon has it's own code - so why one routine worked then after a rebuild didn't and vice versa, I don't know).

Nick
(Not subscribed to list).

Signature · 2 lines
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."