This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix PR lto/50492
> Hm, but canonicalize_cond_expr_cond is supposed to produce a
> tree that is suitable for a condition in a GIMPLE_COND, or a
> COND_EXPR. So the issue is that it is used for a tcc_comparison
> on a assignment RHS?
It is called on (Ada_Boolean_Type) iftmp.xxx, which comes from the RHS of
Ada_Boolean_Var = (Integer_Var != 0);
> Wouldn't the "proper" fix then be to verify that the result from
> forward_propagate_into_comparison_1 in forwprop is a suitable
> replacement of the assign rhs in forward_propagate_into_comparison?
Not clear whether it is the proper fix, as you explicitly pass the type in the
call to forward_propagate_into_comparison_1 just above:
tmp = forward_propagate_into_comparison_1 (stmt,
and then to combine_cond_expr_cond, so you would expect that both functions
return a tree with the specified type. But this would probably work, yes.