This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] Allow functions calling mcount before prologue to be leaf functions
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Apr 2013 18:47:51 +0200
- Subject: [RFC] Allow functions calling mcount before prologue to be leaf functions
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.Krebbel@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))