http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54793
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-25 09:08:14 UTC --- Well, we can also just use the first NOTE_INSN_BASIC_BLOCK resp. NOTE_INSN_FUNCTION_BEG, whichever comes first. The bigger problem with that ia64, pa and a few other targets use both PROLOGUE_BEFORE_EPILOGUE and non-default function_prologue hook, which emits some assembly stuff (even when they HAVE_prologue). Perhaps for those targets we'd need to emit the profiler code right away, and only postpone it until the first NOTE_INSN_BASIC_BLOCK/NOTE_INSN_FUNCTION_BEG if function_prologue hook is the default.