public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Using -ffunction-sections and -p
@ 2012-11-05  4:04 Sriraman Tallam
  2012-11-05  5:03 ` Ian Lance Taylor
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2012-11-05  4:04 UTC (permalink / raw)
  To: GCC Patches, Ian Lance Taylor, David Li, gcc

Hi,

   Currently, using -ffunction-sections and -p together results in a
warning. I ran into this problem when compiling the kernel. This is
discussed in this thread:

http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html

Ian's reply suggests this warning is no longer necessary and can be
removed. Is this patch alright to commit with all tests passing:

        * toplev.c (process_options): Do not warn when -ffunction-sections
          and -fprofile are used together.

--- toplev.c (revision 193117)
+++ toplev.c (working copy)
@@ -1467,12 +1467,6 @@ process_options (void)
  }
     }

-  if (flag_function_sections && profile_flag)
-    {
-      warning (0, "-ffunction-sections disabled; it makes profiling
impossible");
-      flag_function_sections = 0;
-    }
-
 #ifndef HAVE_prefetch
   if (flag_prefetch_loop_arrays > 0)
     {



Thanks,
-Sri.

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

* Re: Using -ffunction-sections and -p
  2012-11-05  4:04 Using -ffunction-sections and -p Sriraman Tallam
@ 2012-11-05  5:03 ` Ian Lance Taylor
  2012-11-14 18:58   ` Sriraman Tallam
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Lance Taylor @ 2012-11-05  5:03 UTC (permalink / raw)
  To: Sriraman Tallam; +Cc: GCC Patches, David Li, gcc

On Sun, Nov 4, 2012 at 8:04 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>
>    Currently, using -ffunction-sections and -p together results in a
> warning. I ran into this problem when compiling the kernel. This is
> discussed in this thread:
>
> http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html
>
> Ian's reply suggests this warning is no longer necessary and can be
> removed. Is this patch alright to commit with all tests passing:
>
>         * toplev.c (process_options): Do not warn when -ffunction-sections
>           and -fprofile are used together.

In that thread Jeff suggested that this be tested on Solaris and PA.
I don't know how to test on PA, but could somebody test the patch on
Solaris?

Ian

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

* Re: Using -ffunction-sections and -p
  2012-11-05  5:03 ` Ian Lance Taylor
@ 2012-11-14 18:58   ` Sriraman Tallam
  2012-11-14 20:01     ` Ian Lance Taylor
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2012-11-14 18:58 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: GCC Patches, David Li, gcc

On Sun, Nov 4, 2012 at 9:03 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Sun, Nov 4, 2012 at 8:04 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>>
>>    Currently, using -ffunction-sections and -p together results in a
>> warning. I ran into this problem when compiling the kernel. This is
>> discussed in this thread:
>>
>> http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html
>>
>> Ian's reply suggests this warning is no longer necessary and can be
>> removed. Is this patch alright to commit with all tests passing:
>>
>>         * toplev.c (process_options): Do not warn when -ffunction-sections
>>           and -fprofile are used together.
>
> In that thread Jeff suggested that this be tested on Solaris and PA.
> I don't know how to test on PA, but could somebody test the patch on
> Solaris?

Is it reasonable to gate this using a target hook and start allowing
this on selected targets? For instance, i386 does not seem to have a
problem with this.

Thanks,
-Sri.

>
> Ian

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

* Re: Using -ffunction-sections and -p
  2012-11-14 18:58   ` Sriraman Tallam
@ 2012-11-14 20:01     ` Ian Lance Taylor
  2012-11-14 20:04       ` Jeff Law
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Lance Taylor @ 2012-11-14 20:01 UTC (permalink / raw)
  To: Sriraman Tallam; +Cc: GCC Patches, David Li, gcc

On Wed, Nov 14, 2012 at 10:58 AM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Sun, Nov 4, 2012 at 9:03 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Sun, Nov 4, 2012 at 8:04 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>
>>>    Currently, using -ffunction-sections and -p together results in a
>>> warning. I ran into this problem when compiling the kernel. This is
>>> discussed in this thread:
>>>
>>> http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html
>>>
>>> Ian's reply suggests this warning is no longer necessary and can be
>>> removed. Is this patch alright to commit with all tests passing:
>>>
>>>         * toplev.c (process_options): Do not warn when -ffunction-sections
>>>           and -fprofile are used together.
>>
>> In that thread Jeff suggested that this be tested on Solaris and PA.
>> I don't know how to test on PA, but could somebody test the patch on
>> Solaris?
>
> Is it reasonable to gate this using a target hook and start allowing
> this on selected targets? For instance, i386 does not seem to have a
> problem with this.

At this point I don't know that any target at all has a problem with this.

Given that nobody has stepped forward to test it, let's just remove
the code and see if anybody complains.  I'll approve the patch unless
somebody objects in the next 24 hours.

Ian

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

* Re: Using -ffunction-sections and -p
  2012-11-14 20:01     ` Ian Lance Taylor
