gcc: stop adding -fno-common for checking builds

Message ID 10f5258be165041e2d5bd767fac9e76c08857b0d.1721434919.git.sam@gentoo.org
State New
Headers
Series gcc: stop adding -fno-common for checking builds |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Sam James July 20, 2024, 12:21 a.m. UTC
  Originally added in r0-44646-g204250d2fcd084 and r0-44627-gfd350d241fecf6 whic
moved -fno-common from all builds to just checking builds.

Since r10-4867-g6271dd984d7f92, GCC defaults to -fno-common. There's no need
to pass it specially for checking builds.

We could keep it for older bootstrap compilers with checking but I don't see
much value in that, it was already just a bonus before.

gcc/ChangeLog:
	* Makefile.in (NOCOMMON_FLAG): Delete.
	(GCC_WARN_CFLAGS): Drop NOCOMMON_FLAG.
	(GCC_WARN_CXXFLAGS): Drop NOCOMMON_FLAG.
	* configure.ac: Ditto.
	* configure: Regenerate.

gcc/d/ChangeLog:
	* Make-lang.in (WARN_DFLAGS): Drop NOCOMMON_FLAG.
---
This came out of a discussion with pinskia last year but I punted it
until stage1. Been running with it since then.

 gcc/Makefile.in    | 8 ++------
 gcc/configure      | 8 ++------
 gcc/configure.ac   | 3 ---
 gcc/d/Make-lang.in | 2 +-
 4 files changed, 5 insertions(+), 16 deletions(-)
  

Comments

Andrew Pinski July 20, 2024, 12:30 a.m. UTC | #1
On Fri, Jul 19, 2024 at 5:23 PM Sam James <sam@gentoo.org> wrote:
>
> Originally added in r0-44646-g204250d2fcd084 and r0-44627-gfd350d241fecf6 whic
> moved -fno-common from all builds to just checking builds.
>
> Since r10-4867-g6271dd984d7f92, GCC defaults to -fno-common. There's no need
> to pass it specially for checking builds.
>
> We could keep it for older bootstrap compilers with checking but I don't see
> much value in that, it was already just a bonus before.

Considering -fno-common has almost no effect on C++ code, removing it
fully is a decent thing to do.
It was added back when GCC was written in C and then never removed
when GCC started to build as C++.

Thanks,
Andrew Pinski

>
> gcc/ChangeLog:
>         * Makefile.in (NOCOMMON_FLAG): Delete.
>         (GCC_WARN_CFLAGS): Drop NOCOMMON_FLAG.
>         (GCC_WARN_CXXFLAGS): Drop NOCOMMON_FLAG.
>         * configure.ac: Ditto.
>         * configure: Regenerate.
>
> gcc/d/ChangeLog:
>         * Make-lang.in (WARN_DFLAGS): Drop NOCOMMON_FLAG.
> ---
> This came out of a discussion with pinskia last year but I punted it
> until stage1. Been running with it since then.
>
>  gcc/Makefile.in    | 8 ++------
>  gcc/configure      | 8 ++------
>  gcc/configure.ac   | 3 ---
>  gcc/d/Make-lang.in | 2 +-
>  4 files changed, 5 insertions(+), 16 deletions(-)
>
> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> index f4bb4a88cf31..4fc86ed7938b 100644
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -185,10 +185,6 @@ C_LOOSE_WARN = @c_loose_warn@
>  STRICT_WARN = @strict_warn@
>  C_STRICT_WARN = @c_strict_warn@
>
> -# This is set by --enable-checking.  The idea is to catch forgotten
> -# "extern" tags in header files.
> -NOCOMMON_FLAG = @nocommon_flag@
> -
>  NOEXCEPTION_FLAGS = @noexception_flags@
>
>  ALIASING_FLAGS = @aliasing_flags@
> @@ -215,8 +211,8 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
>  .-warn = $(STRICT_WARN)
>  build-warn = $(STRICT_WARN)
>  rtl-ssa-warn = $(STRICT_WARN)
> -GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
> -GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
> +GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn)
> +GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn)
>
>  # 1 2 3 ... 9999
>  one_to_9999_0:=1 2 3 4 5 6 7 8 9
> diff --git a/gcc/configure b/gcc/configure
> index 4faae0fa5fb8..01acca7fb5cc 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -862,7 +862,6 @@ valgrind_command
>  valgrind_path_defines
>  valgrind_path
>  TREECHECKING
> -nocommon_flag
>  noexception_flags
>  warn_cxxflags
>  warn_cflags
> @@ -7605,17 +7604,14 @@ do
>  done
>  IFS="$ac_save_IFS"
>
> -nocommon_flag=""
>  if test x$ac_checking != x ; then
>
>  $as_echo "#define CHECKING_P 1" >>confdefs.h
>
> -  nocommon_flag=-fno-common
>  else
>    $as_echo "#define CHECKING_P 0" >>confdefs.h
>
>  fi
> -
>  if test x$ac_extra_checking != x ; then
>
>  $as_echo "#define ENABLE_EXTRA_CHECKING 1" >>confdefs.h
> @@ -21410,7 +21406,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 21413 "configure"
> +#line 21409 "configure"
>  #include "confdefs.h"
>
>  #if HAVE_DLFCN_H
> @@ -21516,7 +21512,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 21519 "configure"
> +#line 21515 "configure"
>  #include "confdefs.h"
>
>  #if HAVE_DLFCN_H
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 3da1eaa70646..3f20c107b6aa 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -697,16 +697,13 @@ do
>  done
>  IFS="$ac_save_IFS"
>
> -nocommon_flag=""
>  if test x$ac_checking != x ; then
>    AC_DEFINE(CHECKING_P, 1,
>  [Define to 0/1 if you want more run-time sanity checks.  This one gets a grab
>  bag of miscellaneous but relatively cheap checks.])
> -  nocommon_flag=-fno-common
>  else
>    AC_DEFINE(CHECKING_P, 0)
>  fi
> -AC_SUBST(nocommon_flag)
>  if test x$ac_extra_checking != x ; then
>    AC_DEFINE(ENABLE_EXTRA_CHECKING, 1,
>  [Define to 0/1 if you want extra run-time checking that might affect code
> diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
> index eaea6e039cf7..077668faae64 100644
> --- a/gcc/d/Make-lang.in
> +++ b/gcc/d/Make-lang.in
> @@ -55,7 +55,7 @@ CHECKING_DFLAGS = -frelease
>  else
>  CHECKING_DFLAGS =
>  endif
> -WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG)
> +WARN_DFLAGS = -Wall -Wdeprecated
>
>  # D front-end doesn't use exceptions, but it does require RTTI.
>  NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))
>
> --
> 2.45.2
>
  
