https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66782
--- Comment #3 from marcus at jet dot franken.de --- Created attachment 35927 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35927&action=edit testcase-min.i gcc -S -fPIC -O2 -g testcase.i -o testcase.s there will be a pattern to spot the miscompilation: call strlen@PLT .LVL27: movq 40(%rsp), %rcx movq %rsi, %rdx However %rsi is clobbered by strlen and should not have been used here.