If you can't figure out how to turn off optimization for that function,
you might want to move just the comparison into a non inlined function
called from that point (passing pointers, not doubles, to that
function). In GCC, I'm not sure how to force inlining off, other than
by the extreme measure of placing the function you don't want inlined in
a different cpp file.
I expect the underlying problem is that GCC tracked the value of one of
the two things you're comparing and has that value still in an 80 bit
register left over from a previous store of that value. Then the 80 bit
value does not equal the 64 (or 32) bit value even if storing the 80
bit value would create a 64 bit value that is equal. A non inlined
routine would force it not to use the left over 80 bit value. I don't
know enough about GCC to know what else might force it not to use that.
Frédéric BOIS wrote:
pifn->bOn = (*pdTime < *pdTnext);