Re: [PATCH] widening_mul: Recognize another form of ADD_OVERFLOW [PR96272]

2020-12-12 Thread Richard Biener
On December 12, 2020 9:01:50 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >The following patch recognizes another form of hand written >__builtin_add_overflow (this time _p), in particular when >the code does unsigned >if (x > ~0U - y) >or >if (x <= ~0U - y) >it can be optimized (if the subtraction

[PATCH] widening_mul: Recognize another form of ADD_OVERFLOW [PR96272]

2020-12-12 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch recognizes another form of hand written __builtin_add_overflow (this time _p), in particular when the code does unsigned if (x > ~0U - y) or if (x <= ~0U - y) it can be optimized (if the subtraction turned into ~y is single use) into if (__builtin_add_overflow_p (x, y, 0U))