https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92716
--- Comment #1 from Julius Werner <jwerner at chromium dot org> --- edit: Just noticed that when I implement it as static inline unsigned int byteswap(unsigned int x) { return __builtin_bswap32(x); } instead, it is still compiled into the same single instruction, but then the inlining works even with -Os. So I guess the decision to inline is made too early in the optimization pipeline or something?