]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use enclosing object size if it's smaller than member [PR 101475].
authorMartin Sebor <msebor@redhat.com>
Fri, 14 Jan 2022 18:13:08 +0000 (11:13 -0700)
committerMartin Sebor <msebor@redhat.com>
Fri, 14 Jan 2022 18:13:08 +0000 (11:13 -0700)
commit72332337e3d8acbb21398b8d123f1bfe77a8327e
tree94b31c445e4d8804a4bd5e3abc3b2d63fec14e82
parent1e6294bb15d2169147c7838f89a9168980b94b47
Use enclosing object size if it's smaller than member [PR 101475].

Resolves:
PR middle-end/101475 - missing -Wstringop-overflow storing a compound literal

gcc/ChangeLog:

PR middle-end/101475
* pointer-query.cc (handle_component_ref): Use the size of
the enclosing object if it's smaller than the member.

gcc/testsuite/ChangeLog:

PR middle-end/101475
* gcc.dg/Wstringop-overflow-15.c: Remove xfails.
* gcc.dg/Wstringop-overflow-68.c: Adjust, remove xfails.
* gcc.dg/Wstringop-overflow-88.c: New test.
gcc/pointer-query.cc
gcc/testsuite/gcc.dg/Wstringop-overflow-15.c
gcc/testsuite/gcc.dg/Wstringop-overflow-68.c
gcc/testsuite/gcc.dg/Wstringop-overflow-88.c [new file with mode: 0644]