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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:6d0a0c547a6c8425d432129fc90869305fef7bc2

commit r13-8853-g6d0a0c547a6c8425d432129fc90869305fef7bc2
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Jun 17 18:53:21 2024 +0200

    c++: Fix up floating point conversion rank comparison for _Float32 and
float if float/double are same size [PR115511]

    On AVR and SH with some options sizeof (float) == sizeof (double) and
    the 2 types have the same set of values.
    http://eel.is/c++draft/conv.rank#2.2 for this says that double still
    has bigger rank than float and http://eel.is/c++draft/conv.rank#2.2
    says that extended type with the same set of values as more than one
    standard floating point type shall have the same rank as double.
    I've implemented the latter rule as
       if (cnt > 1 && mv2 == long_double_type_node)
         return -2;
    with the _Float64/double/long double case having same mode case (various
    targets with -mlong-double-64) in mind.
    But never thought there are actually targets where float and double
    are the same, that needs handling too, if cnt > 1 (that is the extended
    type mv1 has same set of values as 2 or 3 of float/double/long double)
    and mv2 is float, we need to return 2, because mv1 in that case should
    have same rank as double and double has bigger rank than float.

    2024-06-17  Jakub Jelinek  <ja...@redhat.com>

            PR target/111343
            PR c++/115511
            * typeck.cc (cp_compare_floating_point_conversion_ranks): If an
            extended floating point type mv1 has same set of values as more
            than one standard floating point type and mv2 is float, return 2.

            * g++.dg/cpp23/ext-floating18.C: New test.

    (cherry picked from commit 8584c98f370cd91647c184ce58141508ca478a12)

Reply via email to