summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authormueller <mueller@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-23 23:02:21 +0000
committermueller <mueller@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-23 23:02:21 +0000
commit5d19e882b52b64f9f4fa8c9eca4fc303459f18da (patch)
treec2bed6268f34a3f711cee93ae89b98112aa01a61 /gcc/tree-vrp.c
parent731b672f9ac80010fb48738d2eaac9768b32efe1 (diff)
downloadgcc-5d19e882b52b64f9f4fa8c9eca4fc303459f18da.tar.gz
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(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index dfb28203948..00264d9a12c 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -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)