[Bug c++/98193] [11 Regression] ICE in native_encode_initializer, at fold-const.c:8454/8424
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 9 08:35:30 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98193
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:4164e58bfd5d57e7399f91c7c27ae6ccebc7dcb0
commit r11-5874-g4164e58bfd5d57e7399f91c7c27ae6ccebc7dcb0
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Dec 9 09:34:51 2020 +0100
fold-const: Fix up native_encode_initializer missing field handling
[PR98193]
When native_encode_initializer is called with non-NULL mask (i.e. ATM
bit_cast only), it checks if the current index in the CONSTRUCTOR (if any)
is the next initializable FIELD_DECL, and if not, decrements cnt and
performs the iteration with that FIELD_DECL as field and val of zero
(so that it computes mask properly). As the testcase shows, I forgot to
set pos to the byte position of the field though (like it is done
for e.g. index referenced FIELD_DECLs in the constructor.
2020-12-09 Jakub Jelinek <jakub@redhat.com>
PR c++/98193
* fold-const.c (native_encode_initializer): Set pos to field's
byte position if iterating over a field with missing initializer.
* g++.dg/cpp2a/bit-cast7.C: New test.
More information about the Gcc-bugs
mailing list