public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86
@ 2004-07-14 23:50 Daniel Jacobowitz
  2004-07-15  2:10 ` Rainer Orth
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2004-07-14 23:50 UTC (permalink / raw)
  To: gcc-patches

For Solaris 10, the default should be to not omit the frame pointer - even
on 64-bit.  In compensation, we can omit it for leaf functions by default,
just not for previous functions.  I assume that some Solaris library
functionality relies on this behavior.

Committed to the csl-sol210-branch.

-- 
Daniel Jacobowitz

2004-07-14  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/i386.c (override_options): Move
	SUBTARGET_OVERRIDE_OPTIONS before defaulting flag_omit_frame_pointer.
	* config/i386/sol2-10.h (SUBTARGET_OVERRIDE_OPTIONS): Define.
	(TARGET_SUBTARGET_DEFAULT): Define.

Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.685.2.2
diff -u -p -r1.685.2.2 i386.c
--- config/i386/i386.c	13 Jul 2004 20:28:45 -0000	1.685.2.2
+++ config/i386/i386.c	14 Jul 2004 16:58:13 -0000
@@ -1200,6 +1200,10 @@ override_options (void)
 
   int const pta_size = ARRAY_SIZE (processor_alias_table);
 
+#ifdef SUBTARGET_OVERRIDE_OPTIONS
+  SUBTARGET_OVERRIDE_OPTIONS;
+#endif
+
   /* Set the default values for switches whose default depends on TARGET_64BIT
      in case they weren't overwritten by command line options.  */
   if (TARGET_64BIT)
@@ -1221,10 +1225,6 @@ override_options (void)
 	flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
     }
 
-#ifdef SUBTARGET_OVERRIDE_OPTIONS
-  SUBTARGET_OVERRIDE_OPTIONS;
-#endif
-
   if (!ix86_tune_string && ix86_arch_string)
     ix86_tune_string = ix86_arch_string;
   if (!ix86_tune_string)
Index: config/i386/sol2-10.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/Attic/sol2-10.h,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 sol2-10.h
--- config/i386/sol2-10.h	13 Jul 2004 20:36:59 -0000	1.1.2.3
+++ config/i386/sol2-10.h	14 Jul 2004 16:58:13 -0000
@@ -57,3 +57,18 @@ Boston, MA 02111-1307, USA.  */
   while (0)
 
 #define TARGET_INIT_FINI_ATTRIBUTES
+
+#define SUBTARGET_OVERRIDE_OPTIONS				\
+  do								\
+    {								\
+      if (flag_omit_frame_pointer == 2)				\
+	flag_omit_frame_pointer = 0;				\
+      if (flag_asynchronous_unwind_tables == 2)			\
+	flag_asynchronous_unwind_tables = 0;			\
+    }								\
+  while (0)
+
+#undef TARGET_SUBTARGET_DEFAULT
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP	\
+				  | MASK_FLOAT_RETURNS		\
+				  | MASK_OMIT_LEAF_FRAME_POINTER)

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

* Re: [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86
  2004-07-14 23:50 [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86 Daniel Jacobowitz
@ 2004-07-15  2:10 ` Rainer Orth
  2004-07-16 10:16   ` Mark Mitchell
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2004-07-15  2:10 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gcc-patches

Daniel Jacobowitz <drow@false.org> writes:

> For Solaris 10, the default should be to not omit the frame pointer - even
> on 64-bit.  In compensation, we can omit it for leaf functions by default,
> just not for previous functions.  I assume that some Solaris library
> functionality relies on this behavior.

It would be good to get confirmation from Sun about this and add a comment
explaining what's going on to sol2-10.h.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

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

* Re: [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86
  2004-07-15  2:10 ` Rainer Orth
@ 2004-07-16 10:16   ` Mark Mitchell
  2004-07-16 11:49     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Mitchell @ 2004-07-16 10:16 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Daniel Jacobowitz, gcc-patches

Rainer Orth wrote:

>Daniel Jacobowitz <drow@false.org> writes:
>
>  
>
>>For Solaris 10, the default should be to not omit the frame pointer - even
>>on 64-bit.  In compensation, we can omit it for leaf functions by default,
>>just not for previous functions.  I assume that some Solaris library
>>functionality relies on this behavior.
>>    
>>
>
>It would be good to get confirmation from Sun about this and add a comment
>explaining what's going on to sol2-10.h.
>
We can't name the customer that is paying for Daniel's work, but I think 
it's fair to say that what we're doing is directly in accordance with 
Sun's technical specification -- which is not to say that we know 
exactly *why* the specification says what it does. :-(

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com

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

* Re: [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86
  2004-07-16 10:16   ` Mark Mitchell
@ 2004-07-16 11:49     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2004-07-16 11:49 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Rainer Orth, gcc-patches

On Thu, Jul 15, 2004 at 07:06:31PM -0700, Mark Mitchell wrote:
> Rainer Orth wrote:
> 
> >Daniel Jacobowitz <drow@false.org> writes:
> >
> > 
> >
> >>For Solaris 10, the default should be to not omit the frame pointer - even
> >>on 64-bit.  In compensation, we can omit it for leaf functions by default,
> >>just not for previous functions.  I assume that some Solaris library
> >>functionality relies on this behavior.
> >>   
> >>
> >
> >It would be good to get confirmation from Sun about this and add a comment
> >explaining what's going on to sol2-10.h.
> >
> We can't name the customer that is paying for Daniel's work, but I think 
> it's fair to say that what we're doing is directly in accordance with 
> Sun's technical specification -- which is not to say that we know 
> exactly *why* the specification says what it does. :-(

I inquired further.  Apparently there is a great deal of legacy Solaris
code at assorted third parties that does basic stack walking / call
auditing using the frame pointer, and they would prefer to break as
little as possible of this as they move to 64-bit.  It seems reasonable
to me.

-- 
Daniel Jacobowitz

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

end of thread, other threads:[~2004-07-16  2:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-14 23:50 [csl-sol210-branch] Tweak frame pointer defaults for Solaris 10 / x86 Daniel Jacobowitz
2004-07-15  2:10 ` Rainer Orth
2004-07-16 10:16   ` Mark Mitchell
2004-07-16 11:49     ` Daniel Jacobowitz

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