diff mbox

enable omit-frame-pointer on darwin with dwarf2

Message ID 20100813095644.GA31036@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth Aug. 13, 2010, 9:56 a.m. UTC
The attached patch enables -fomit-frame-pointer for those darwin
releases which support dwarf2. Bootstrapped and regression tested
on x86_64-apple-darwin10. Okay for gcc trunk?
                 Jack

2010-08-12  Jack Howarth <howarth@bromo.med.uc.edu>

	* gcc/configure.ac: Enable -fomit-frame-pointer on darwin
	which support dwarf2.
	* config/i386/i386.c (override_options): Same.

Comments

Mike Stump Aug. 13, 2010, 11:59 a.m. UTC | #1
On Aug 13, 2010, at 2:56 AM, Jack Howarth wrote:
> Okay for gcc trunk?

Ok.  Be on the lookout for anyone that spots hardships we didn't cover.
H.J. Lu Aug. 13, 2010, 3:59 p.m. UTC | #2
On Fri, Aug 13, 2010 at 2:56 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> The attached patch enables -fomit-frame-pointer for those darwin
> releases which support dwarf2. Bootstrapped and regression tested
> on x86_64-apple-darwin10. Okay for gcc trunk?
>                 Jack
>
> 2010-08-12  Jack Howarth <howarth@bromo.med.uc.edu>
>
>        * gcc/configure.ac: Enable -fomit-frame-pointer on darwin
>        which support dwarf2.
>        * config/i386/i386.c (override_options): Same.
>
>
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac    (revision 163214)
> +++ gcc/configure.ac    (working copy)
> @@ -1584,7 +1584,7 @@
>  [  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit x86], [],
>  [
>  case $target_os in
> -linux*)
> +linux* | darwin[[8912]]*)

This will match darwin8*, darwin9*, darwin1*, darwin2*. Is this what you want?

>   # Enable -fomit-frame-pointer by default for Linux.

You should mention Darwin here.

>   enable_frame_pointer=no
>   ;;


H.J.
Jack Howarth Aug. 13, 2010, 4:09 p.m. UTC | #3
On Fri, Aug 13, 2010 at 08:59:50AM -0700, H.J. Lu wrote:
> On Fri, Aug 13, 2010 at 2:56 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> > The attached patch enables -fomit-frame-pointer for those darwin
> > releases which support dwarf2. Bootstrapped and regression tested
> > on x86_64-apple-darwin10. Okay for gcc trunk?
> >                 Jack
> >
> > 2010-08-12  Jack Howarth <howarth@bromo.med.uc.edu>
> >
> >        * gcc/configure.ac: Enable -fomit-frame-pointer on darwin
> >        which support dwarf2.
> >        * config/i386/i386.c (override_options): Same.
> >
> >
> > Index: gcc/configure.ac
> > ===================================================================
> > --- gcc/configure.ac    (revision 163214)
> > +++ gcc/configure.ac    (working copy)
> > @@ -1584,7 +1584,7 @@
> >  [  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit x86], [],
> >  [
> >  case $target_os in
> > -linux*)
> > +linux* | darwin[[8912]]*)
> 
> This will match darwin8*, darwin9*, darwin1*, darwin2*. Is this what you want?

Yes. The idea is to enable -fomit-frame-pointer on all darwin releases
which support dwarf2. It could have been simplier if we had already
depreciated out support for darwin7 (which only supports stabs) but
I haven't gotten around to that yet.

> 
> >   # Enable -fomit-frame-pointer by default for Linux.

Can you just change that to 

   # Enable -fomit-frame-pointer by default for Linux and Darwin with dwarf2.

or do I need to recreate the patch?

