diff mbox

Save an instruction with -mprofile-kernel style profiling

Message ID 20150416115757.3edf7512@kryten
State New
Headers show

Commit Message

Anton Blanchard April 16, 2015, 1:57 a.m. UTC
Save an instruction with -mprofile-kernel style profiling and require
the mcount handler to save the LR to the stack.

-mprofile-kernel is an undocumented gcc option that was introduced
specifically for the Linux kernel, so it should be safe to make this
change. When we do add support for this option in the kernel we plan
to support both the old and new behaviour.

gcc/
2015-04-16  Anton Blanchard  <anton@samba.org>

	* config/rs6000/rs6000.c (rs6000_output_function_prologue):
	No need for -mprofile-kernel to save LR to stack.
---
 gcc/config/rs6000/rs6000.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Edelsohn April 16, 2015, 2:20 p.m. UTC | #1
On Wed, Apr 15, 2015 at 9:57 PM, Anton Blanchard <anton@samba.org> wrote:
> Save an instruction with -mprofile-kernel style profiling and require
> the mcount handler to save the LR to the stack.
>
> -mprofile-kernel is an undocumented gcc option that was introduced
> specifically for the Linux kernel, so it should be safe to make this
> change. When we do add support for this option in the kernel we plan
> to support both the old and new behaviour.
>
> gcc/
> 2015-04-16  Anton Blanchard  <anton@samba.org>
>
>         * config/rs6000/rs6000.c (rs6000_output_function_prologue):
>         No need for -mprofile-kernel to save LR to stack.

The PPC kernel maintainers own the interface and ABI, so you can
ensure the caller and callee are compatible.

The patch is fine with me.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a96a774..f85678a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -24406,7 +24406,6 @@  rs6000_output_function_prologue (FILE *file,
       gcc_assert (!TARGET_32BIT);
 
       asm_fprintf (file, "\tmflr %s\n", reg_names[0]);
-      asm_fprintf (file, "\tstd %s,16(%s)\n", reg_names[0], reg_names[1]);
 
       /* In the ELFv2 ABI we have no compiler stack word.  It must be
 	 the resposibility of _mcount to preserve the static chain