[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160215222111.GA3321@lst.de>
Date: Mon, 15 Feb 2016 23:21:11 +0100
From: Torsten Duwe <duwe@....de>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Balbir Singh <bsingharora@...il.com>,
Jiri Kosina <jkosina@...e.cz>, Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>, Jessica Yu <jeyu@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
live-patching@...r.kernel.org
Subject: Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables
On Mon, Feb 15, 2016 at 03:04:08PM +0100, Torsten Duwe wrote:
> If you use "-pg -mprofile-kernel", gcc seems to forget that, and omits the TOC
> load, for a similar assembler calling sequence.
>
> Looking at the code I can _understand_ why this is so, but my GCC knowledge
> is not that deep that I could easily _fix_ this reliably.
Nonetheless, here's a proposal.
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -25154,6 +25154,10 @@ rs6000_emit_prologue (void)
{
cfun->machine->r2_setup_needed = df_regs_ever_live_p (TOC_REGNUM);
+ /* Profiling _will_ generate a call to a global _mcount. */
+ if (crtl->profile)
+ cfun->machine->r2_setup_needed = true;
+
/* With -mminimal-toc we may generate an extra use of r2 below. */
if (TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
cfun->machine->r2_setup_needed = true;
Powered by blists - more mailing lists