re PR tree-optimization/83044 (ice in contains_struct_check)
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Nov 2017 12:35:26 +0000 (13:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 22 Nov 2017 12:35:26 +0000 (13:35 +0100)
commitff4790688bffc52c1a76aaf35c01fe92009a99ff
treea521783bec9aa30d6cddf1a23ea52f02f1239b4c
parenta7d3cd407ccea644f1405cf331edf3bb30e57e65
re PR tree-optimization/83044 (ice in contains_struct_check)

PR tree-optimization/83044
* tree-vrp.c (vrp_prop::check_array_ref): If eltsize is not
INTEGER_CST or is 0, clear up_bound{,_p1} and later ignore tests
that need the upper bound.  Subtract offset from
get_addr_base_and_unit_offset only if positive and subtract it
before division by eltsize rather than after it.

* gcc.dg/pr83044.c: New test.
* c-c++-common/Warray-bounds.c (fb): Fix up MAX value.

From-SVN: r255054
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Warray-bounds.c
gcc/testsuite/gcc.dg/pr83044.c [new file with mode: 0644]
gcc/tree-vrp.c