I'd expect much more thorough testcases here, both for cases that get optimized and cases that don't. You're only testing comparisons with zero. There should be comparisons with other values, both integer and noninteger, both within the range for which optimizing would be valid and outside it, both inside the range of the integer type and outside it. (To the extent that you don't optimize some cases that would be valid to optimize as discussed in that PR, XFAILed tests, or deferring adding tests, would be reasonable. But each case identified in that PR as not valid to optimize, or only valid to optimize with -fno-trapping-math, should have corresponding tests that it's not optimized.)
Since SCALAR_FLOAT_TYPE_P includes decimal floating-point types, tests with those are desirable as well (in gcc.dg/dfp or c-c++-common/dfp, I suppose). -- Joseph S. Myers jos...@codesourcery.com