[Bug tree-optimization/92741] [10 Regression] ICE: verify_gimple failed (error: invalid vector types in nop conversion)
rsandifo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 2 09:13:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92741
--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
This comes from:
if (!useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (v->value)))
{
if (fold_convertible_p (TREE_TYPE (rhs), v->value))
val = fold_build1 (NOP_EXPR, TREE_TYPE (rhs), v->value);
else if (TYPE_SIZE (TREE_TYPE (rhs))
== TYPE_SIZE (TREE_TYPE (v->value)))
val = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), v->value);
in ipcp_modif_dom_walker::before_dom_children. fold_convertible_p
is returning true for the mismatched vector types, which is clearly
a bug and I have a fix. But does anyone have any thoughts on whether
the above code is correct? It seems strange to be trusting
fold_convertible_p with the choice when this kind of type punning
always acts as a VIEW_CONVERT_EXPR-style reinterpret of the
memory contents. Earlier we have:
if (!v
|| v->by_ref != by_ref
|| maybe_ne (tree_to_poly_int64 (TYPE_SIZE (TREE_TYPE (v->value))),
size))
continue;
which I guess makes it safe in practice.
More information about the Gcc-bugs
mailing list