https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
Jonathan Wakely changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
--- Comment #7 from Marc Glisse ---
PR94589 then.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
--- Comment #6 from Jonathan Wakely ---
So it's just bad codegen for <=> comparisons. Thanks, Barry.
The library part is a red herring, the operator> synthesized from <=> is fine
to use, it just produces bad code (with GCC, but not Clang).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
--- Comment #5 from Barry Revzin ---
Sorry meant to actually copy the reduction:
#include
bool compare_count(int a, int b)
{
return a > b;
}
bool compare(int a, int b)
{
return (a <=> b) > 0;
}
which generates:
compare_count(int,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
Barry Revzin changed:
What|Removed |Added
CC||barry.revzin at gmail dot com
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
--- Comment #3 from Jonathan Wakely ---
(In reply to Jonathan Wakely from comment #2)
> If you write it like this you get good codegen:
I think I messed up my testing, and it doesn't help. GCC always chooses the
synthesized operator> instead
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322
--- Comment #1 from Jonathan Wakely ---
Maybe related to either PR 94006 or PR 94566