Richard Biener July 20, 2024, 6:08 a.m. UTC | #2
> Am 20.07.2024 um 02:31 schrieb Andrew Pinski <pinskia@gmail.com>:
> 
> On Fri, Jul 19, 2024 at 5:23 PM Sam James <sam@gentoo.org> wrote:
>> 
>> Originally added in r0-44646-g204250d2fcd084 and r0-44627-gfd350d241fecf6 whic
>> moved -fno-common from all builds to just checking builds.
>> 
>> Since r10-4867-g6271dd984d7f92, GCC defaults to -fno-common. There's no need
>> to pass it specially for checking builds.
>> 
>> We could keep it for older bootstrap compilers with checking but I don't see
>> much value in that, it was already just a bonus before.
> 
> Considering -fno-common has almost no effect on C++ code, removing it
> fully is a decent thing to do.
> It was added back when GCC was written in C and then never removed
> when GCC started to build as C++.

Ok

Richard 

> Thanks,
> Andrew Pinski
> 
>> 
>> gcc/ChangeLog:
>>        * Makefile.in (NOCOMMON_FLAG): Delete.
>>        (GCC_WARN_CFLAGS): Drop NOCOMMON_FLAG.
>>        (GCC_WARN_CXXFLAGS): Drop NOCOMMON_FLAG.
>>        * configure.ac: Ditto.
>>        * configure: Regenerate.
>> 
>> gcc/d/ChangeLog:
>>        * Make-lang.in (WARN_DFLAGS): Drop NOCOMMON_FLAG.
>> ---
>> This came out of a discussion with pinskia last year but I punted it
>> until stage1. Been running with it since then.
>> 
>> gcc/Makefile.in    | 8 ++------
>> gcc/configure      | 8 ++------
>> gcc/configure.ac   | 3 ---
>> gcc/d/Make-lang.in | 2 +-
>> 4 files changed, 5 insertions(+), 16 deletions(-)
>> 
>> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
>> index f4bb4a88cf31..4fc86ed7938b 100644
>> --- a/gcc/Makefile.in
>> +++ b/gcc/Makefile.in
>> @@ -185,10 +185,6 @@ C_LOOSE_WARN = @c_loose_warn@
>> STRICT_WARN = @strict_warn@
>> C_STRICT_WARN = @c_strict_warn@
>> 
>> -# This is set by --enable-checking.  The idea is to catch forgotten
>> -# "extern" tags in header files.
>> -NOCOMMON_FLAG = @nocommon_flag@
>> -
>> NOEXCEPTION_FLAGS = @noexception_flags@
>> 
>> ALIASING_FLAGS = @aliasing_flags@
>> @@ -215,8 +211,8 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
>> .-warn = $(STRICT_WARN)
>> build-warn = $(STRICT_WARN)
>> rtl-ssa-warn = $(STRICT_WARN)
>> -GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
>> -GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
>> +GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn)
>> +GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn)
>> 
>> # 1 2 3 ... 9999
>> one_to_9999_0:=1 2 3 4 5 6 7 8 9
>> diff --git a/gcc/configure b/gcc/configure
>> index 4faae0fa5fb8..01acca7fb5cc 100755
>> --- a/gcc/configure
>> +++ b/gcc/configure
>> @@ -862,7 +862,6 @@ valgrind_command
>> valgrind_path_defines
>> valgrind_path
>> TREECHECKING
>> -nocommon_flag
>> noexception_flags
>> warn_cxxflags
>> warn_cflags
>> @@ -7605,17 +7604,14 @@ do
>> done
>> IFS="$ac_save_IFS"
>> 
>> -nocommon_flag=""
>> if test x$ac_checking != x ; then
>> 
>> $as_echo "#define CHECKING_P 1" >>confdefs.h
>> 
>> -  nocommon_flag=-fno-common
>> else
>>   $as_echo "#define CHECKING_P 0" >>confdefs.h
>> 
>> fi
>> -
>> if test x$ac_extra_checking != x ; then
>> 
>> $as_echo "#define ENABLE_EXTRA_CHECKING 1" >>confdefs.h
>> @@ -21410,7 +21406,7 @@ else
>>   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>>   lt_status=$lt_dlunknown
>>   cat > conftest.$ac_ext <<_LT_EOF
>> -#line 21413 "configure"
>> +#line 21409 "configure"
>> #include "confdefs.h"
>> 
>> #if HAVE_DLFCN_H
>> @@ -21516,7 +21512,7 @@ else
>>   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>>   lt_status=$lt_dlunknown
>>   cat > conftest.$ac_ext <<_LT_EOF
>> -#line 21519 "configure"
>> +#line 21515 "configure"
>> #include "confdefs.h"
>> 
>> #if HAVE_DLFCN_H
>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>> index 3da1eaa70646..3f20c107b6aa 100644
>> --- a/gcc/configure.ac
>> +++ b/gcc/configure.ac
>> @@ -697,16 +697,13 @@ do
>> done
>> IFS="$ac_save_IFS"
>> 
>> -nocommon_flag=""
>> if test x$ac_checking != x ; then
>>   AC_DEFINE(CHECKING_P, 1,
>> [Define to 0/1 if you want more run-time sanity checks.  This one gets a grab
>> bag of miscellaneous but relatively cheap checks.])
>> -  nocommon_flag=-fno-common
>> else
>>   AC_DEFINE(CHECKING_P, 0)
>> fi
>> -AC_SUBST(nocommon_flag)
>> if test x$ac_extra_checking != x ; then
>>   AC_DEFINE(ENABLE_EXTRA_CHECKING, 1,
>> [Define to 0/1 if you want extra run-time checking that might affect code
>> diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
>> index eaea6e039cf7..077668faae64 100644
>> --- a/gcc/d/Make-lang.in
>> +++ b/gcc/d/Make-lang.in
>> @@ -55,7 +55,7 @@ CHECKING_DFLAGS = -frelease
>> else
>> CHECKING_DFLAGS =
>> endif
>> -WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG)
>> +WARN_DFLAGS = -Wall -Wdeprecated
>> 
>> # D front-end doesn't use exceptions, but it does require RTTI.
>> NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))
>> 
>> --
>> 2.45.2
>>
  
