https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99396
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 50303 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50303&action=edit gcc11-pr99396.patch This seems to work for me (almost, there is a useless and for uchar/ushort) on: #include <bit> unsigned char f1 (unsigned char x, int y) { return std::rotl (x, y); } unsigned char f2 (unsigned char x, int y) { return std::rotr (x, y); } unsigned short f3 (unsigned short x, int y) { return std::rotl (x, y); } unsigned short f4 (unsigned short x, int y) { return std::rotr (x, y); } unsigned int f5 (unsigned int x, int y) { return std::rotl (x, y); } unsigned int f6 (unsigned int x, int y) { return std::rotr (x, y); } unsigned long int f7 (unsigned long int x, int y) { return std::rotl (x, y); } unsigned long int f8 (unsigned long int x, int y) { return std::rotr (x, y); } unsigned long long int f9 (unsigned long long int x, int y) { return std::rotl (x, y); } unsigned long long int f10 (unsigned long long int x, int y) { return std::rotr (x, y); } //unsigned __int128 f11 (unsigned __int128 x, int y) { return std::rotl (x, y); } //unsigned __int128 f12 (unsigned __int128 x, int y) { return std::rotr (x, y); } constexpr auto a = std::rotl (1234U, 0); constexpr auto b = std::rotl (1234U, 5); constexpr auto c = std::rotl (1234U, -5); constexpr auto d = std::rotl (1234U, -__INT_MAX__ - 1);