[Bug c++/115511] ICE on ambigous overload for _Float32

2024-08-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Jakub Jelinek  ---
Fixed for 13.3+/14.2+/15.1+.

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-08-16 Thread dv at vollmann dot ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #9 from dv at vollmann dot ch ---
Just asking: is there anything that's required from my side to close this as
fixed?

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #8 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
:

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

commit r13-8853-g6d0a0c547a6c8425d432129fc90869305fef7bc2
Author: Jakub Jelinek 
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  

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)

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #7 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:5be6d9d2a9854c05f3c019deb9fe95eca7248140

commit r14-10321-g5be6d9d2a9854c05f3c019deb9fe95eca7248140
Author: Jakub Jelinek 
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  

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)

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:8584c98f370cd91647c184ce58141508ca478a12

commit r15-1380-g8584c98f370cd91647c184ce58141508ca478a12
Author: Jakub Jelinek 
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  

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.

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-17 Thread dv at vollmann dot ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #5 from dv at vollmann dot ch ---
On 6/17/24 10:47, jakub at gcc dot gnu.org wrote:

> --- Comment #4 from Jakub Jelinek  ---
> Untested fix below.

I did a quick test for AVR and it worked :-)
I'll now do a full build of libstdc++ and see how it works.\

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
Untested fix below.  I wasn't aware any targets would actually have float the
same as double.  C++23 says here:
http://eel.is/c++draft/conv.rank#2.2 that double has higher rank than float
http://eel.is/c++draft/conv.rank#2.5 and that extended type with same set of
values as 2+ standard types has same rank as double.  As I've only thought
about the double same as long double case, I've only handled that case there.
No testcase for testsuite, as this needs to be tested in avr/sh specific
g++.target only and needs proper options/effective target macros to find out if
that is really the float same as double configuration.  Will defer testcases to
the respective target maintainers.

2024-06-17  Jakub Jelinek  

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.

--- gcc/cp/typeck.cc.jj 2024-06-04 13:19:03.755604346 +0200
+++ gcc/cp/typeck.cc2024-06-17 10:32:02.063088961 +0200
@@ -393,6 +393,9 @@ cp_compare_floating_point_conversion_ran
  has higher rank.  */
   if (cnt > 1 && mv2 == long_double_type_node)
 return -2;
+  /* And similarly if t2 is float, t2 has lower rank.  */
+  if (cnt > 1 && mv2 == float_type_node)
+return 2;
   /* Otherwise, they have equal rank, but extended types
  (other than std::bfloat16_t) have higher subrank.
  std::bfloat16_t shouldn't have equal rank to any standard

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #3 from Andrew Pinski  ---
(In reply to dv from comment #2)
> 
> It looks like my report is a duplicate of 111343.

That was the one which I was thinking of too :). I will clean up the recording
of this tomorrow. one for the C++ ICE and one maybe for the libstdc++.

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-16 Thread dv at vollmann dot ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

--- Comment #2 from dv at vollmann dot ch ---
On 6/16/24 16:18, pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511
> 
> Andrew Pinski  changed:
> 
> What|Removed |Added
> 
> Last reconfirmed||2024-06-16
>   Status|UNCONFIRMED |NEW
>   Ever confirmed|0   |1
> 
> --- Comment #1 from Andrew Pinski  ---
> Confirmed. I thought I had saw this before but I can't seem to find the bug
> report.

I searched again, and found this one:


It looks like my report is a duplicate of 111343.

   Detlef

[Bug c++/115511] ICE on ambigous overload for _Float32

2024-06-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115511

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-06-16
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Confirmed. I thought I had saw this before but I can't seem to find the bug
report.