Sam James July 21, 2024, 12:17 p.m. UTC | #3
Richard Biener <richard.guenther@gmail.com> writes:

>> Am 20.07.2024 um 02:31 schrieb Andrew Pinski <pinskia@gmail.com>:
>> 
>> On Fri, Jul 19, 2024 at 5:23 PM Sam James <sam@gentoo.org> wrote:
>>> 
>>> Originally added in r0-44646-g204250d2fcd084 and r0-44627-gfd350d241fecf6 whic
>>> moved -fno-common from all builds to just checking builds.
>>> 
>>> Since r10-4867-g6271dd984d7f92, GCC defaults to -fno-common. There's no need
>>> to pass it specially for checking builds.
>>> 
>>> We could keep it for older bootstrap compilers with checking but I don't see
>>> much value in that, it was already just a bonus before.
>> 
>> Considering -fno-common has almost no effect on C++ code, removing it
>> fully is a decent thing to do.
>> It was added back when GCC was written in C and then never removed
>> when GCC started to build as C++.
>
> Ok

Thank you! Arsen has kindly pushed for me.

>
> Richard 
>
>> Thanks,
>> Andrew Pinski
>> 
>>> 
>>> gcc/ChangeLog:
>>>        * Makefile.in (NOCOMMON_FLAG): Delete.
>>>        (GCC_WARN_CFLAGS): Drop NOCOMMON_FLAG.
>>>        (GCC_WARN_CXXFLAGS): Drop NOCOMMON_FLAG.
>>>        * configure.ac: Ditto.
>>>        * configure: Regenerate.
>>> 
>>> gcc/d/ChangeLog:
>>>        * Make-lang.in (WARN_DFLAGS): Drop NOCOMMON_FLAG.
>>> ---
>>> This came out of a discussion with pinskia last year but I punted it
>>> until stage1. Been running with it since then.
>>> 
>>> gcc/Makefile.in    | 8 ++------
>>> gcc/configure      | 8 ++------
>>> gcc/configure.ac   | 3 ---
>>> gcc/d/Make-lang.in | 2 +-
>>> 4 files changed, 5 insertions(+), 16 deletions(-)
>>> 
>>> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
>>> index f4bb4a88cf31..4fc86ed7938b 100644
>>> --- a/gcc/Makefile.in
>>> +++ b/gcc/Makefile.in
>>> @@ -185,10 +185,6 @@ C_LOOSE_WARN = @c_loose_warn@
>>> STRICT_WARN = @strict_warn@
>>> C_STRICT_WARN = @c_strict_warn@
>>> 
>>> -# This is set by --enable-checking.  The idea is to catch forgotten
>>> -# "extern" tags in header files.
>>> -NOCOMMON_FLAG = @nocommon_flag@
>>> -
>>> NOEXCEPTION_FLAGS = @noexception_flags@
>>> 
>>> ALIASING_FLAGS = @aliasing_flags@
>>> @@ -215,8 +211,8 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
>>> .-warn = $(STRICT_WARN)
>>> build-warn = $(STRICT_WARN)
>>> rtl-ssa-warn = $(STRICT_WARN)
>>> -GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
>>> -GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
>>> +GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn)
>>> +GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn)
>>> 
>>> # 1 2 3 ... 9999
>>> one_to_9999_0:=1 2 3 4 5 6 7 8 9
>>> diff --git a/gcc/configure b/gcc/configure
>>> index 4faae0fa5fb8..01acca7fb5cc 100755
>>> --- a/gcc/configure
>>> +++ b/gcc/configure
>>> @@ -862,7 +862,6 @@ valgrind_command
>>> valgrind_path_defines
>>> valgrind_path
>>> TREECHECKING
>>> -nocommon_flag
>>> noexception_flags
>>> warn_cxxflags
>>> warn_cflags
>>> @@ -7605,17 +7604,14 @@ do
>>> done
>>> IFS="$ac_save_IFS"
>>> 
>>> -nocommon_flag=""
>>> if test x$ac_checking != x ; then
>>> 
>>> $as_echo "#define CHECKING_P 1" >>confdefs.h
>>> 
>>> -  nocommon_flag=-fno-common
>>> else
>>>   $as_echo "#define CHECKING_P 0" >>confdefs.h
>>> 
>>> fi
>>> -
>>> if test x$ac_extra_checking != x ; then
>>> 
>>> $as_echo "#define ENABLE_EXTRA_CHECKING 1" >>confdefs.h
>>> @@ -21410,7 +21406,7 @@ else
>>>   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>>>   lt_status=$lt_dlunknown
>>>   cat > conftest.$ac_ext <<_LT_EOF
>>> -#line 21413 "configure"
>>> +#line 21409 "configure"
>>> #include "confdefs.h"
>>> 
>>> #if HAVE_DLFCN_H
>>> @@ -21516,7 +21512,7 @@ else
>>>   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>>>   lt_status=$lt_dlunknown
>>>   cat > conftest.$ac_ext <<_LT_EOF
>>> -#line 21519 "configure"
>>> +#line 21515 "configure"
>>> #include "confdefs.h"
>>> 
>>> #if HAVE_DLFCN_H
>>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>>> index 3da1eaa70646..3f20c107b6aa 100644
>>> --- a/gcc/configure.ac
>>> +++ b/gcc/configure.ac
>>> @@ -697,16 +697,13 @@ do
>>> done
>>> IFS="$ac_save_IFS"
>>> 
>>> -nocommon_flag=""
>>> if test x$ac_checking != x ; then
>>>   AC_DEFINE(CHECKING_P, 1,
>>> [Define to 0/1 if you want more run-time sanity checks.  This one gets a grab
>>> bag of miscellaneous but relatively cheap checks.])
>>> -  nocommon_flag=-fno-common
>>> else
>>>   AC_DEFINE(CHECKING_P, 0)
>>> fi
>>> -AC_SUBST(nocommon_flag)
>>> if test x$ac_extra_checking != x ; then
>>>   AC_DEFINE(ENABLE_EXTRA_CHECKING, 1,
>>> [Define to 0/1 if you want extra run-time checking that might affect code
>>> diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
>>> index eaea6e039cf7..077668faae64 100644
>>> --- a/gcc/d/Make-lang.in
>>> +++ b/gcc/d/Make-lang.in
>>> @@ -55,7 +55,7 @@ CHECKING_DFLAGS = -frelease
>>> else
>>> CHECKING_DFLAGS =
>>> endif
>>> -WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG)
>>> +WARN_DFLAGS = -Wall -Wdeprecated
>>> 
>>> # D front-end doesn't use exceptions, but it does require RTTI.
>>> NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))
>>> 
>>> --
>>> 2.45.2
>>>
  

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f4bb4a88cf31..4fc86ed7938b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -185,10 +185,6 @@  C_LOOSE_WARN = @c_loose_warn@
 STRICT_WARN = @strict_warn@
 C_STRICT_WARN = @c_strict_warn@
 
