http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55177
--- Comment #3 from David Woodhouse <dwmw2 at infradead dot org> 2012-11-02 17:05:03 UTC --- The first example isn't *that* dumb, as a cut-down test case of real code which may look more complex in reality. If the real code really *is* as simple as my test case, you're right that perhaps we *could* optimise it ourselves by eschewing the normal accessor macros for explicit-endian values, and manually byteswapping the constant instead. But really, we shouldn't *have* to. The compiler can see what's happening, and it can deal with it a whole lot better than we can, especially when it comes to loads and stores. Your argument applies just as well to the second test case. I could just byteswap the constant instead of the variable. But still I shouldn't have to.