This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71576] [4.9/5/6/7 Regression] ICE on valid C++11 code (with xvalue and bitfield) on x86_64-linux-gnu: in build_target_expr, at cp/tree.c:385


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
s/properly/.
Anyway, the thing is that we use
cp_lvalue_kind lvalue = real_lvalue_p (expr);
and test the various clk_* bits from it, but this returns clk_none if
lvalue_kind has clk_class or clk_rvalueref set in it.
In this case, lvalue_kind (expr) is clk_bitfield | clk_class, and if we don't
want to ICE, for the creation of the temporary we need the bitfield type to be
widened to the underlying type.
So perhaps:
            if (lvalue & clk_bitfield)
              {
                expr = convert_bitfield_to_declared_type (expr);
                expr = fold_convert (type, expr);
              }
should be if (lvalue_kind (expr) & clk_bitfield) instead, or just
unconditional?
What about the other lvalue & clk_* tests a few lines before?  Do they mean to
ignore clk_bitfield or clk_packed if clk_class (or clk_rvalueref) is also set?
If not, perhaps real_lvalue_p call should be replaced with lvalue_kind.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]