http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56732
--- Comment #6 from gretay at gcc dot gnu.org 2013-05-01 17:32:14 UTC --- Thanks for the small testcase! There is indeed a problem with rtl epilogue generated for naked functions. Here is a fix, testing in progress. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 464d91c..9d4a453 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -24067,7 +24067,8 @@ arm_expand_epilogue (bool really_return) if (IS_NAKED (func_type) || (IS_VOLATILE (func_type) && TARGET_ABORT_NORETURN)) { - emit_jump_insn (simple_return_rtx); + if (really_return) + emit_jump_insn (simple_return_rtx); return; }