This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]