https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328
--- Comment #5 from Boris ---
full code:
https://godbolt.org/z/zjNqYV
template
auto reverse(T num) {
// misses optimization when num is int32_t OK for int64_t
auto* bytes = reinterpret_cast(&num);
// misses optimization for both 3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328
Boris changed:
What|Removed |Added
CC||boris_oncev at hotmail dot com
--- Comment #4 fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328
--- Comment #3 from Paco Arjonilla ---
But this gets optimized indeed!
#include
using type = std::uint32_t;
type foo(type v){
type r = ((v << 24) & 0xFF00)
| ((v << 8) & 0x00FF)
| ((v >> 8) & 0xFF00)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328
Paco Arjonilla changed:
What|Removed |Added
CC||pacoarjonilla at yahoo dot es
--- Comme
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93328
Richard Biener changed:
What|Removed |Added
Keywords||missed-optimization
Status|