This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/42240] wrong Epilog on nacked function
- From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2009 16:58:35 -0000
- Subject: [Bug target/42240] wrong Epilog on nacked function
- References: <bug-42240-18514@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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