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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
There are problems with that though.
What convert_lvalue_to_rvalue does is
  if (convert_p && !error_operand_p (exp.value)
      && (TREE_CODE (TREE_TYPE (exp.value)) != ARRAY_TYPE))
    exp.value = convert (build_qualified_type (TREE_TYPE (exp.value),
TYPE_UNQUALIFIED), exp.value);
so e.g. if the bit-field is const or volati,e this will add a cast to a
different type.
Also, a bit-field COMPONENT_REF is only lvalue if its first operand is an
lvalue, so
build_c_cast will not add anything in
  /* Don't let a cast be an lvalue.  */
  if (lvalue_p (value))
    value = non_lvalue_loc (loc, value);
if it TREE_OPERAND (, 0) of the COMPONENT_REF is not lvalue or if the above
added a cast.

Reply via email to