aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-07-27 09:59:37 +0200
committerJakub Jelinek <jakub@redhat.com>2021-07-27 09:59:37 +0200
commita21bd3cebd6f54af70a37c18b8fbeae933fb6515 (patch)
tree84262a34a51b1b3a9fc51ac12d9d6239bb737598 /gcc/cgraphclones.c
parent5485e820cd0554886af282265198c7433c64c7b9 (diff)
downloadgcc-a21bd3cebd6f54af70a37c18b8fbeae933fb6515.zip
gcc-a21bd3cebd6f54af70a37c18b8fbeae933fb6515.tar.gz
gcc-a21bd3cebd6f54af70a37c18b8fbeae933fb6515.tar.bz2
gimple-fold: Fix up __builtin_clear_padding on classes with virtual inheritence [PR101586]
For the following testcase, B is 16-byte type, containing 8-byte virtual pointer and 1-byte A member, and C contains two FIELD_DECLs, one with B type and size of just 8-byte and then a field with type A and 1-byte size. The __builtin_clear_padding code was upset about the B typed FIELD_DECL containing FIELD_DECLs beyond the field size and triggered assertion failure. This patch makes it ignore all FIELD_DECLs that are (fully) beyond the sz passed from the caller (except for the flexible array member diagnostics that is kept). 2021-07-27 Jakub Jelinek <jakub@redhat.com> PR middle-end/101586 * gimple-fold.c (clear_padding_type): Ignore FIELD_DECLs with byte positions above or equal to sz except for diagnostics of flexible array members. * g++.dg/torture/builtin-clear-padding-4.C: New test.
Diffstat (limited to 'gcc/cgraphclones.c')
0 files changed, 0 insertions, 0 deletions