[RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Martin Liška-2
Hello.

After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
introduce --with-stage1-cflags where one can provide such options.

Apart from that, maybe it would be handy to automatically enable "-O2" when
one has a recent compiler? Do we have an example where we detect host compiler
and it's version?

Martin

0001-Introduce-configure-flag-with-stage1-cflags.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Richard Biener-2
On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
> Hello.
>
> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
> enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
> introduce --with-stage1-cflags where one can provide such options.

I don't think this is necessary -- you can always override with STAGE1_CFLAGS.

> Apart from that, maybe it would be handy to automatically enable "-O2" when
> one has a recent compiler? Do we have an example where we detect host compiler
> and it's version?

Don't know about version but configury already detects that we use GCC, so that
knowledge should be readily available.

Richard.

>
> Martin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Jakub Jelinek
On Fri, May 26, 2017 at 01:46:47PM +0200, Richard Biener wrote:

> On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
> > Hello.
> >
> > After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
> > enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
> > introduce --with-stage1-cflags where one can provide such options.
>
> I don't think this is necessary -- you can always override with STAGE1_CFLAGS.
>
> > Apart from that, maybe it would be handy to automatically enable "-O2" when
> > one has a recent compiler? Do we have an example where we detect host compiler
> > and it's version?
>
> Don't know about version but configury already detects that we use GCC, so that
> knowledge should be readily available.

Well, it certainly shouldn't be -O2 by default for any system GCC, more
something like if it is major of the configured configure minus 1 or newer
(or minus 2?), then use -O2, otherwise default to -O0 as before.

        Jakub
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Richard Biener-2
On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <[hidden email]> wrote:

> On Fri, May 26, 2017 at 01:46:47PM +0200, Richard Biener wrote:
>> On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
>> > Hello.
>> >
>> > After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
>> > enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
>> > introduce --with-stage1-cflags where one can provide such options.
>>
>> I don't think this is necessary -- you can always override with STAGE1_CFLAGS.
>>
>> > Apart from that, maybe it would be handy to automatically enable "-O2" when
>> > one has a recent compiler? Do we have an example where we detect host compiler
>> > and it's version?
>>
>> Don't know about version but configury already detects that we use GCC, so that
>> knowledge should be readily available.
>
> Well, it certainly shouldn't be -O2 by default for any system GCC, more
> something like if it is major of the configured configure minus 1 or newer
> (or minus 2?), then use -O2, otherwise default to -O0 as before.

I'd still default to -O0 on release branches regardless of version and then
for development we can probably simply use "any GCC" when people have
the chance to override.

At least for me host GCC 4.8 works quite well with -O2.

Richard.

>         Jakub
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Martin Liška-2
On 05/26/2017 01:55 PM, Richard Biener wrote:

> On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <[hidden email]> wrote:
>> On Fri, May 26, 2017 at 01:46:47PM +0200, Richard Biener wrote:
>>> On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
>>>> Hello.
>>>>
>>>> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
>>>> enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
>>>> introduce --with-stage1-cflags where one can provide such options.
>>>
>>> I don't think this is necessary -- you can always override with STAGE1_CFLAGS.
>>>
>>>> Apart from that, maybe it would be handy to automatically enable "-O2" when
>>>> one has a recent compiler? Do we have an example where we detect host compiler
>>>> and it's version?
>>>
>>> Don't know about version but configury already detects that we use GCC, so that
>>> knowledge should be readily available.
>>
>> Well, it certainly shouldn't be -O2 by default for any system GCC, more
>> something like if it is major of the configured configure minus 1 or newer
>> (or minus 2?), then use -O2, otherwise default to -O0 as before.
>
> I'd still default to -O0 on release branches regardless of version and then
> for development we can probably simply use "any GCC" when people have
> the chance to override.
Ok, sending new patch that does that on experimental branches for ${CC} --version
being a GCC newer than 4.9.

Martin

>
> At least for me host GCC 4.8 works quite well with -O2.
>
> Richard.
>
>>         Jakub


0001-Add-O2-to-stage1_cflags-for-experimental-branch.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Martin Liška-2
On 05/26/2017 03:00 PM, Martin Liška wrote:
> Ok, sending new patch that does that on experimental branches for ${CC} --version
> being a GCC newer than 4.9.

s/4.9/4.8/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Eric Botcazou-3
In reply to this post by Martin Liška-2
> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a
> recent enough compiler can significantly speed up bootstrap. Thus I'm
> suggesting to introduce --with-stage1-cflags where one can provide such
> options.

-O1 is sufficient in my experience and far less risky than -O2 in this case.

--
Eric Botcazou
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Richard Biener-2
On Mon, May 29, 2017 at 1:13 PM, Eric Botcazou <[hidden email]> wrote:
>> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a
>> recent enough compiler can significantly speed up bootstrap. Thus I'm
>> suggesting to introduce --with-stage1-cflags where one can provide such
>> options.
>
> -O1 is sufficient in my experience and far less risky than -O2 in this case.

Are you sure?  In my experience -O2 gets the most test coverage during lifetime
of a particular release.

Richard.

> --
> Eric Botcazou
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Eric Botcazou-3
> Are you sure?  In my experience -O2 gets the most test coverage during
> lifetime of a particular release.

Yes, some older GCC releases have aliasing issues that are exposed at -O2 only
because of -fstrict-aliasing and -fschedule-insns.

--
Eric Botcazou
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Martin Liška-2
On 05/30/2017 11:43 AM, Eric Botcazou wrote:
>> Are you sure?  In my experience -O2 gets the most test coverage during
>> lifetime of a particular release.
>
> Yes, some older GCC releases have aliasing issues that are exposed at -O2 only
> because of -fstrict-aliasing and -fschedule-insns.
>

That's why we decided to enable -O2 just with GCC 4.8+.

Martin

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Eric Botcazou-3
> That's why we decided to enable -O2 just with GCC 4.8+.

IMO it's too dangerous on non-x86 platforms and -O1 would be much safer.

--
Eric Botcazou
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Martin Liška-2
In reply to this post by Martin Liška-2
PING^1

Richi are you fine with the suggested change? I basically followed your advises :)

