https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25829
--- Comment #48 from Christophe Lyon <clyon at gcc dot gnu.org> --- I've reproduced the problem on armeb with the patch posted at: https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00208.html The code generated for the testcase is the same with and without your patch, so I guess the different behavior is caused by different runtime libraries. I've compiled the testscase with -static, and the results are attached: .exe files are the ELF binaries, .trace files are execution traces from QEMU, .dump files are the output of objdump -d on the ELF binaries. ".ko" are the ones that fail, ".ok" are the ones that succeed.