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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:3f3932a0ec875cb7cca187018f3f8f05f2519d3e

commit r10-6602-g3f3932a0ec875cb7cca187018f3f8f05f2519d3e
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Feb 12 22:14:27 2020 +0100

    real: Fix roundeven on inf/nan [PR93663]

    As can be seen in the testcase, roundeven with inf or nan arguments
    ICE because of those asserts where nothing prevents from is_halfway_below
    being called with those arguments.

    The following patch fixes that by just returning false for rvc_inf/rvc_nan
    like it returns for rvc_zero, so that we handle roundeven with all those
    values as round.  Inf/NaN are not halfway in between two integers...

    2020-02-12  Jakub Jelinek  <ja...@redhat.com>

        PR middle-end/93663
        * real.c (is_even): Make static.  Function comment fix.
        (is_halfway_below): Make static, don't assert R is not inf/nan,
        instead return false for those.  Small formatting fixes.

        * gcc.dg/torture/builtin-round-roundeven.c (main): Add tests
        for DBL_MAX, inf, their negations and nan.

Reply via email to