https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70123
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Bernd Schmidt from comment #4) > Created attachment 37906 [details] > Candidate patch > > Jakub, if you have a machine to test this on, can you try this patch? It's > probably not the full patch I'll submit, but it should cure this particular > issue. Fix verified both on the #c0 testcase (please remember that __builtin_strcat needs to be changed to __builtin_strcpy), and on the whole unreduced original testprog.c. I'm surprised that the RA can't figure out the needed value lives across the function call in the %r6 register (as well as %r10) already, but guess that can be improved incrementally, perhaps in GCC 7.