Avoid warning for memset writing over multiple members.
authorMartin Sebor <msebor@redhat.com>
Thu, 18 Jun 2020 18:00:36 +0000 (12:00 -0600)
committerMartin Sebor <msebor@redhat.com>
Thu, 18 Jun 2020 18:00:36 +0000 (12:00 -0600)
commit5acc654e380797bbf402bc3a0a67f9a6ac4c2a83
treeaa5840bf7987db25de59013cc4e64b6bfb701ce2
parent5421fae8b17c7401f3a4ac5b9f414a47f7bda379
Avoid warning for memset writing over multiple members.

Resolves:
PR middle-end/95667 - unintended warning for memset writing across multiple members
PR middle-end/92814 - missing -Wstringop-overflow writing into a dynamically allocated flexible array member

gcc/ChangeLog:

PR middle-end/95667
PR middle-end/92814
* builtins.c (compute_objsize): Remove call to
compute_builtin_object_size and instead compute conservative sizes
directly here.

gcc/testsuite/ChangeLog:

PR middle-end/95667
PR middle-end/92814
* gcc.dg/Wstringop-overflow-25.c: Remove xfails.
* gcc.dg/Wstringop-overflow-39.c: New test.
gcc/builtins.c
gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
gcc/testsuite/gcc.dg/Wstringop-overflow-39.c [new file with mode: 0644]