public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Save an instruction with -mprofile-kernel style profiling
@ 2015-04-16  1:58 Anton Blanchard
  2015-04-16 14:20 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2015-04-16  1:58 UTC (permalink / raw)
  To: dje.gcc, Michael Ellerman, Alan Modra; +Cc: gcc-patches

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

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
-- 
2.1.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Save an instruction with -mprofile-kernel style profiling
  2015-04-16  1:58 [PATCH] Save an instruction with -mprofile-kernel style profiling Anton Blanchard
@ 2015-04-16 14:20 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2015-04-16 14:20 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: Michael Ellerman, Alan Modra, GCC Patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-16 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16  1:58 [PATCH] Save an instruction with -mprofile-kernel style profiling Anton Blanchard
2015-04-16 14:20 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).