https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64379
--- Comment #5 from Mikael Pettersson <mikpelinux at gmail dot com> --- I can reproduce the wrong-code with gcc-4.9.2 on armv7l-linux-gnueabi. Appears to need both -foptimize-sibling-calls and -mapcs-frame to trigger.