PR middle-end/97595 - bogus -Wstringop-overflow due to DECL_SIZE_UNIT underreporting...
authorMartin Sebor <msebor@redhat.com>
Tue, 1 Dec 2020 22:10:30 +0000 (15:10 -0700)
committerMartin Sebor <msebor@redhat.com>
Tue, 1 Dec 2020 22:11:23 +0000 (15:11 -0700)
commitb76f83e3859f738809d3aa8bd9dc14e10fc40e24
treecea67a727e59839591dffa2a523f0e4552f2eea3
parentc7e2ef13149791be24bc563428fcb864e770d843
PR middle-end/97595 - bogus -Wstringop-overflow due to DECL_SIZE_UNIT underreporting field size

gcc/ChangeLog:

PR middle-end/97595
* tree.c (component_ref_size): Fail when DECL_SIZE != TYPE_SIZE.
* tree.h (DECL_SIZE, TYPE_SIZE): Update comment.

gcc/testsuite/ChangeLog:

PR middle-end/97595
* g++.dg/warn/Warray-bounds-14.C: New test.
* g++.dg/warn/Wstringop-overflow-6.C: New test.
gcc/testsuite/g++.dg/warn/Warray-bounds-14.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wstringop-overflow-6.C [new file with mode: 0644]
gcc/tree.c
gcc/tree.h