Re: Question about divide by 0 and what we can do with it

2021-07-29 Thread Richard Biener via Gcc-patches
On Thu, Jul 29, 2021 at 4:38 PM Andrew MacLeod wrote: > > On 7/29/21 3:19 AM, Richard Biener wrote: > > On Wed, Jul 28, 2021 at 4:39 PM Andrew MacLeod wrote: > >> > >> Which has removed the second call to builtin_abort()(Even before we > >> get to EVRP!) > >> > >> SO the issue doesn't seem to

Re: Question about divide by 0 and what we can do with it

2021-07-29 Thread Andrew MacLeod via Gcc-patches
On 7/29/21 3:19 AM, Richard Biener wrote: On Wed, Jul 28, 2021 at 4:39 PM Andrew MacLeod wrote: Which has removed the second call to builtin_abort()(Even before we get to EVRP!) SO the issue doesn't seem to be removing the divide by 0, it seems to be a pattern match for [0,1] that is trig

Re: Question about divide by 0 and what we can do with it

2021-07-29 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 4:39 PM Andrew MacLeod wrote: > > So Im seeing what appears to me to be inconsistent behaviour. > > in pr96094.c we see: > > int > foo (int x) > { >if (x >= 2U) > return 34; >return 34 / x; > } > > x has a range of [0,1] and since / 0 in undefined, the expecta

Re: Question about divide by 0 and what we can do with it

2021-07-28 Thread Aldy Hernandez via Gcc-patches
On 7/28/21 4:39 PM, Andrew MacLeod wrote: So Im seeing what appears to me to be inconsistent behaviour. in pr96094.c we see: int foo (int x) {   if (x >= 2U)     return 34;   return 34 / x; } x has a range of [0,1] and since / 0  in undefined, the expectation is that we fold this to "re