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

--- Comment #43 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #42)
> I suspect the V_C_E  inhibits tree-ssa-uninit.c code to avoid false
> positives.  If we know the range of the V_C_E operand is narrow enough that
> it fits into the type of the result of the V_C_E, could we optimize the
> V_C_E into a NOP_EXPR?   We'd then forward propagate away the NOP_EXPR and
> the result is something the suppression code in tree-ssa-uninit.c can
> analyze better.

Looks like the V_C_E comes from sra_modify_assign:

          if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
            {
=>            rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (lhs),
                                     rhs);

Here rhs (the scalar replacement variable) has unsigned QI type and lhs has
type bool.

Changing the type of 'live' to unsigned char avoids the V_C_E and thus indeed
the warning.  This also works with the libstdc++ optional.

This seems like an SRA problem with fields of type bool.

Reply via email to