https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82432
--- Comment #1 from Peter Cordes <peter at cordes dot ca> --- Meant to add https://godbolt.org/g/K9CxQ6 before submitting. And to say I wasn't sure tree-optimization was the right component. I did check that -flto didn't do this optimization either. Is it worth opening a separate bug for making .clone versions of functions with a more convenient calling convention? Obviously that can gain performance, but can make debugging harder. https://stackoverflow.com/a/46549978/224132 is right that compilers *could* do this, but there are probably good reasons why they don't.