Martin

On 05/26/2017 03:00 PM, Martin Liška wrote:

> On 05/26/2017 01:55 PM, Richard Biener wrote:
>> On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <[hidden email]> wrote:
>>> On Fri, May 26, 2017 at 01:46:47PM +0200, Richard Biener wrote:
>>>> On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
>>>>> Hello.
>>>>>
>>>>> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
>>>>> enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
>>>>> introduce --with-stage1-cflags where one can provide such options.
>>>>
>>>> I don't think this is necessary -- you can always override with STAGE1_CFLAGS.
>>>>
>>>>> Apart from that, maybe it would be handy to automatically enable "-O2" when
>>>>> one has a recent compiler? Do we have an example where we detect host compiler
>>>>> and it's version?
>>>>
>>>> Don't know about version but configury already detects that we use GCC, so that
>>>> knowledge should be readily available.
>>>
>>> Well, it certainly shouldn't be -O2 by default for any system GCC, more
>>> something like if it is major of the configured configure minus 1 or newer
>>> (or minus 2?), then use -O2, otherwise default to -O0 as before.
>>
>> I'd still default to -O0 on release branches regardless of version and then
>> for development we can probably simply use "any GCC" when people have
>> the chance to override.
>
> Ok, sending new patch that does that on experimental branches for ${CC} --version
> being a GCC newer than 4.9.
>
> Martin
>
>>
>> At least for me host GCC 4.8 works quite well with -O2.
>>
>> Richard.
>>
>>>         Jakub
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.

Richard Biener-2
On Mon, Jun 19, 2017 at 12:51 PM, Martin Liška <[hidden email]> wrote:
> PING^1
>
> Richi are you fine with the suggested change? I basically followed your advises :)

Well, I am but as Eric disagrees I think we need input from other
people on this.
I'm comfortably setting STAGE1_CFLAGS here.

Richard.

> Martin
>
> On 05/26/2017 03:00 PM, Martin Liška wrote:
>> On 05/26/2017 01:55 PM, Richard Biener wrote:
>>> On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <[hidden email]> wrote:
>>>> On Fri, May 26, 2017 at 01:46:47PM +0200, Richard Biener wrote:
>>>>> On Thu, May 25, 2017 at 11:23 AM, Martin Liška <[hidden email]> wrote:
>>>>>> Hello.
>>>>>>
>>>>>> After a discussion with Richi, using adding "-O2" to STAGE1 cflags with a recent
>>>>>> enough compiler can significantly speed up bootstrap. Thus I'm suggesting to
>>>>>> introduce --with-stage1-cflags where one can provide such options.
>>>>>
>>>>> I don't think this is necessary -- you can always override with STAGE1_CFLAGS.
>>>>>
>>>>>> Apart from that, maybe it would be handy to automatically enable "-O2" when
>>>>>> one has a recent compiler? Do we have an example where we detect host compiler
>>>>>> and it's version?
>>>>>
>>>>> Don't know about version but configury already detects that we use GCC, so that
>>>>> knowledge should be readily available.
>>>>
>>>> Well, it certainly shouldn't be -O2 by default for any system GCC, more
>>>> something like if it is major of the configured configure minus 1 or newer
>>>> (or minus 2?), then use -O2, otherwise default to -O0 as before.
>>>
>>> I'd still default to -O0 on release branches regardless of version and then
>>> for development we can probably simply use "any GCC" when people have
>>> the chance to override.
>>
>> Ok, sending new patch that does that on experimental branches for ${CC} --version
>> being a GCC newer than 4.9.
>>
>> Martin
>>
>>>
>>> At least for me host GCC 4.8 works quite well with -O2.
>>>
>>> Richard.
>>>
>>>>         Jakub
>>
>
Loading...