https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92373

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Nov  6 01:25:09 2019
New Revision: 277871

URL: https://gcc.gnu.org/viewcvs?rev=277871&root=gcc&view=rev
Log:
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.

Added:
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-55.c
    trunk/gcc/testsuite/gcc.dg/Wzero-length-array-bounds-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c

Reply via email to