https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60540
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|sh*-*-* | --- Comment #12 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Rich Felker from comment #8) > This issue report is specific to target sh*-*-* I put that in the target field of the PR initially, but I also wrote in the description above that this looks like a target independent issue. So removing the target field now, to be clear. I don't think anybody should have to deal with that on any target in the backend. It should be handled by earlier stages of compilation, if at all. The prerequisite for this optimization is that the integer variable type can be represented by the floating point type of the comparison exactly. If that's the case, there should be no need to touch anything in fenv. If the floating point constant can't be represented exactly as specified by the code (e.g. comment #3 -- 16777216 becomes 16777217), would that still require setting the inexact flag in fenv? (I don't think so)