https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> --- On November 29, 2019 3:25:45 PM GMT+01:00, "glisse at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org> wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712 > >--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> --- >a*x+x -> (a+1)*x is unsafe (a=INT_MAX, x=0), but there are cases where >we could >prove that it is safe, in particular when a is actually b-1 (more >generally for >a*x+b*x when we can prove (with VRP?) that a+b cannot overflow). > >Also, enabling -fwrapv for the last few gimple passes would help. I had a patch for that, RTL is also wrapv.