Is it OK to back port revision r227760 to 5.3?
Tested on x86_64-apple-darwin14

Dominique

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog       (revision 230703)
+++ gcc/ChangeLog       (working copy)
@@ -1,3 +1,17 @@
+2015-11-22  Dominique d'Humieres  <domi...@lps.ens.fr>
+
+       Backport from mainline
+       2015-09-14  Manuel López-Ibáñe<m...@gcc.gnu.org>
+
+       PR fortran/67460
+       * diagnostic.c (diagnostic_initialize): Do not set
+       some_warnings_are_errors.
+       (diagnostic_finish): Use DK_WERROR count instead.
+       (diagnostic_report_diagnostic): Do not set
+       some_warnings_are_errors.
+       * diagnostic.h (struct diagnostic_context): Remove
+       some_warnings_are_errors.
+
 2015-11-21  Jakub Jelinek  <ja...@redhat.com>
 
        PR debug/66432
Index: gcc/diagnostic.h
===================================================================
--- gcc/diagnostic.h    (revision 230703)
+++ gcc/diagnostic.h    (working copy)
@@ -65,10 +65,6 @@
   /* The number of times we have issued diagnostics.  */
   int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
 
-  /* True if we should display the "warnings are being tread as error"
-     message, usually displayed once per compiler run.  */
-  bool some_warnings_are_errors;
-
   /* True if it has been requested that warnings be treated as errors.  */
   bool warning_as_error_requested;
 
Index: gcc/diagnostic.c
===================================================================
--- gcc/diagnostic.c    (revision 230703)
+++ gcc/diagnostic.c    (working copy)
@@ -138,7 +138,6 @@
   new (context->printer) pretty_printer ();
 
   memset (context->diagnostic_count, 0, sizeof context->diagnostic_count);
-  context->some_warnings_are_errors = false;
   context->warning_as_error_requested = false;
   context->n_opts = n_opts;
   context->classify_diagnostic = XNEWVEC (diagnostic_t, n_opts);
@@ -204,7 +203,7 @@
 diagnostic_finish (diagnostic_context *context)
 {
   /* Some of the errors may actually have been warnings.  */
-  if (context->some_warnings_are_errors)
+  if (diagnostic_kind_count (context, DK_WERROR))
     {
       /* -Werror was given.  */
       if (context->warning_as_error_requested)
@@ -811,9 +810,6 @@
        return false;
     }
 
-  if (orig_diag_kind == DK_WARNING && diagnostic->kind == DK_ERROR)
-    context->some_warnings_are_errors = true;
-
   context->lock++;
 
   if (diagnostic->kind == DK_ICE || diagnostic->kind == DK_ICE_NOBT)
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog     (revision 230703)
+++ gcc/testsuite/ChangeLog     (working copy)
@@ -1,3 +1,11 @@
+2015-11-22  Dominique d'Humieres  <domi...@lps.ens.fr>
+
+       Backport from mainline
+       2015-09-14  Manuel López-Ibáñe<m...@gcc.gnu.org>
+
+       PR fortran/67460
+       * gfortran.dg/pr67460.f90: New test.
+
 2015-11-21  Jakub Jelinek  <ja...@redhat.com>
 
        PR debug/66432
Index: gcc/testsuite/gfortran.dg/pr67460.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr67460.f90       (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr67460.f90       (working copy)
@@ -0,0 +1,24 @@
+! Bogus "all warnings being treated as errors"
+! { dg-do compile }
+! { dg-options "-std=f2003 -Werror" }
+MODULE btree_i8_k_sp2d_v
+  TYPE btree_node
+     INTEGER id
+     TYPE(btree_node_p), DIMENSION(:), POINTER :: subtrees
+     TYPE(btree_node), POINTER :: parent
+  END TYPE btree_node
+  TYPE btree_node_p
+     TYPE(btree_node), POINTER :: node
+  END TYPE btree_node_p
+CONTAINS
+  RECURSIVE SUBROUTINE btree_verify_node (tree, node, level, nids, lastv,&
+               count, num_nodes, max_leaf_level, min_leaf_level, printing)
+    TYPE(btree_node), INTENT(IN)             :: node
+    INTEGER                                  :: branch
+    IF (ASSOCIATED (node%subtrees(branch)%node)) THEN
+       IF (node%subtrees(branch)%node%parent%id .NE. node%id) THEN
+          WRITE(*,*)'foo'
+       ENDIF
+    ENDIF
+  END SUBROUTINE btree_verify_node
+END MODULE btree_i8_k_sp2d_v

Reply via email to