Commit 88df9da1 by Dirk Mueller Committed by Dirk Mueller

re PR middle-end/34197 (array overflow warning without line number)

2007-11-23  Dirk Mueller  <dmueller@suse.de>
       Richard Guenther <rguenther@suse.de>

       PR middle-end/34197
       * tree-vrp.c (check_array_ref): Move check for valid location..
       (check_array_bounds) here. Use EXPR_HAS_LOCATION().


Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r130385
parent b96817da
2007-11-23 Dirk Mueller <dmueller@suse.de>
Richard Guenther <rguenther@suse.de>
PR middle-end/34197
* tree-vrp.c (check_array_ref): Move check for valid location..
(check_array_bounds) here. Use EXPR_HAS_LOCATION().
2007-11-23 Hans-Peter Nilsson <hp@axis.com>
* reload.c (find_reloads_address_1) <autoincdec cases>:
......@@ -4339,7 +4339,7 @@ check_array_ref (tree ref, location_t* locus, bool ignore_off_by_one)
low_sub = up_sub = TREE_OPERAND (ref, 1);
if (!up_bound || !locus || TREE_NO_WARNING (ref)
if (!up_bound || TREE_NO_WARNING (ref)
|| TREE_CODE (up_bound) != INTEGER_CST
/* Can not check flexible arrays. */
|| (TYPE_SIZE (TREE_TYPE (ref)) == NULL_TREE
......@@ -4441,6 +4441,12 @@ check_array_bounds (tree *tp, int *walk_subtree, void *data)
tree stmt = (tree)data;
location_t *location = EXPR_LOCUS (stmt);
if (!EXPR_HAS_LOCATION (stmt))
{
*walk_subtree = FALSE;
return NULL_TREE;
}
*walk_subtree = TRUE;
if (TREE_CODE (t) == ARRAY_REF)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment