[Bug tree-optimization/91734] gcc skip an if statement with "-O1 -ffast-math"

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Oct 5 07:36:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91734

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Oct  5 07:36:09 2019
New Revision: 276621

URL: https://gcc.gnu.org/viewcvs?rev=276621&root=gcc&view=rev
Log:
        PR tree-optimization/91734
        * generic-match-head.c: Include fold-const-call.h.
        * match.pd (sqrt(x) cmp c): Check the boundary value and
        in case inexact computation of c*c affects comparison of the boundary,
        turn LT_EXPR into LE_EXPR, GE_EXPR into GT_EXPR, LE_EXPR into LT_EXPR
        or GT_EXPR into GE_EXPR.  Punt for sqrt comparisons against NaN and
        for -frounding-math.  For c2, try the next smaller or larger floating
        point constant depending on comparison code and if it has the same
        sqrt as c2, use it instead of c2.

        * gcc.dg/pr91734.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr91734.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/generic-match-head.c
    trunk/gcc/match.pd
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list