-# This is set by --enable-checking.  The idea is to catch forgotten
-# "extern" tags in header files.
-NOCOMMON_FLAG = @nocommon_flag@
-
 NOEXCEPTION_FLAGS = @noexception_flags@
 
 ALIASING_FLAGS = @aliasing_flags@
@@ -215,8 +211,8 @@  VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
 .-warn = $(STRICT_WARN)
 build-warn = $(STRICT_WARN)
 rtl-ssa-warn = $(STRICT_WARN)
-GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
-GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
+GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $($@-warn)
+GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $($@-warn)
 
 # 1 2 3 ... 9999
 one_to_9999_0:=1 2 3 4 5 6 7 8 9
diff --git a/gcc/configure b/gcc/configure
index 4faae0fa5fb8..01acca7fb5cc 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -862,7 +862,6 @@  valgrind_command
 valgrind_path_defines
 valgrind_path
 TREECHECKING
-nocommon_flag
 noexception_flags
 warn_cxxflags
 warn_cflags
@@ -7605,17 +7604,14 @@  do
 done
 IFS="$ac_save_IFS"
 
-nocommon_flag=""
 if test x$ac_checking != x ; then
 
 $as_echo "#define CHECKING_P 1" >>confdefs.h
 
-  nocommon_flag=-fno-common
 else
   $as_echo "#define CHECKING_P 0" >>confdefs.h
 
 fi
