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

--- Comment #37 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Robin Dapp from comment #35)
> What does get rid of the comparison failures in the three last posted
> reduced examples is:
> 
>         gcall *call = dyn_cast<gcall *> (op_use_stmt);
>         internal_fn ifn;
>         if (call && gimple_call_internal_p (call))
>           {
>             ifn = gimple_call_internal_fn (call);
>             unsigned else_pos = internal_fn_else_index (ifn);
>             for (unsigned int j = 0; j < gimple_call_num_args (call); ++j)
>               {
>                 if (j == else_pos)
>                   continue;
>                 if (gimple_call_arg (call, j) == op.ops[opi])
>                   cnt++;
>               }
>           }
> 
> i.e. ignoring the else altogether.

The above isn't complete, so one just has to guess what you mean outside of
that, but the above doesn't seem to be correct.  There are many internal calls,
and most of them shouldn't have the above handling.  Say if there is
.MUL_OVERFLOW (op.ops[opi], op.ops[opi]) call, it should count as 2 uses, not
one.

Reply via email to