[Bug c++/79681] [6/7 Regression] ICE with constexpr and bitfield

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 27 12:21:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79681

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
A problem with that information loss due to make_bit_field_ref and its callers
during folding is that there could e.g. be multiple fields that fall into the
range (e.g. inside of union) etc.

The IMHO best fix would be to stop doing constexpr evaluation on folded
functions (i.e. copy constexpr function bodies before folding), or perhaps we
could change make_bit_field_ref so that it attempts to use as many
COMPONENT_REFs/ARRAY_REFs from orig_inner as possible, maybe just see if
orig_inner is a bit field with DECL_BIT_FIELD_REPRESENTATIVE and if the bitpos
+ bitsize could be used for that.


More information about the Gcc-bugs mailing list