https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93934
--- Comment #25 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to jos...@codesourcery.com from comment #24) > This is a fundamentally different test, because it involves (in the > abstract machine) lvalue-to-rvalue conversion of a sNaN representation. > That means that, unlike the present bug, and the two others I referenced, > (a) it's only valid with -fsignaling-nans, (b) it's at most a > quality-of-implementation issue because of the rule that assignment to the > same format may be a convertFormat operation rather a copy operation, and > (c) the ABI means the exception can't be avoided when an sNaN is returned. > Effectively, this test is bug 56831, whereas the present bug is more like > bug 58416 and bug 71460. I would like to point out (in the context of trapping behavior of x87) that I don't think we should disable FP conditional moves with the patch in Comment #18 to fix the presented corner case, as this will effect the runtime performance of the vast majority of applications that don't care about traps. Looking at the above referred bugs, it is IMO time to throw in the towel and declare x87 math as kind-of-broken w.r.t trapping. The compiler will generate code that speculatively loads values at various places (as shown by the testcase in Comment #20), not only at the FCMOV site. I'm not a language lawyer, but IMO access to a non-volatile object is not forbidden *if the value is not used*. Unfortunately, some accesses have secondary effects that are not considered by the compiler, and the trapping behavior of FLDS/FLDL is certainly one of them.