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.