Oh I had a fun one like this just this morning. I have (C++) code spanning back to the early 1990's, although some of it was written (as C) a decade before that. It relies on checking the floating point unit status register for a bunch of its error checking. Turns out that at some point, casts from floating point to integer types started being implemented (by the compiler) using the cvttss2si instruction. And when the floating point value is too large to be represented in the integer, the fpu flag is set to 'invalid'. Which (I assume, from how everything else was implemented) didn't used to happen with whatever instruction(s) were used before SSE. And in my code, this only happens very rarely (basically it needs a combination of rare, rare and very rare circumstances to happen - too tedious to explain, not that anyone cares) so I only got bitten by this this week - probably 15 years after this started happening? And yeah the case is technically undefined behaviour, not that I'm enough of a language lawyer to know. If it hadn't been for some kind soul on SO to point this out I wouldn't even have looked in this direction because the last time this combination happened, it worked (and yeah it turns out that that program where 'it works' was compiled 20 years ago...)
Ugh, just venting, but it helps to know that there are others out there suffering through this :)
Ugh, just venting, but it helps to know that there are others out there suffering through this :)