diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-09-12 12:23:13 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-09-12 12:23:13 +0200 |
commit | 6067dbdcf77df995129214248f062d9ce18b48d8 (patch) | |
tree | 8d214016fea91a7c344333701c2fa373ecce35e9 /gcc/go | |
parent | 89b5866742a17c38cc98edd9e434cff8e3a3c7ea (diff) | |
download | gcc-6067dbdcf77df995129214248f062d9ce18b48d8.zip gcc-6067dbdcf77df995129214248f062d9ce18b48d8.tar.gz gcc-6067dbdcf77df995129214248f062d9ce18b48d8.tar.bz2 |
sccvn: Avoid ICEs on _BitInt load BIT_AND_EXPR mask [PR111338]
The following testcase ICEs, because vn_walk_cb_data::push_partial_def
uses a fixed size buffer (64 target bytes) for its
construction/deconstruction of partial stores and fails if larger precision
than that is needed, and the PR93582 changes assert push_partial_def
succeeds (and check the various other conditions much earlier when seeing
the BIT_AND_EXPR statement, like CHAR_BIT == 8, BITS_PER_UNIT == 8,
BYTES_BIG_ENDIAN == WORDS_BIG_ENDIAN, etc.). So, just removing the assert
and allowing it fail there doesn't really work and ICEs later on.
The following patch moves the bufsize out of the method and tests it
together with the other checks.
BTW, perhaps we could increase the bufsize as well or in addition to
increasing it make the buffer allocated using XALLOCAVEC, but still I think
it is useful to have some upper bound and so I think this patch is useful
even in that case.
2023-09-12 Jakub Jelinek <jakub@redhat.com>
PR middle-end/111338
* tree-ssa-sccvn.cc (struct vn_walk_cb_data): Add bufsize non-static
data member.
(vn_walk_cb_data::push_partial_def): Remove bufsize variable.
(visit_nary_op): Avoid the BIT_AND_EXPR with constant rhs2
optimization if type's precision is too large for
vn_walk_cb_data::bufsize.
* gcc.dg/bitint-37.c: New test.
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions