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

From: Nick Warne
Date: Sat Mar 27 2004 - 09:52:01 EST


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).

--
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/