FYI, exactly zero of the cases this sanitizer flagged as undefined behaviour in #29527 (moved) are actually undefined behaviour. Of the ~50 reports, only two of them are potentially evidence of problems, but since the tests pass with no floating-point invalid-operation exceptions I suspect they might not be problems either.
Seems plausible, but could I ask your opinion on the rest of that thread, where people are arguing about what's undefined and what isn't?
There are four main points here:
C99 technically does say of the / operator that 'if the value of the second operand is zero, the behavior is undefined' (C99, Sec. 6.5.5 Multiplicative operators, clause 5, p. 82).
Annex F specifies that all the arithmetic operations on floating-point types have IEEE 754 semantics: 'The +, -, *, and / operators provide the IEC 60559 [another name for IEEE 754, along with ISO/IEC 559] add, subtract, multiply, and divide operations.' (C99, Annex F, F.3 Operators and functions, p. 445)
Strictly speaking, Annex F is optional. Strictly speaking, there may be bugs in the IEEE 754 conformance of clang or gcc. Strictly speaking, not everything is up to the compiler, so if you used clang or gcc but linked against a broken libm that didn't provide IEEE 754 semantics, it might be technically wrong for clang or gcc to advertise IEEE 754 semantics (a.k.a. Annex F support, indicated by the definition of the __STDC_IEC_559__ macro).
Nobody except a disingenuous language lawyer trolling for a point would seriously choose to wittingly make clang or gcc deviate in any substantial way from IEEE 754 semantics.
Essentially the entire body of numerical software on the planet of the past quarter century, outside now-obscure platforms like legacy IBM mainframes or VAXen, has been designed under the premise of IEEE 754 semantics.
Even clang UB optimization attorneys, who might delete null pointer checks if they can be proven to follow undefined behaviour in the absence of -fno-delete-null-pointer-checks, don't seem to be inclined to take advantage of the potential room for disagreement between C99 6.5.5 and Annex F. Where clang deviates from IEEE 754 semantics, it's because of a lack of devpower to go through IEEE 754 and clang with a fine-toothed comb to catch all the corner cases (e.g., optimization bugs in nondefault rounding modes), not because they intend to exploit it.
For an illustrative example of the value of IEEE 754 semantics, see the dozens of cases in #29527 (moved) that could have gone wrong if we didn't have IEEE 754 divide-by-zero semantics, but that do exactly the right thing even though I wasn't thinking about those cases when I wrote the code (until I wrote the test cases, and again later when I reviewed all the false positives). Failure to support IEEE 754 semantics, particularly extremely basic parts like consistently giving infinities for division by zero, would likely be blamed for [mistakes].
I tried to use all the current and legacy command-line arguments. I expect that the compilers will do something sensible if multiple arguments work: all we really need is the failure.