> -----Original Message-----
> From: Jeff Law [mailto:[email protected]]
> Sent: Monday, January 05, 2015 12:07 PM
> To: Moore, Catherine; Radovan Obradovic; [email protected]
> Cc: Petar Jovanovic
> Subject: Re: [PATCH] Disable -fuse-caller-save when -pg is active
>
> On 01/05/15 07:48, Moore, Catherine wrote:
> >
> >
> >> -----Original Message-----
> >> From: [email protected] [mailto:gcc-patches-
> >> [email protected]] On Behalf Of Radovan Obradovic
> >> Sent: Thursday, December 18, 2014 11:01 AM
> >> To: Jeff Law; [email protected]
> >> Cc: Petar Jovanovic
> >> Subject: RE: [PATCH] Disable -fuse-caller-save when -pg is active
> >>
> >>
> >> Patch has been tested with DejaGnu gcc test suite on mips32r2 cross
> >> compiler and bootstrapped and tested on
> >> x86_64 native compiler.
> >>
> > Thanks for finishing up the testing. Would you like me to check this in for
> you?
> Please do. My recollection was that the patch itself looked fine, but that it
> needed to go through the usual testing cycle.
>
This patch had bit-rotted slightl since the original posting. The
-fuse-caller-save option has been changed to -fipa-ra.
I committed this updated version of the patch.
Catherine
Index: toplev.c
===================================================================
--- toplev.c (revision 219188)
+++ toplev.c (revision 219208)
@@ -113,6 +113,13 @@
declarations for e.g. AIX 4.x. */
#endif
+#ifndef HAVE_epilogue
+#define HAVE_epilogue 0
+#endif
+#ifndef HAVE_prologue
+#define HAVE_prologue 0
+#endif
+
#include <new>
static void general_init (const char *);
@@ -1634,6 +1641,11 @@
/* Save the current optimization options. */
optimization_default_node = build_optimization_node (&global_options);
optimization_current_node = optimization_default_node;
+
+ /* Disable use caller save optimization if profiler is active or port
+ does not emit prologue and epilogue as RTL. */
+ if (profile_flag || !HAVE_prologue || !HAVE_epilogue)
+ flag_ipa_ra = 0;
}