> 
> You should mention Darwin here.
> 
> >   enable_frame_pointer=no
> >   ;;
> 
> 
> H.J.
H.J. Lu Aug. 13, 2010, 5:02 p.m. UTC | #4
On Fri, Aug 13, 2010 at 9:09 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> On Fri, Aug 13, 2010 at 08:59:50AM -0700, H.J. Lu wrote:
>> On Fri, Aug 13, 2010 at 2:56 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>> > The attached patch enables -fomit-frame-pointer for those darwin
>> > releases which support dwarf2. Bootstrapped and regression tested
>> > on x86_64-apple-darwin10. Okay for gcc trunk?
>> >                 Jack
>> >
>> > 2010-08-12  Jack Howarth <howarth@bromo.med.uc.edu>
>> >
>> >        * gcc/configure.ac: Enable -fomit-frame-pointer on darwin
>> >        which support dwarf2.
>> >        * config/i386/i386.c (override_options): Same.
>> >
>> >
>> > Index: gcc/configure.ac
>> > ===================================================================
>> > --- gcc/configure.ac    (revision 163214)
>> > +++ gcc/configure.ac    (working copy)
>> > @@ -1584,7 +1584,7 @@
>> >  [  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit x86], [],
>> >  [
>> >  case $target_os in
>> > -linux*)
>> > +linux* | darwin[[8912]]*)
>>
>> This will match darwin8*, darwin9*, darwin1*, darwin2*. Is this what you want?
>
> Yes. The idea is to enable -fomit-frame-pointer on all darwin releases
> which support dwarf2. It could have been simplier if we had already
> depreciated out support for darwin7 (which only supports stabs) but
> I haven't gotten around to that yet.
>
>>
>> >   # Enable -fomit-frame-pointer by default for Linux.
>
> Can you just change that to
>
>    # Enable -fomit-frame-pointer by default for Linux and Darwin with dwarf2.
>
> or do I need to recreate the patch?
>

I will take care of it.
Mike Stump Aug. 13, 2010, 5:49 p.m. UTC | #5
On Aug 13, 2010, at 8:59 AM, H.J. Lu wrote:
> This will match darwin8*, darwin9*, darwin1*, darwin2*. Is this what you want?

Yes...  We want darwin10, darwin11... darwin29... by the time we hit darwin30, this code will break, and we'll have to maintain it, if it still exists.  This form allows a grep to find all the places that are like this.
diff mbox

Patch

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 163214)
+++ gcc/configure.ac	(working copy)
@@ -1584,7 +1584,7 @@ 
 [  --enable-frame-pointer  enable -fno-omit-frame-pointer by default for 32bit x86], [],
 [
 case $target_os in
-linux*)
+linux* | darwin[[8912]]*)
   # Enable -fomit-frame-pointer by default for Linux.
   enable_frame_pointer=no
   ;;
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 163214)
+++ gcc/config/i386/i386.c	(working copy)
@@ -3276,9 +3276,8 @@ 
     {
       if (flag_zee == 2)
         flag_zee = 1;
-      /* Mach-O doesn't support omitting the frame pointer for now.  */
       if (flag_omit_frame_pointer == 2)
-	flag_omit_frame_pointer = (TARGET_MACHO ? 0 : 1);
+	flag_omit_frame_pointer = 1;
       if (flag_asynchronous_unwind_tables == 2)
 	flag_asynchronous_unwind_tables = 1;
       if (flag_pcc_struct_return == 2)
@@ -3288,10 +3287,8 @@ 
     {
       if (flag_zee == 2)
         flag_zee = 0;
-      /* Mach-O doesn't support omitting the frame pointer for now.  */
       if (flag_omit_frame_pointer == 2)
-	flag_omit_frame_pointer =
-	  (TARGET_MACHO ? 0 : !(USE_IX86_FRAME_POINTER || optimize_size));
+	flag_omit_frame_pointer = !(USE_IX86_FRAME_POINTER || optimize_size);
       if (flag_asynchronous_unwind_tables == 2)
 	flag_asynchronous_unwind_tables = !USE_IX86_FRAME_POINTER;
       if (flag_pcc_struct_return == 2)