On Fri, Sep 06, 2024 at 12:18:30AM -0700, Andrew Pinski wrote:
> You need to do this in an unsigned types. Otherwise you get the wrong
> answer and also introduce undefined code.
> So you need to use:
> tree utype = unsigned_type_for (type);
> tree tmp3;
> if (types_compatible_p (type, utype)
>   tmp3 = op;
> else
>  tmp3 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, CONVERT_EXPR, utype, 
> op);

I think NOP_EXPR is used for these conversions instead.

Otherwise agreed.

        Jakub

Reply via email to