https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53712
--- Comment #11 from Marco Leise <Marco.Leise at gmx dot de> --- (In reply to Andrew Pinski from comment #10) > (In reply to Marco Leise from comment #9) > > If this was fixed three years ago, then how does the same test program > > produce this assembly with gcc 5.2.0 (and earlier)? > > Because the test program in comment #0 is invalid. What was allowed instead > is using an unaligned load and then using the other intrinsic and that is > what the bug changed into. It is a bold statement that the program is invalid. It correctly passes a memory reference right into a SSE4.2 intrinsic that handles unaligned loads and GCC splits it into several instructions, one of which causes SEGFAULTs. It's like adding random null-dereferences in debug code. No one does that. When using the workaround (manually placing an unaligned load so GCC doesn't attempt to place an aligned load), is GCC smart enough to remove the explicit load in optimized builds?