https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026
Christophe Lyon <clyon at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clyon at gcc dot gnu.org --- Comment #13 from Christophe Lyon <clyon at gcc dot gnu.org> --- (In reply to Wilco from comment #12) > It looks the only case left to do is f5: > > x * C <= 0.0 -> x <= 0.0 if C >= 1.0 > x * C <= 0.0 -> x < FLT_MIN/C if C < 1.0 Commit r266142 (from #c11) added this to match.pd: (for cmp (lt le gt ge) neg_cmp (gt ge lt le) /* Simplify (x * C1) cmp C2 -> x cmp (C2 / C1), where C1 != 0. */ (simplify (cmp (mult @0 REAL_CST@1) REAL_CST@2) (with { tree tem = const_binop (RDIV_EXPR, type, @2, @1); } (if (tem && !(REAL_VALUE_ISINF (TREE_REAL_CST (tem)) || (real_zerop (tem) && !real_zerop (@1)))) (switch (if (real_less (&dconst0, TREE_REAL_CST_PTR (@1))) (cmp @0 { tem; })) (if (real_less (TREE_REAL_CST_PTR (@1), &dconst0)) (neg_cmp @0 { tem; }))))))) Doesn't || (real_zerop (tem) && !real_zerop (@1)) prevent > x * C <= 0.0 -> x <= 0.0 if C >= 1.0 from happening?