aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-11-04 18:15:43 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-11-04 11:15:43 -0700
commit2f967bc4b32e3348e889fc4e59c48a66c3b3b575 (patch)
tree562bbd533d4e089bac0a485b58f3448ca15435ba /gcc/tree-vrp.c
parent494d6c28c53d0852bb6468b1f1ca189159775fcc (diff)
downloadgcc-2f967bc4b32e3348e889fc4e59c48a66c3b3b575.zip
gcc-2f967bc4b32e3348e889fc4e59c48a66c3b3b575.tar.gz
gcc-2f967bc4b32e3348e889fc4e59c48a66c3b3b575.tar.bz2
PR tree-optimization/92349 - ICE in -Warray-bounds of a VLA member
gcc/testsuite/ChangeLog: PR tree-optimization/92349 * gcc.dg/Warray-bounds-50.c: New test. gcc/ChangeLog: PR tree-optimization/92349 * tree-vrp.c (vrp_prop::check_array_ref): Avoid assuming struct memebers have constant sizes. From-SVN: r277786
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 3125861..da6b615 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -4164,7 +4164,8 @@ vrp_prop::check_array_ref (location_t location, tree ref,
/* Try to determine the size of the trailing array from
its initializer (if it has one). */
if (tree refsize = component_ref_size (arg, &interior_zero_len))
- maxbound = refsize;
+ if (TREE_CODE (refsize) == INTEGER_CST)
+ maxbound = refsize;
}
if (maxbound == ptrdiff_max