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

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #6)
> The suggestion I'll try to work on is to check if C isn't a plus/minus expr
> with constant second operand that doesn't go in the other direction and thus
> where the transformation isn't introducing UB.

In the testcase, t-1 is computed in some unsigned type and then cast back to
signed, so I don't think it will work.

> I guess it should be enough to do this in match.pd though.

Yes.

Reply via email to