PR middle-end/97556 - ICE on excessively large index into a multidimensional array
authorMartin Sebor <msebor@redhat.com>
Fri, 30 Oct 2020 19:04:29 +0000 (13:04 -0600)
committerMartin Sebor <msebor@redhat.com>
Fri, 30 Oct 2020 19:04:29 +0000 (13:04 -0600)
commitbdf6524bc0bfa0908a7a7c52e799dbecbebaefe8
treea883b883004bad88f357df734efbdb5f02eee562
parentf3ced6772e2257bdef4e6f4dbdd0bdcf34b5bb3f
PR middle-end/97556 - ICE on excessively large index into a multidimensional array

gcc/ChangeLog:

PR middle-end/97556
* builtins.c (access_ref::add_offset): Cap offset lower bound
to at most the the upper bound.

gcc/testsuite/ChangeLog:

PR middle-end/97556
* gcc.dg/Warray-bounds-70.c: New test.
gcc/builtins.c
gcc/testsuite/gcc.dg/Warray-bounds-70.c [new file with mode: 0644]