PR tree-optimization/92373 - ICE in -Warray-bounds on access to member array in an...
authorMartin Sebor <msebor@redhat.com>
Wed, 6 Nov 2019 01:25:09 +0000 (01:25 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 6 Nov 2019 01:25:09 +0000 (18:25 -0700)
commit91eb5fa8e1fae57f6d69b2b973ffdf1988d18ca1
tree35311a912227df67c92d9e17b2e86ffc2784693a
parenteebabc49a3f5385d33cab235ec42e1ee0b5ca3c2
PR tree-optimization/92373 - ICE in -Warray-bounds on access to member array in an initialized char buffer

gcc/testsuite/ChangeLog:

PR tree-optimization/92373
* gcc.dg/Warray-bounds-55.c: New test.
* gcc.dg/Wzero-length-array-bounds-2.c: New test.

gcc/ChangeLog:

PR tree-optimization/92373
* tree.c (component_ref_size): Only consider initializers of objects
of matching struct types.
Return null for instances of interior zero-length arrays.

From-SVN: r277871
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Warray-bounds-55.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wzero-length-array-bounds-2.c [new file with mode: 0644]
gcc/tree.c