@ 2012-11-14 20:04       ` Jeff Law
  2012-11-14 20:32         ` Ian Lance Taylor
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Law @ 2012-11-14 20:04 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Sriraman Tallam, GCC Patches, David Li, gcc

On 11/14/2012 01:00 PM, Ian Lance Taylor wrote:
> Given that nobody has stepped forward to test it, let's just remove
> the code and see if anybody complains.  I'll approve the patch unless
> somebody objects in the next 24 hours.
I think the target to check would be 32 bit HPUX.

-ffunction-sections was largely driven by issues we wanted to resolve on 
the PA.

jeff

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

* Re: Using -ffunction-sections and -p
  2012-11-14 20:04       ` Jeff Law
@ 2012-11-14 20:32         ` Ian Lance Taylor
  2012-11-14 22:41           ` Jeff Law
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Lance Taylor @ 2012-11-14 20:32 UTC (permalink / raw)
  To: Jeff Law; +Cc: Sriraman Tallam, GCC Patches, David Li, gcc

On Wed, Nov 14, 2012 at 12:04 PM, Jeff Law <law@redhat.com> wrote:
> On 11/14/2012 01:00 PM, Ian Lance Taylor wrote:
>>
>> Given that nobody has stepped forward to test it, let's just remove
>> the code and see if anybody complains.  I'll approve the patch unless
>> somebody objects in the next 24 hours.
>
> I think the target to check would be 32 bit HPUX.
>
> -ffunction-sections was largely driven by issues we wanted to resolve on the
> PA.

Does anybody still have access to a 32-bit HPUX machine?

Ian

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

* Re: Using -ffunction-sections and -p
  2012-11-14 20:32         ` Ian Lance Taylor
@ 2012-11-14 22:41           ` Jeff Law
       [not found]             ` <CAAs8HmzV1g0GHiGgaUnBE4fDGLyxk31JirrxFOJnZLoOPW_aUg@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Law @ 2012-11-14 22:41 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Sriraman Tallam, GCC Patches, David Li, gcc

On 11/14/2012 01:32 PM, Ian Lance Taylor wrote:
> On Wed, Nov 14, 2012 at 12:04 PM, Jeff Law <law@redhat.com> wrote:
>> On 11/14/2012 01:00 PM, Ian Lance Taylor wrote:
>>>
>>> Given that nobody has stepped forward to test it, let's just remove
>>> the code and see if anybody complains.  I'll approve the patch unless
>>> somebody objects in the next 24 hours.
>>
>> I think the target to check would be 32 bit HPUX.
>>
>> -ffunction-sections was largely driven by issues we wanted to resolve on the
>> PA.
>
> Does anybody still have access to a 32-bit HPUX machine?
:-)  I've got one gathering dust downstairs...  If David doesn't have 
one anymore, I'll fire up mine up and see what I can find...

jeff

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

