Commit c8d3e088 by Anton Blanchard Committed by William Schmidt

re PR target/63354 (gcc -pg -mprofile-kernel creates unused stack frames on leaf…

re PR target/63354 (gcc -pg -mprofile-kernel creates unused stack frames on leaf functions on ppc64le)

[gcc]

2016-01-21  Anton Blanchard  <anton@samba.org>
	    Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/63354
	* config/rs6000/linux64.h (TARGET_KEEP_LEAF_WHEN_PROFILED): New
	#define.
	* config/rs6000/rs6000.c (rs6000_keep_leaf_when_profiled): New
	function.

[gcc/testsuite]

2016-01-21  Anton Blanchard  <anton@samba.org>
	    Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/63354
	* gcc.target/powerpc/pr63354.c:  New test.


Co-Authored-By: Bill Schmidt <wschmidt@linux.vnet.ibm.com>

From-SVN: r232684
parent b638c908
2016-01-21 Anton Blanchard <anton@samba.org>
Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/63354
* config/rs6000/linux64.h (TARGET_KEEP_LEAF_WHEN_PROFILED): New
#define.
* config/rs6000/rs6000.c (rs6000_keep_leaf_when_profiled): New
function.
2016-01-21 Ajit Agarwal <ajitkum@xilinx.com> 2016-01-21 Ajit Agarwal <ajitkum@xilinx.com>
* config/microblaze/microblaze.c * config/microblaze/microblaze.c
......
...@@ -59,6 +59,9 @@ extern int dot_symbols; ...@@ -59,6 +59,9 @@ extern int dot_symbols;
#define TARGET_PROFILE_KERNEL profile_kernel #define TARGET_PROFILE_KERNEL profile_kernel
#undef TARGET_KEEP_LEAF_WHEN_PROFILED
#define TARGET_KEEP_LEAF_WHEN_PROFILED rs6000_keep_leaf_when_profiled
#define TARGET_USES_LINUX64_OPT 1 #define TARGET_USES_LINUX64_OPT 1
#ifdef HAVE_LD_LARGE_TOC #ifdef HAVE_LD_LARGE_TOC
#undef TARGET_CMODEL #undef TARGET_CMODEL
......
...@@ -26237,6 +26237,14 @@ rs6000_output_function_prologue (FILE *file, ...@@ -26237,6 +26237,14 @@ rs6000_output_function_prologue (FILE *file,
rs6000_pic_labelno++; rs6000_pic_labelno++;
} }
/* -mprofile-kernel code calls mcount before the function prolog,
so a profiled leaf function should stay a leaf function. */
static bool
rs6000_keep_leaf_when_profiled ()
{
return TARGET_PROFILE_KERNEL;
}
/* Non-zero if vmx regs are restored before the frame pop, zero if /* Non-zero if vmx regs are restored before the frame pop, zero if
we restore after the pop when possible. */ we restore after the pop when possible. */
#define ALWAYS_RESTORE_ALTIVEC_BEFORE_POP 0 #define ALWAYS_RESTORE_ALTIVEC_BEFORE_POP 0
2016-01-21 Anton Blanchard <anton@samba.org>
Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/63354
* gcc.target/powerpc/pr63354.c: New test.
2016-01-21 Vladimir Makarov <vmakarov@redhat.com> 2016-01-21 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/68990 PR rtl-optimization/68990
......
/* Verify that we don't stack a frame for leaf functions when using
-pg -mprofile-kernel. */
/* { dg-do compile { target { powerpc64*-*-* } } } */
/* { dg-options "-O2 -pg -mprofile-kernel" } */
/* { dg-final { scan-assembler-not "mtlr" } } */
int foo(void)
{
return 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment