* [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
@ 2017-05-25 9:26 Martin Liška
2017-05-26 11:47 ` Richard Biener
2017-05-29 11:35 ` Eric Botcazou
0 siblings, 2 replies; 17+ messages in thread
From: Martin Liška @ 2017-05-25 9:26 UTC (permalink / raw)
To: GCC Patches; +Cc: Jakub Jelinek, Richard Biener
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
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
[-- Attachment #2: 0001-Introduce-configure-flag-with-stage1-cflags.patch --]
[-- Type: text/x-patch, Size: 4008 bytes --]
From 5c44f79237125ad2bc29fcd1fb06a249c05b277d Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 25 May 2017 11:17:29 +0200
Subject: [PATCH] Introduce configure flag --with-stage1-cflags.
ChangeLog:
2017-05-25 Martin Liska <mliska@suse.cz>
* configure.ac: Introduce configure flag --with-stage1-cflags.
* configure: Regenerate.
---
configure | 40 +++++++++++++++++++++++++++-------------
configure.ac | 31 +++++++++++++++++++------------
2 files changed, 46 insertions(+), 25 deletions(-)
diff --git a/configure b/configure
index 2c2fe644cfa..442f78d9565 100755
--- a/configure
+++ b/configure
@@ -559,7 +559,6 @@ compare_exclusions
host_shared
stage2_werror_flag
stage1_checking
-stage1_cflags
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -652,6 +651,7 @@ isllibs
poststage1_ldflags
poststage1_libs
stage1_ldflags
+stage1_cflags
stage1_libs
extra_isl_gmp_configure_flags
extra_mpc_mpfr_configure_flags
@@ -771,6 +771,7 @@ with_gmp
with_gmp_include
with_gmp_lib
with_stage1_libs
+with_stage1_cflags
with_stage1_ldflags
with_boot_libs
with_boot_ldflags
@@ -1542,6 +1543,8 @@ Optional Packages:
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library
--with-stage1-libs=LIBS libraries for stage1
+ --with-stage1-cflags=FLAGS
+ compiler flags for stage1
--with-stage1-ldflags=FLAGS
linker flags for stage1
--with-boot-libs=LIBS libraries for stage2 and later
@@ -5804,6 +5807,29 @@ fi
+# Compiler flags to use for stage1 or when not bootstrapping.
+
+# Check whether --with-stage1-cflags was given.
+if test "${with_stage1_cflags+set}" = set; then :
+ withval=$with_stage1_cflags; if test "$withval" = "no" -o "$withval" = "yes"; then
+ stage1_cflags=
+ else
+ stage1_cflags=$withval
+ fi
+else
+ stage1_cflags="-g"
+ case $build in
+ vax-*-*)
+ case ${GCC} in
+ yes) stage1_cflags="-g -Wa,-J" ;;
+ *) stage1_cflags="-g -J" ;;
+ esac ;;
+ esac
+fi
+
+
+
+
# Linker flags to use for stage1 or when not bootstrapping.
# Check whether --with-stage1-ldflags was given.
@@ -14544,18 +14570,6 @@ MAINT=$MAINTAINER_MODE_TRUE
# GCC bootstrap support
# ---------------------
-# Stage specific cflags for build.
-stage1_cflags="-g"
-case $build in
- vax-*-*)
- case ${GCC} in
- yes) stage1_cflags="-g -Wa,-J" ;;
- *) stage1_cflags="-g -J" ;;
- esac ;;
-esac
-
-
-
# Enable --enable-checking in stage1 of the compiler.
# Check whether --enable-stage1-checking was given.
if test "${enable_stage1_checking+set}" = set; then :
diff --git a/configure.ac b/configure.ac
index 865dd543fa3..7b7902240c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1637,6 +1637,25 @@ AC_ARG_WITH(stage1-libs,
[stage1_libs=])
AC_SUBST(stage1_libs)
+# Compiler flags to use for stage1 or when not bootstrapping.
+AC_ARG_WITH(stage1-cflags,
+[AS_HELP_STRING([--with-stage1-cflags=FLAGS], [compiler flags for stage1])],
+[if test "$withval" = "no" -o "$withval" = "yes"; then
+ stage1_cflags=
+ else
+ stage1_cflags=$withval
+ fi],
+[stage1_cflags="-g"
+ case $build in
+ vax-*-*)
+ case ${GCC} in
+ yes) stage1_cflags="-g -Wa,-J" ;;
+ *) stage1_cflags="-g -J" ;;
+ esac ;;
+ esac])
+
+AC_SUBST(stage1_cflags)
+
# Linker flags to use for stage1 or when not bootstrapping.
AC_ARG_WITH(stage1-ldflags,
[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
@@ -3421,18 +3440,6 @@ AC_SUBST(MAINT)dnl
# GCC bootstrap support
# ---------------------
-# Stage specific cflags for build.
-stage1_cflags="-g"
-case $build in
- vax-*-*)
- case ${GCC} in
- yes) stage1_cflags="-g -Wa,-J" ;;
- *) stage1_cflags="-g -J" ;;
- esac ;;
-esac
-
-AC_SUBST(stage1_cflags)
-
# Enable --enable-checking in stage1 of the compiler.
AC_ARG_ENABLE(stage1-checking,
[AS_HELP_STRING([[--enable-stage1-checking[=all]]],
--
2.12.2
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-25 9:26 [RFC] [PATCH] Introduce configure flag --with-stage1-cflags Martin Liška
@ 2017-05-26 11:47 ` Richard Biener
2017-05-26 11:55 ` Jakub Jelinek
2017-05-29 11:35 ` Eric Botcazou
1 sibling, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-05-26 11:47 UTC (permalink / raw)
To: Martin Liška; +Cc: GCC Patches, Jakub Jelinek
On Thu, May 25, 2017 at 11:23 AM, Martin Liška <mliska@suse.cz> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-26 11:47 ` Richard Biener
@ 2017-05-26 11:55 ` Jakub Jelinek
2017-05-26 11:59 ` Richard Biener
0 siblings, 1 reply; 17+ messages in thread
From: Jakub Jelinek @ 2017-05-26 11:55 UTC (permalink / raw)
To: Richard Biener; +Cc: Martin Liška, GCC Patches
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 <mliska@suse.cz> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-26 11:55 ` Jakub Jelinek
@ 2017-05-26 11:59 ` Richard Biener
2017-05-26 13:02 ` Martin Liška
0 siblings, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-05-26 11:59 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Martin Liška, GCC Patches
On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <jakub@redhat.com> 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 <mliska@suse.cz> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-26 11:59 ` Richard Biener
@ 2017-05-26 13:02 ` Martin Liška
2017-05-26 13:19 ` Martin Liška
2017-06-19 10:51 ` Martin Liška
0 siblings, 2 replies; 17+ messages in thread
From: Martin Liška @ 2017-05-26 13:02 UTC (permalink / raw)
To: Richard Biener, Jakub Jelinek; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]
On 05/26/2017 01:55 PM, Richard Biener wrote:
> On Fri, May 26, 2017 at 1:51 PM, Jakub Jelinek <jakub@redhat.com> 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 <mliska@suse.cz> 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
[-- Attachment #2: 0001-Add-O2-to-stage1_cflags-for-experimental-branch.patch --]
[-- Type: text/x-patch, Size: 3017 bytes --]
From 56acea8345eaa0961f12bfc2383c14676054665d Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 26 May 2017 14:58:39 +0200
Subject: [PATCH] Add -O2 to stage1_cflags for experimental branch.
ChangeLog:
2017-05-26 Martin Liska <mliska@suse.cz>
* configure.ac: Add -O2 to stage1_cflags for experimental branch.
* configure: Regenerate.
---
configure | 23 +++++++++++++++++++++++
configure.ac | 21 +++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/configure b/configure
index 82aa619fad1..079bad6bf34 100755
--- a/configure
+++ b/configure
@@ -7080,6 +7080,24 @@ fi
$as_echo "$BUILD_CONFIG" >&6; }
+# Detect if compiler is GCC >= 4.8.x
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CC is recent compiler" >&5
+$as_echo_n "checking CC is recent compiler... " >&6; }
+cc_is_recent_gcc=
+version_output=`${CC} -v 2>&1 | grep 'gcc version'`
+
+if test "x${version_output}" != x; then
+ version=`echo ${version_output} | sed 's/gcc version \([^ ]*\).*/\\1/'`
+ major=`echo ${version} | cut -d. -f1`
+ minor=`echo ${version} | cut -d. -f2`
+
+ if test "${major}" -ge 5 || ( test "${major}" -eq 4 && test "${minor}" -ge 8 ); then
+ cc_is_recent_gcc=yes
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_is_recent_gcc" >&5
+$as_echo "$cc_is_recent_gcc" >&6; }
+
# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-vtable-verify" >&5
$as_echo_n "checking for --enable-vtable-verify... " >&6; }
@@ -14655,6 +14673,11 @@ if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental;
"")
stage2_werror_flag="--enable-werror-always" ;;
esac
+
+ if test "$cc_is_recent_gcc" = "yes"; then
+ stage1_cflags="$stage1_cflags -O2"
+
+ fi
fi
diff --git a/configure.ac b/configure.ac
index 78d2d593106..d312e2e8347 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2667,6 +2667,22 @@ fi
AC_MSG_RESULT($BUILD_CONFIG)
AC_SUBST(BUILD_CONFIG)
+# Detect if compiler is GCC >= 4.8.x
+AC_MSG_CHECKING(CC is recent compiler)
+cc_is_recent_gcc=
+version_output=`${CC} -v 2>&1 | grep 'gcc version'`
+
+if test "x${version_output}" != x; then
+ version=`echo ${version_output} | sed 's/gcc version \([[^ ]]*\).*/\\1/'`
+ major=`echo ${version} | cut -d. -f1`
+ minor=`echo ${version} | cut -d. -f2`
+
+ if test "${major}" -ge 5 || ( test "${major}" -eq 4 && test "${minor}" -ge 8 ); then
+ cc_is_recent_gcc=yes
+ fi
+fi
+AC_MSG_RESULT($cc_is_recent_gcc)
+
# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
AC_MSG_CHECKING([for --enable-vtable-verify])
AC_ARG_ENABLE(vtable-verify,
@@ -3521,6 +3537,11 @@ if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental;
"")
stage2_werror_flag="--enable-werror-always" ;;
esac
+
+ if test "$cc_is_recent_gcc" = "yes"; then
+ stage1_cflags="$stage1_cflags -O2"
+ AC_SUBST(stage1_cflags)
+ fi
fi
AC_SUBST(stage2_werror_flag)
--
2.12.2
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-26 13:02 ` Martin Liška
@ 2017-05-26 13:19 ` Martin Liška
2017-06-19 10:51 ` Martin Liška
1 sibling, 0 replies; 17+ messages in thread
From: Martin Liška @ 2017-05-26 13:19 UTC (permalink / raw)
To: Richard Biener, Jakub Jelinek; +Cc: GCC Patches
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/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-26 13:02 ` Martin Liška
2017-05-26 13:19 ` Martin Liška
@ 2017-06-19 10:51 ` Martin Liška
2017-06-19 12:30 ` Richard Biener
1 sibling, 1 reply; 17+ messages in thread
From: Martin Liška @ 2017-06-19 10:51 UTC (permalink / raw)
To: Richard Biener, Jakub Jelinek; +Cc: GCC Patches
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 <jakub@redhat.com> 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 <mliska@suse.cz> 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
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-06-19 10:51 ` Martin Liška
@ 2017-06-19 12:30 ` Richard Biener
2017-07-31 7:48 ` Martin Liška
0 siblings, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-06-19 12:30 UTC (permalink / raw)
To: Martin Liška; +Cc: Jakub Jelinek, GCC Patches
On Mon, Jun 19, 2017 at 12:51 PM, Martin Liška <mliska@suse.cz> 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 <jakub@redhat.com> 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 <mliska@suse.cz> 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
>>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-06-19 12:30 ` Richard Biener
@ 2017-07-31 7:48 ` Martin Liška
2017-08-25 20:49 ` Jeff Law
0 siblings, 1 reply; 17+ messages in thread
From: Martin Liška @ 2017-07-31 7:48 UTC (permalink / raw)
To: Richard Biener; +Cc: Jakub Jelinek, GCC Patches
I would like to ping this. Input from other people will be appreciated ;)
Thanks,
Martin
On 06/19/2017 02:30 PM, Richard Biener wrote:
> On Mon, Jun 19, 2017 at 12:51 PM, Martin Liška <mliska@suse.cz> 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 <jakub@redhat.com> 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 <mliska@suse.cz> 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
>>>
>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-07-31 7:48 ` Martin Liška
@ 2017-08-25 20:49 ` Jeff Law
2017-08-28 12:55 ` Richard Biener
0 siblings, 1 reply; 17+ messages in thread
From: Jeff Law @ 2017-08-25 20:49 UTC (permalink / raw)
To: Martin Liška, Richard Biener; +Cc: Jakub Jelinek, GCC Patches
On 07/31/2017 01:47 AM, Martin Liška wrote:
> I would like to ping this. Input from other people will be appreciated ;)
I think the thing to keep in mind here is that IIUC this only affects
things when we've configured using the --with-stage1-cflags option.
So questions about is -O1 more stable than -O2, should we restrict -O2
to newer compilers, etc are really more about the defaults we set.
My understanding is the patch is just adding the capability and does not
change the default. Assuming that's the case, then I'm comfortable
acking the raw infrastructure.
jeff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-08-25 20:49 ` Jeff Law
@ 2017-08-28 12:55 ` Richard Biener
2017-08-30 12:19 ` Martin Liška
0 siblings, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-08-28 12:55 UTC (permalink / raw)
To: Jeff Law; +Cc: Martin Liška, Jakub Jelinek, GCC Patches
On Fri, Aug 25, 2017 at 9:51 PM, Jeff Law <law@redhat.com> wrote:
> On 07/31/2017 01:47 AM, Martin Liška wrote:
>> I would like to ping this. Input from other people will be appreciated ;)
> I think the thing to keep in mind here is that IIUC this only affects
> things when we've configured using the --with-stage1-cflags option.
>
> So questions about is -O1 more stable than -O2, should we restrict -O2
> to newer compilers, etc are really more about the defaults we set.
>
> My understanding is the patch is just adding the capability and does not
> change the default. Assuming that's the case, then I'm comfortable
> acking the raw infrastructure.
OTOH you can simply set STAGE1_CFLAGS so the value of this
as a configure option is somewhat questionable.
> jeff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-08-28 12:55 ` Richard Biener
@ 2017-08-30 12:19 ` Martin Liška
0 siblings, 0 replies; 17+ messages in thread
From: Martin Liška @ 2017-08-30 12:19 UTC (permalink / raw)
To: Richard Biener, Jeff Law; +Cc: Jakub Jelinek, GCC Patches
On 08/28/2017 02:24 PM, Richard Biener wrote:
> On Fri, Aug 25, 2017 at 9:51 PM, Jeff Law <law@redhat.com> wrote:
>> On 07/31/2017 01:47 AM, Martin Liška wrote:
>>> I would like to ping this. Input from other people will be appreciated ;)
>> I think the thing to keep in mind here is that IIUC this only affects
>> things when we've configured using the --with-stage1-cflags option.
>>
>> So questions about is -O1 more stable than -O2, should we restrict -O2
>> to newer compilers, etc are really more about the defaults we set.
>>
>> My understanding is the patch is just adding the capability and does not
>> change the default. Assuming that's the case, then I'm comfortable
>> acking the raw infrastructure.
>
> OTOH you can simply set STAGE1_CFLAGS so the value of this
> as a configure option is somewhat questionable.
Yes, STAGE1_CFLAGS is a working solution. I'm not planning to install the patch.
Martin
>
>> jeff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-25 9:26 [RFC] [PATCH] Introduce configure flag --with-stage1-cflags Martin Liška
2017-05-26 11:47 ` Richard Biener
@ 2017-05-29 11:35 ` Eric Botcazou
2017-05-30 7:00 ` Richard Biener
1 sibling, 1 reply; 17+ messages in thread
From: Eric Botcazou @ 2017-05-29 11:35 UTC (permalink / raw)
To: Martin Liška; +Cc: gcc-patches, Jakub Jelinek, Richard Biener
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-29 11:35 ` Eric Botcazou
@ 2017-05-30 7:00 ` Richard Biener
2017-05-30 10:30 ` Eric Botcazou
0 siblings, 1 reply; 17+ messages in thread
From: Richard Biener @ 2017-05-30 7:00 UTC (permalink / raw)
To: Eric Botcazou; +Cc: Martin Liška, GCC Patches, Jakub Jelinek
On Mon, May 29, 2017 at 1:13 PM, Eric Botcazou <ebotcazou@adacore.com> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-30 7:00 ` Richard Biener
@ 2017-05-30 10:30 ` Eric Botcazou
2017-05-30 10:33 ` Martin Liška
0 siblings, 1 reply; 17+ messages in thread
From: Eric Botcazou @ 2017-05-30 10:30 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches, Martin Liška, Jakub Jelinek
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC] [PATCH] Introduce configure flag --with-stage1-cflags.
2017-05-30 10:30 ` Eric Botcazou
@ 2017-05-30 10:33 ` Martin Liška
2017-05-30 11:12 ` Eric Botcazou
0 siblings, 1 reply; 17+ messages in thread
From: Martin Liška @ 2017-05-30 10:33 UTC (permalink / raw)
To: Eric Botcazou, Richard Biener; +Cc: gcc-patches, Jakub Jelinek
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
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-08-30 10:45 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 9:26 [RFC] [PATCH] Introduce configure flag --with-stage1-cflags Martin Liška
2017-05-26 11:47 ` Richard Biener
2017-05-26 11:55 ` Jakub Jelinek
2017-05-26 11:59 ` Richard Biener
2017-05-26 13:02 ` Martin Liška
2017-05-26 13:19 ` Martin Liška
2017-06-19 10:51 ` Martin Liška
2017-06-19 12:30 ` Richard Biener
2017-07-31 7:48 ` Martin Liška
2017-08-25 20:49 ` Jeff Law
2017-08-28 12:55 ` Richard Biener
2017-08-30 12:19 ` Martin Liška
2017-05-29 11:35 ` Eric Botcazou
2017-05-30 7:00 ` Richard Biener
2017-05-30 10:30 ` Eric Botcazou
2017-05-30 10:33 ` Martin Liška
2017-05-30 11:12 ` Eric Botcazou
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).