This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34197] array overflow warning without line number
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2007 19:34:35 -0000
- Subject: [Bug c/34197] array overflow warning without line number
- References: <bug-34197-3760@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-11-22 19:34 -------
Indeed. EXPR_LOCUS no longer is NULL if there is no location, but one has
to use EXPR_HAS_LOCATION instead. Like
Index: tree-vrp.c
===================================================================
--- tree-vrp.c (revision 130323)
+++ tree-vrp.c (working copy)
@@ -4492,8 +4492,9 @@ check_all_array_refs (void)
continue;
}
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- walk_tree (bsi_stmt_ptr (si), check_array_bounds,
- bsi_stmt (si), NULL);
+ if (expr_has_location (bsi_stmt (si)))
+ walk_tree (bsi_stmt_ptr (si), check_array_bounds,
+ bsi_stmt (si), NULL);
}
}
which gets rid of the warning.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mueller at kde dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34197