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

--- Comment #10 from GCC 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:b7960a3f966a0f87888de0fc588999d026918449

commit r16-1108-gb7960a3f966a0f87888de0fc588999d026918449
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Jun 4 17:21:51 2025 +0200

    ranger: Add support for float <-> float casts [PR120231]

    I've noticed we don't even support say float -> double and other
    scalar floating point to scalar floating point conversions in the
    ranger, we just end up with VARYING for those.

    The following patch attempts to fix that.
    The reverse cast case uses float_binary_op_range_finish e.g. because
    if the result isn't infinite, then the source couldn't be infinite
    either even if the reverse fold_range would suggest that.
    And special cases the case of guaranteed widening cast (where
    we have assurance that all the source type values are exactly
    representable in the destination type; using ieee_bits for that).

    2025-06-04  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/120231
            * range-op-mixed.h (operator_cast::fold_range): Add overload
            with 3 {,const} frange & operands.  Change parameter names and
            add final override keywords for float <-> integer cast overloads.
            (operator_cast::op1_range): Likewise.
            * range-op-float.cc (operator_cast::fold_range): New overload
            with 3 {,const} frange & operands.
            (operator_cast::op1_range): Likewise.

            * gcc.dg/tree-ssa/pr120231-1.c: New test.

Reply via email to