Re: [PATCH 1/2] (header usage fix) remove unused system header includes

2017-09-18 Thread Mike Stump
I was hoping an RM would approve this as it seems just a hair beyond a normal 
darwin approval.  I'm fine with this, and it does help darwin.  Other ports 
should not care.

On Sep 18, 2017, at 10:30 AM, Jack Howarth  wrote:
> 
> Pinging for the final gcc 5.5 release.
> 
> On Mon, Aug 7, 2017 at 1:12 AM, Ryan Mounce  wrote:
>> 2017-08-05  Ryan Mounce  
>> 
>>cherry picked from trunk r235361
>>2016-04-22  Szabolcs Nagy  
>> 
>>* auto-profile.c: Remove  include.
>>* diagnostic.c: Remove  include.
>>* genmatch.c: Likewise.
>>* pretty-print.c: Likewise.
>>* toplev.c: Likewise
>>* c/c-objc-common.c: Likewise.
>>* cp/error.c: Likewise.
>>* fortran/error.c: Likewise.
>> ---
>> gcc/ChangeLog | 14 ++
>> gcc/auto-profile.c|  1 -
>> gcc/c/c-objc-common.c |  2 --
>> gcc/cp/error.c|  2 --
>> gcc/diagnostic.c  |  2 --
>> gcc/fortran/error.c   |  2 --
>> gcc/genmatch.c|  1 -
>> gcc/pretty-print.c|  2 --
>> gcc/toplev.c  |  2 --
>> 9 files changed, 14 insertions(+), 14 deletions(-)
>> 
>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>> index 3b431ce83f4..f3280917ad8 100644
>> --- a/gcc/ChangeLog
>> +++ b/gcc/ChangeLog
>> @@ -1,3 +1,17 @@
>> +2017-08-05  Ryan Mounce  
>> +
>> +   Backport from mainline
>> +   2016-04-22  Szabolcs Nagy  
>> +
>> +   * auto-profile.c: Remove  include.
>> +   * diagnostic.c: Remove  include.
>> +   * genmatch.c: Likewise.
>> +   * pretty-print.c: Likewise.
>> +   * toplev.c: Likewise
>> +   * c/c-objc-common.c: Likewise.
>> +   * cp/error.c: Likewise.
>> +   * fortran/error.c: Likewise.
>> +
>> 2017-07-31  Jakub Jelinek  
>> 
>>PR sanitizer/81604
>> diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
>> index b8b02d174b4..a5e7225e338 100644
>> --- a/gcc/auto-profile.c
>> +++ b/gcc/auto-profile.c
>> @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3.  If not see
>> #include "config.h"
>> #include "system.h"
>> 
>> -#include 
>> #include 
>> #include 
>> 
>> diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c
>> index 344d4e2949c..c1ec601f93c 100644
>> --- a/gcc/c/c-objc-common.c
>> +++ b/gcc/c/c-objc-common.c
>> @@ -38,8 +38,6 @@ along with GCC; see the file COPYING3.  If not see
>> #include "langhooks.h"
>> #include "c-objc-common.h"
>> 
>> -#include   // For placement new.
>> -
>> static bool c_tree_printer (pretty_printer *, text_info *, const char *,
>>int, bool, bool, bool);
>> 
>> diff --git a/gcc/cp/error.c b/gcc/cp/error.c
>> index 0c8bd66a325..f502127f34f 100644
>> --- a/gcc/cp/error.c
>> +++ b/gcc/cp/error.c
>> @@ -44,8 +44,6 @@ along with GCC; see the file COPYING3.  If not see
>> #include "ubsan.h"
>> #include "internal-fn.h"
>> 
>> -#include // For placement-new.
>> -
>> #define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
>> #define pp_separate_with_semicolon(PP) pp_cxx_separate_with (PP, ';')
>> 
>> diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
>> index c43162269ec..1c3815c9f3d 100644
>> --- a/gcc/diagnostic.c
>> +++ b/gcc/diagnostic.c
>> @@ -41,8 +41,6 @@ along with GCC; see the file COPYING3.  If not see
>> # include 
>> #endif
>> 
>> -#include  // For placement new.
>> -
>> #define pedantic_warning_kind(DC)  \
>>   ((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
>> #define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
>> diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
>> index 18e127f8748..2f76de50c9e 100644
>> --- a/gcc/fortran/error.c
>> +++ b/gcc/fortran/error.c
>> @@ -34,8 +34,6 @@ along with GCC; see the file COPYING3.  If not see
>> #include "diagnostic-color.h"
>> #include "tree-diagnostic.h" /* tree_diagnostics_defaults */
>> 
>> -#include  /* For placement-new */
>> -
>> static int suppress_errors = 0;
>> 
>> static bool warnings_not_errors = false;
>> diff --git a/gcc/genmatch.c b/gcc/genmatch.c
>> index 8f94ff09263..8f495616e2e 100644
>> --- a/gcc/genmatch.c
>> +++ b/gcc/genmatch.c
>> @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
>> .  */
>> 
>> #include "bconfig.h"
>> -#include 
>> #include "system.h"
>> #include "coretypes.h"
>> #include "ggc.h"
>> diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
>> index 78d334eae88..6881d1aeabe 100644
>> --- a/gcc/pretty-print.c
>> +++ b/gcc/pretty-print.c
>> @@ -25,8 +25,6 @@ along with GCC; see the file COPYING3.  If not see
>> #include "pretty-print.h"
>> #include "diagnostic-color.h"
>> 
>> -#include // For placement-new.
>> -
>> #if HAVE_ICONV
>> #include 
>> #endif
>> diff --git a/gcc/toplev.c b/gcc/toplev.c
>> index 17d05121026..237e24ef34e 100644
>> 

Re: [PATCH 1/2] (header usage fix) remove unused system header includes

2017-09-18 Thread Jack Howarth
Pinging for the final gcc 5.5 release.

On Mon, Aug 7, 2017 at 1:12 AM, Ryan Mounce  wrote:
> 2017-08-05  Ryan Mounce  
>
> cherry picked from trunk r235361
> 2016-04-22  Szabolcs Nagy  
>
> * auto-profile.c: Remove  include.
> * diagnostic.c: Remove  include.
> * genmatch.c: Likewise.
> * pretty-print.c: Likewise.
> * toplev.c: Likewise
> * c/c-objc-common.c: Likewise.
> * cp/error.c: Likewise.
> * fortran/error.c: Likewise.
> ---
>  gcc/ChangeLog | 14 ++
>  gcc/auto-profile.c|  1 -
>  gcc/c/c-objc-common.c |  2 --
>  gcc/cp/error.c|  2 --
>  gcc/diagnostic.c  |  2 --
>  gcc/fortran/error.c   |  2 --
>  gcc/genmatch.c|  1 -
>  gcc/pretty-print.c|  2 --
>  gcc/toplev.c  |  2 --
>  9 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 3b431ce83f4..f3280917ad8 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,17 @@
> +2017-08-05  Ryan Mounce  
> +
> +   Backport from mainline
> +   2016-04-22  Szabolcs Nagy  
> +
> +   * auto-profile.c: Remove  include.
> +   * diagnostic.c: Remove  include.
> +   * genmatch.c: Likewise.
> +   * pretty-print.c: Likewise.
> +   * toplev.c: Likewise
> +   * c/c-objc-common.c: Likewise.
> +   * cp/error.c: Likewise.
> +   * fortran/error.c: Likewise.
> +
>  2017-07-31  Jakub Jelinek  
>
> PR sanitizer/81604
> diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
> index b8b02d174b4..a5e7225e338 100644
> --- a/gcc/auto-profile.c
> +++ b/gcc/auto-profile.c
> @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "config.h"
>  #include "system.h"
>
> -#include 
>  #include 
>  #include 
>
> diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c
> index 344d4e2949c..c1ec601f93c 100644
> --- a/gcc/c/c-objc-common.c
> +++ b/gcc/c/c-objc-common.c
> @@ -38,8 +38,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "langhooks.h"
>  #include "c-objc-common.h"
>
> -#include   // For placement new.
> -
>  static bool c_tree_printer (pretty_printer *, text_info *, const char *,
> int, bool, bool, bool);
>
> diff --git a/gcc/cp/error.c b/gcc/cp/error.c
> index 0c8bd66a325..f502127f34f 100644
> --- a/gcc/cp/error.c
> +++ b/gcc/cp/error.c
> @@ -44,8 +44,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "ubsan.h"
>  #include "internal-fn.h"
>
> -#include // For placement-new.
> -
>  #define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
>  #define pp_separate_with_semicolon(PP) pp_cxx_separate_with (PP, ';')
>
> diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
> index c43162269ec..1c3815c9f3d 100644
> --- a/gcc/diagnostic.c
> +++ b/gcc/diagnostic.c
> @@ -41,8 +41,6 @@ along with GCC; see the file COPYING3.  If not see
>  # include 
>  #endif
>
> -#include  // For placement new.
> -
>  #define pedantic_warning_kind(DC)  \
>((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
>  #define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
> diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
> index 18e127f8748..2f76de50c9e 100644
> --- a/gcc/fortran/error.c
> +++ b/gcc/fortran/error.c
> @@ -34,8 +34,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "diagnostic-color.h"
>  #include "tree-diagnostic.h" /* tree_diagnostics_defaults */
>
> -#include  /* For placement-new */
> -
>  static int suppress_errors = 0;
>
>  static bool warnings_not_errors = false;
> diff --git a/gcc/genmatch.c b/gcc/genmatch.c
> index 8f94ff09263..8f495616e2e 100644
> --- a/gcc/genmatch.c
> +++ b/gcc/genmatch.c
> @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
>  .  */
>
>  #include "bconfig.h"
> -#include 
>  #include "system.h"
>  #include "coretypes.h"
>  #include "ggc.h"
> diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
> index 78d334eae88..6881d1aeabe 100644
> --- a/gcc/pretty-print.c
> +++ b/gcc/pretty-print.c
> @@ -25,8 +25,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "pretty-print.h"
>  #include "diagnostic-color.h"
>
> -#include // For placement-new.
> -
>  #if HAVE_ICONV
>  #include 
>  #endif
> diff --git a/gcc/toplev.c b/gcc/toplev.c
> index 17d05121026..237e24ef34e 100644
> --- a/gcc/toplev.c
> +++ b/gcc/toplev.c
> @@ -135,8 +135,6 @@ along with GCC; see the file COPYING3.  If not see
>  #define HAVE_prologue 0
>  #endif
>
> -#include 
> -
>  static void general_init (const char *, bool);
>  static void do_compile ();
>  static void process_options (void);
> --
> 2.13.2 (Apple Git-90)
>


[PATCH 1/2] (header usage fix) remove unused system header includes

2017-08-06 Thread Ryan Mounce
2017-08-05  Ryan Mounce  

cherry picked from trunk r235361
2016-04-22  Szabolcs Nagy  

* auto-profile.c: Remove  include.
* diagnostic.c: Remove  include.
* genmatch.c: Likewise.
* pretty-print.c: Likewise.
* toplev.c: Likewise
* c/c-objc-common.c: Likewise.
* cp/error.c: Likewise.
* fortran/error.c: Likewise.
---
 gcc/ChangeLog | 14 ++
 gcc/auto-profile.c|  1 -
 gcc/c/c-objc-common.c |  2 --
 gcc/cp/error.c|  2 --
 gcc/diagnostic.c  |  2 --
 gcc/fortran/error.c   |  2 --
 gcc/genmatch.c|  1 -
 gcc/pretty-print.c|  2 --
 gcc/toplev.c  |  2 --
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3b431ce83f4..f3280917ad8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2017-08-05  Ryan Mounce  
+
+   Backport from mainline
+   2016-04-22  Szabolcs Nagy  
+
+   * auto-profile.c: Remove  include.
+   * diagnostic.c: Remove  include.
+   * genmatch.c: Likewise.
+   * pretty-print.c: Likewise.
+   * toplev.c: Likewise
+   * c/c-objc-common.c: Likewise.
+   * cp/error.c: Likewise.
+   * fortran/error.c: Likewise.
+
 2017-07-31  Jakub Jelinek  
 
PR sanitizer/81604
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index b8b02d174b4..a5e7225e338 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 
-#include 
 #include 
 #include 
 
diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c
index 344d4e2949c..c1ec601f93c 100644
--- a/gcc/c/c-objc-common.c
+++ b/gcc/c/c-objc-common.c
@@ -38,8 +38,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "c-objc-common.h"
 
-#include   // For placement new.
-
 static bool c_tree_printer (pretty_printer *, text_info *, const char *,
int, bool, bool, bool);
 
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 0c8bd66a325..f502127f34f 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -44,8 +44,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ubsan.h"
 #include "internal-fn.h"
 
-#include // For placement-new.
-
 #define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
 #define pp_separate_with_semicolon(PP) pp_cxx_separate_with (PP, ';')
 
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c43162269ec..1c3815c9f3d 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -41,8 +41,6 @@ along with GCC; see the file COPYING3.  If not see
 # include 
 #endif
 
-#include  // For placement new.
-
 #define pedantic_warning_kind(DC)  \
   ((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
 #define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 18e127f8748..2f76de50c9e 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -34,8 +34,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-color.h"
 #include "tree-diagnostic.h" /* tree_diagnostics_defaults */
 
-#include  /* For placement-new */
-
 static int suppress_errors = 0;
 
 static bool warnings_not_errors = false;
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 8f94ff09263..8f495616e2e 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
 .  */
 
 #include "bconfig.h"
-#include 
 #include "system.h"
 #include "coretypes.h"
 #include "ggc.h"
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 78d334eae88..6881d1aeabe 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -25,8 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "pretty-print.h"
 #include "diagnostic-color.h"
 
-#include // For placement-new.
-
 #if HAVE_ICONV
 #include 
 #endif
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 17d05121026..237e24ef34e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -135,8 +135,6 @@ along with GCC; see the file COPYING3.  If not see
 #define HAVE_prologue 0
 #endif
 
-#include 
-
 static void general_init (const char *, bool);
 static void do_compile ();
 static void process_options (void);
-- 
2.13.2 (Apple Git-90)



Re: [PATCH 1/2] (header usage fix) remove unused system header includes

2016-04-22 Thread Richard Biener
On Fri, Apr 22, 2016 at 12:02 PM, Szabolcs Nagy  wrote:
> These headers include "system.h" which already includes
>  and  so including them after "system.h"
> is a noop and including them before may cause problems
> if they depend on gcc macros from system.h.
>
> ipa-icf-gimple.c includes  after system.h which
> poisons various libc symbols which may cause problems
> and it is not used at all.
>
> Tested together with PATCH 2/2.
>
> OK for trunk?

Ok.

Thanks,
Richard.

> gcc/ChangeLog:
>
> 2016-04-22  Szabolcs Nagy  
>
> * auto-profile.c: Remove  include.
> * ipa-icf-gimple.c: Remove  include.
> * diagnostic.c: Remove  include.
> * genmatch.c: Likewise.
> * pretty-print.c: Likewise.
> * toplev.c: Likewise
> * c/c-objc-common.c: Likewise.
> * cp/error.c: Likewise.
> * fortran/error.c: Likewise.


[PATCH 1/2] (header usage fix) remove unused system header includes

2016-04-22 Thread Szabolcs Nagy
These headers include "system.h" which already includes
 and  so including them after "system.h"
is a noop and including them before may cause problems
if they depend on gcc macros from system.h.

ipa-icf-gimple.c includes  after system.h which
poisons various libc symbols which may cause problems
and it is not used at all.

Tested together with PATCH 2/2.

OK for trunk?

gcc/ChangeLog:

2016-04-22  Szabolcs Nagy  

* auto-profile.c: Remove  include.
* ipa-icf-gimple.c: Remove  include.
* diagnostic.c: Remove  include.
* genmatch.c: Likewise.
* pretty-print.c: Likewise.
* toplev.c: Likewise
* c/c-objc-common.c: Likewise.
* cp/error.c: Likewise.
* fortran/error.c: Likewise.
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 5c0640a..0c726bd 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "gcov-io.h"
 #include "diagnostic-core.h"
 
-#include 
 #include 
 #include 
 
diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c
index 18247af..20dc024 100644
--- a/gcc/c/c-objc-common.c
+++ b/gcc/c/c-objc-common.c
@@ -27,8 +27,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "c-objc-common.h"
 
-#include   // For placement new.
-
 static bool c_tree_printer (pretty_printer *, text_info *, const char *,
 			int, bool, bool, bool);
 
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index aa5fd41..7d70f89 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -31,8 +31,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ubsan.h"
 #include "internal-fn.h"
 
-#include // For placement-new.
-
 #define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
 #define pp_separate_with_semicolon(PP) pp_cxx_separate_with (PP, ';')
 
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 6a679cb..8106172 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -40,8 +40,6 @@ along with GCC; see the file COPYING3.  If not see
 # include 
 #endif
 
-#include  // For placement new.
-
 #define pedantic_warning_kind(DC)			\
   ((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
 #define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 003702b..6cfe019 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -34,8 +34,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-color.h"
 #include "tree-diagnostic.h" /* tree_diagnostics_defaults */
 
-#include  /* For placement-new */
-
 static int suppress_errors = 0;
 
 static bool warnings_not_errors = false;
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 1f5f45c..ce964fa 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
 .  */
 
 #include "bconfig.h"
-#include 
 #include "system.h"
 #include "coretypes.h"
 #include 
diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index 69db0d3..9e3c862 100644
--- a/gcc/ipa-icf-gimple.c
+++ b/gcc/ipa-icf-gimple.c
@@ -35,7 +35,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "fold-const.h"
 #include "gimple-iterator.h"
 #include "ipa-utils.h"
-#include 
 #include "tree-eh.h"
 #include "builtins.h"
 
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index acb89e6..49e1cb9 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -25,8 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "pretty-print.h"
 #include "diagnostic-color.h"
 
-#include // For placement-new.
-
 #if HAVE_ICONV
 #include 
 #endif
diff --git a/gcc/toplev.c b/gcc/toplev.c
index c480bfc..8979d26 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -87,8 +87,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "xcoffout.h"		/* Needed for external data declarations. */
 #endif
 
-#include 
-
 static void general_init (const char *, bool);
 static void do_compile ();
 static void process_options (void);