https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86968
Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thopre01 at gcc dot gnu.org --- Comment #7 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> --- (In reply to Thomas Preud'homme from comment #6) > Happens at expand time. Diving in. There's a giant if in expand_expr_real_1 with the following comment: /* In cases where an aligned union has an unaligned object as a field, we might be extracting a BLKmode value from an integer-mode (e.g., SImode) object. Handle this case by doing the extract into an object as wide as the field (which we know to be the width of a basic mode), then storing into memory, and changing the mode to BLKmode. */ The "if" is entered in the big endian unaligned case but not in the other case. In the aligned case, it continues after the if until the call to flip_storage_order which will generate the bswap.