[PATCH v2] match.pd: Simplify unsigned A - B - 1 >= A to B >= A [PR94913]

Jeff Law law@redhat.com
Thu May 7 16:42:29 GMT 2020


On Thu, 2020-05-07 at 17:39 +0200, Richard Biener wrote:
> On May 7, 2020 4:27:26 PM GMT+02:00, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Thu, May 07, 2020 at 09:59:57AM +0200, Richard Biener wrote:
> > > Maybe write A - B + -1 >= A to actually match what you match below
> > ...
> > > on the plus :c is not needed, canonicalization will put the constant
> > > literal second
> > > 
> > > The previous pattern has a single_use check on the minus, since
> > > the result is always "simple" (a single stmt) the :s have no
> > > effect (hmm, I guess a genmatch warning for this case might be nice).
> > > 
> > > And yes, if the TYPE_OVERFLOW_WRAPS checks are unnecessary remove
> > > them please, we'll hopefully resist all attempts to ubsan
> > > unsigned overflow ...
> > 
> > So like this if it passes bootstrap/regtest?
> 
> Yes. Mit sure what Jeff is suggesting. 
Sorry.  Just noting a potential problem area.  If it works, I've got no
objections.

jeff
> 



More information about the Gcc-patches mailing list