* Re: Using -ffunction-sections and -p
       [not found]               ` <50BE6B98.80908@redhat.com>
@ 2012-12-04 21:43                 ` Sriraman Tallam
  2012-12-07 22:46                   ` Sriraman Tallam
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2012-12-04 21:43 UTC (permalink / raw)
  To: Jeff Law; +Cc: Ian Lance Taylor, David Li, GCC Patches

On Tue, Dec 4, 2012 at 1:31 PM, Jeff Law <law@redhat.com> wrote:
> On 12/03/2012 01:08 PM, Sriraman Tallam wrote:
>>
>> Hi Jeff,
>>
>>     Wondering if you got a chance to do this?
>
> Hmm, thinking more about this, it couldn't have been a 32 bit HPUX issue.
> First that port claims to not support -ffunction-sections -- which is true,
> we can't make arbitrarily named sections, though each function is placed
> into its own $CODE$ section/subspace.
>
> Second, even with each function in its own $CODE$ subspace, profiling works.
>
> So it couldn't have been 32 bit HPUX.
>
> I think Ian's plan of going forward and see if anyone complains is
> reasonable.  Regardless, we're talking about OSs that are > 10 years old,.
> the odds of folks building modern versions of GCC is pretty slim.  The odds
> they're building modern versions of GCC and care about both
> function-sections and profiling is probably approaching zero.
>
> Jeff
>

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

* Re: Using -ffunction-sections and -p
  2012-12-04 21:43                 ` Sriraman Tallam
@ 2012-12-07 22:46                   ` Sriraman Tallam
  2012-12-07 22:47                     ` Jeff Law
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2012-12-07 22:46 UTC (permalink / raw)
  To: Jeff Law; +Cc: Ian Lance Taylor, David Li, GCC Patches

I have submitted this patch.

        * toplev.c (process_options): Do not warn when -ffunction-sections
        and -fprofile are used together.

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c (revision 194306)
+++ gcc/toplev.c (working copy)
@@ -1478,12 +1478,6 @@ process_options (void)
  }
     }

-  if (flag_function_sections && profile_flag)
-    {
-      warning (0, "-ffunction-sections disabled; it makes profiling
impossible");
-      flag_function_sections = 0;
-    }
-
 #ifndef HAVE_prefetch
   if (flag_prefetch_loop_arrays > 0)
     {

Thanks,
-Sri.

On Tue, Dec 4, 2012 at 1:43 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Tue, Dec 4, 2012 at 1:31 PM, Jeff Law <law@redhat.com> wrote:
>> On 12/03/2012 01:08 PM, Sriraman Tallam wrote:
>>>
>>> Hi Jeff,
>>>
>>>     Wondering if you got a chance to do this?
>>
>> Hmm, thinking more about this, it couldn't have been a 32 bit HPUX issue.
>> First that port claims to not support -ffunction-sections -- which is true,
>> we can't make arbitrarily named sections, though each function is placed
>> into its own $CODE$ section/subspace.
>>
>> Second, even with each function in its own $CODE$ subspace, profiling works.
>>
>> So it couldn't have been 32 bit HPUX.
>>
>> I think Ian's plan of going forward and see if anyone complains is
>> reasonable.  Regardless, we're talking about OSs that are > 10 years old,.
>> the odds of folks building modern versions of GCC is pretty slim.  The odds
>> they're building modern versions of GCC and care about both
>> function-sections and profiling is probably approaching zero.
>>
>> Jeff
>>

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

* Re: Using -ffunction-sections and -p
  2012-12-07 22:46                   ` Sriraman Tallam
@ 2012-12-07 22:47                     ` Jeff Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Law @ 2012-12-07 22:47 UTC (permalink / raw)
  To: Sriraman Tallam; +Cc: Ian Lance Taylor, David Li, GCC Patches

On 12/07/2012 03:46 PM, Sriraman Tallam wrote:
> I have submitted this patch.
>
>          * toplev.c (process_options): Do not warn when -ffunction-sections
>          and -fprofile are used together.
Approved.  Please install.

jeff

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

end of thread, other threads:[~2012-12-07 22:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05  4:04 Using -ffunction-sections and -p Sriraman Tallam
2012-11-05  5:03 ` Ian Lance Taylor
2012-11-14 18:58   ` Sriraman Tallam
2012-11-14 20:01     ` Ian Lance Taylor
2012-11-14 20:04       ` Jeff Law
2012-11-14 20:32         ` Ian Lance Taylor
2012-11-14 22:41           ` Jeff Law
     [not found]             ` <CAAs8HmzV1g0GHiGgaUnBE4fDGLyxk31JirrxFOJnZLoOPW_aUg@mail.gmail.com>
     [not found]               ` <50BE6B98.80908@redhat.com>
2012-12-04 21:43                 ` Sriraman Tallam
2012-12-07 22:46                   ` Sriraman Tallam
2012-12-07 22:47                     ` Jeff Law

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