Hi, when function profiling is enabled also all the leaf functions are forced to create a stack frame. This does not appear to be necessary if the mcount call happens *before* the function prologue.
It also should not be necessary to do this when only -fprofile-arcs is used since this option only triggers the counters to be updated but no function call. Ok for mainline? Bye, -Andreas- 2013-04-16 Andreas Krebbel <andreas.kreb...@de.ibm.com> * final.c (leaf_function_p): Allow functions calling mcount before the prologue to be leaf functions. --- gcc/final.c | 2 !! 1 file changed, 2 modifications(!) Index: gcc/final.c =================================================================== *** gcc/final.c.orig --- gcc/final.c *************** leaf_function_p (void) *** 4145,4151 **** { rtx insn; ! if (crtl->profile || profile_arc_flag) return 0; for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) --- 4145,4151 ---- { rtx insn; ! if (!targetm.profile_before_prologue () && crtl->profile) return 0; for (insn = get_insns (); insn; insn = NEXT_INSN (insn))