diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-12-04 18:00:54 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-12-04 18:02:10 +0100 |
commit | 33be07be9e46f15b9556521050356c47460651ee (patch) | |
tree | def7d97da300eb743fc2831c4f82c51be7db2947 /gcc/print-rtl-function.c | |
parent | 5a26d4a204c8a462a7e0a1a86bb2f25ecd470aad (diff) | |
download | gcc-33be07be9e46f15b9556521050356c47460651ee.zip gcc-33be07be9e46f15b9556521050356c47460651ee.tar.gz gcc-33be07be9e46f15b9556521050356c47460651ee.tar.bz2 |
fold-const: Don't use build_constructor for non-aggregate types in native_encode_initializer [PR93121]
The following testcase is rejected, because when trying to encode a zeroing
CONSTRUCTOR, the code was using build_constructor to build initializers for
the elements but when recursing the function handles CONSTRUCTOR only for
aggregate types.
The following patch fixes that by using build_zero_cst instead for
non-aggregates. Another option would be add handling CONSTRUCTOR for
non-aggregates in native_encode_initializer. Or we can do both, I guess
the middle-end generally doesn't like CONSTRUCTORs for scalar variables, but
am not 100% sure if the FE doesn't produce those sometimes.
2020-12-04 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/93121
* fold-const.c (native_encode_initializer): Use build_zero_cst
instead of build_constructor.
* g++.dg/cpp2a/bit-cast6.C: New test.
Diffstat (limited to 'gcc/print-rtl-function.c')
0 files changed, 0 insertions, 0 deletions