------- Comment #5 from j at uriah dot heep dot sax dot de 2009-12-01 16:58 ------- My first analysis shows that this is likely to be related to the introduction of RTL prologues/epilogues in GCC 4.3. GCC 4.2.2 has:
if (avr_naked_function_p (current_function_decl)) { fputs ("/* epilogue: naked */\n", file); goto out; } ... out: fprintf (file, "/* epilogue end (size=%d) */\n", epilogue_size); fprintf (file, "/* function %s size %d (%d) */\n", current_function_name (), prologue_size + function_size + epilogue_size, function_size); commands_in_file += prologue_size + function_size + epilogue_size; commands_in_prologues += prologue_size; commands_in_epilogues += epilogue_size; } GCC 4.3.4 has: /* epilogue: naked */ if (cfun->machine->is_naked) { emit_jump_insn (gen_return ()); return; } So apparently, emit_jump_insn (gen_return ()); is responsible for creating the infinite loop. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42240