Remove false positives for warnings that break LTO profiled
authorMartin Liska <mliska@suse.cz>
Fri, 23 Jan 2015 15:09:08 +0000 (16:09 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 23 Jan 2015 15:09:08 +0000 (15:09 +0000)
* tree.h (tree_vec_elt_check): Workaround -Wstrict-overflow
false positive during profiledbootstrap.
* decl.c (attr_decl1): Workaround -Wmaybe-uninitialized
false positive during profiledbootstrap by initializing them.
* matchexp.c (match_mult_operand): Likewise.
* module.c (write_atom): Likewise.
(read_module): Likewise.

From-SVN: r220042

gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/matchexp.c
gcc/fortran/module.c
gcc/tree.h

index b5beaf62153fb804188a566d2e9ed615a1bbe3c4..2b53eed19552fe7123c5c3ef0a211302172357a3 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Martin Liska  <mliska@suse.cz>
+
+       * tree.h (tree_vec_elt_check): Workaround -Wstrict-overflow
+       false positive during profiledbootstrap.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64672
index bb6635694187da81d7c68f460e9733d629fe16f3..26af04165987bbdd1aba25730023ebc8fb28bf3d 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-23  Martin Liska  <mliska@suse.cz>
+
+       * decl.c (attr_decl1): Workaround -Wmaybe-uninitialized
+       false positive during profiledbootstrap by initializing them.
+       * matchexp.c (match_mult_operand): Likewise.
+       * module.c (write_atom): Likewise.
+       (read_module): Likewise.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64672
index 2a200fca7613b1a67a67c4bb7d6874786d4d5d28..cc35c65f268c84a6af6ae9df4bd4deb823eb6cd4 100644 (file)
@@ -6391,7 +6391,10 @@ attr_decl1 (void)
 {
   char name[GFC_MAX_SYMBOL_LEN + 1];
   gfc_array_spec *as;
-  gfc_symbol *sym;
+
+  /* Workaround -Wmaybe-uninitialized false positive during
+     profiledbootstrap by initializing them.  */
+  gfc_symbol *sym = NULL;
   locus var_locus;
   match m;
 
index ec07dfc3751e747afb61aa5f277b220570b9184e..fc35c8c055875d4005aab6e0d1d5afa95ecbe2ac 100644 (file)
@@ -258,7 +258,9 @@ match_add_op (void)
 static match
 match_mult_operand (gfc_expr **result)
 {
-  gfc_expr *e, *exp, *r;
+  /* Workaround -Wmaybe-uninitialized false positive during
+     profiledbootstrap by initializing them.  */
+  gfc_expr *e = NULL, *exp, *r;
   locus where;
   match m;
 
index c47489aeec3dedad424973aae0985450d9389d18..4cfc0e202b570012ba82b69cd0d4ea8f4ec1a9b6 100644 (file)
@@ -1536,7 +1536,10 @@ static void
 write_atom (atom_type atom, const void *v)
 {
   char buffer[20];
-  int i, len;
+
+  /* Workaround -Wmaybe-uninitialized false positive during
+     profiledbootstrap by initializing them.  */
+  int i = 0, len;
   const char *p;
 
   switch (atom)
@@ -4908,7 +4911,9 @@ read_module (void)
   const char *p;
   char name[GFC_MAX_SYMBOL_LEN + 1];
   int i;
-  int ambiguous, j, nuse, symbol;
+  /* Workaround -Wmaybe-uninitialized false positive during
+     profiledbootstrap by initializing them.  */
+  int ambiguous = 0, j, nuse, symbol = 0;
   pointer_info *info, *q;
   gfc_use_rename *u = NULL;
   gfc_symtree *st;
index d8eaff6785181211c4b87dde9a65c5a0b348691b..6c69fce4f5196d6e1a28720f19af275f471e8f96 100644 (file)
@@ -3050,6 +3050,13 @@ tree_int_cst_elt_check (tree __t, int __i,
   return &CONST_CAST_TREE (__t)->int_cst.val[__i];
 }
 
+/* Workaround -Wstrict-overflow false positive during profiledbootstrap.  */
+
+# if GCC_VERSION >= 4004
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
+
 inline tree *
 tree_vec_elt_check (tree __t, int __i,
                     const char *__f, int __l, const char *__g)
@@ -3061,6 +3068,10 @@ tree_vec_elt_check (tree __t, int __i,
   return &CONST_CAST_TREE (__t)->vec.a[__i];
 }
 
+# if GCC_VERSION >= 4004
+#pragma GCC diagnostic pop
+#endif
+
 inline tree *
 omp_clause_elt_check (tree __t, int __i,
                       const char *__f, int __l, const char *__g)