https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109386
Bug ID: 109386 Summary: [13 Regression] Frange value relation related miscompilation Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- I've totally missed a regression caused by my recent frange improvements (most likely r13-6967-g5fe05ffefd21c4fa): +FAIL: libphobos.phobos/std/math/algebraic.d execution test +FAIL: libphobos.phobos_shared/std/math/algebraic.d execution test Reduced testcase in C: static inline float foo (float x, float y) { float u = __builtin_fabsf (x); float v = __builtin_fabsf (y); if (!(u >= v)) { v = u; u = __builtin_fabsf (y); if (__builtin_isinf (u)) return u; if (__builtin_isinf (v)) return v; } return 42.0f; } int main () { if (!__builtin_isinf (foo (__builtin_inff (), __builtin_nanf ("")))) __builtin_abort (); } for -O2. I believe the bug is that (as discussed earlier) we don't implement the full set of VREL_* relations for the case where NAN may be seen and in this case register VREL_LT for the if block, which is wrong, the inverse of VREL_GE is VREL_UNLT which we don't currently have.