-
 if test x$ac_extra_checking != x ; then
 
 $as_echo "#define ENABLE_EXTRA_CHECKING 1" >>confdefs.h
@@ -21410,7 +21406,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 21413 "configure"
+#line 21409 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -21516,7 +21512,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 21519 "configure"
+#line 21515 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 3da1eaa70646..3f20c107b6aa 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -697,16 +697,13 @@  do
 done
 IFS="$ac_save_IFS"
 
-nocommon_flag=""
 if test x$ac_checking != x ; then
   AC_DEFINE(CHECKING_P, 1,
 [Define to 0/1 if you want more run-time sanity checks.  This one gets a grab
 bag of miscellaneous but relatively cheap checks.])
-  nocommon_flag=-fno-common
 else
   AC_DEFINE(CHECKING_P, 0)
 fi
-AC_SUBST(nocommon_flag)
 if test x$ac_extra_checking != x ; then
   AC_DEFINE(ENABLE_EXTRA_CHECKING, 1,
 [Define to 0/1 if you want extra run-time checking that might affect code
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index eaea6e039cf7..077668faae64 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -55,7 +55,7 @@  CHECKING_DFLAGS = -frelease
 else
 CHECKING_DFLAGS =
 endif
-WARN_DFLAGS = -Wall -Wdeprecated $(NOCOMMON_FLAG)
+WARN_DFLAGS = -Wall -Wdeprecated
 
 # D front-end doesn't use exceptions, but it does require RTTI.
 NOEXCEPTION_DFLAGS = $(filter-out -fno-rtti, $(NOEXCEPTION_FLAGS))