https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68738
--- Comment #2 from Rian Quinn <rianquinn at gmail dot com> --- Yeah.... I'm am pretty sure it is specific to TARGET=elf-x86_64 (i.e. no OS specified). When I ran the same test on Ubuntu's native GCC it ran fine. objdump showed pretty different assembly for the Ubuntu case, vs. the cross-compiled case. For the code that does not crash (using the reference instead of the pointer) the code is identical.