Re: [PATCH] Add divide by zero side effect.

2022-05-30 Thread Richard Biener via Gcc-patches
On Fri, May 27, 2022 at 9:34 PM Andi Kleen via Gcc-patches wrote: > > Andrew MacLeod via Gcc-patches writes: > > > > diff --git a/gcc/gimple-range-side-effect.cc > > b/gcc/gimple-range-side-effect.cc > > index 2c8c77dc569..548e4bea313 100644 > > --- a/gcc/gimple-range-side-effect.cc > > +++

Re: [PATCH] Add divide by zero side effect.

2022-05-28 Thread Eric Gallager via Gcc-patches
On Fri, May 27, 2022 at 3:57 PM Andrew MacLeod via Gcc-patches wrote: > > On 5/27/22 15:33, Andi Kleen wrote: > > Andrew MacLeod via Gcc-patches writes: > >> diff --git a/gcc/gimple-range-side-effect.cc > >> b/gcc/gimple-range-side-effect.cc > >> index 2c8c77dc569..548e4bea313 100644 > >> ---

Re: [PATCH] Add divide by zero side effect.

2022-05-27 Thread Andrew MacLeod via Gcc-patches
On 5/27/22 15:33, Andi Kleen wrote: Andrew MacLeod via Gcc-patches writes: diff --git a/gcc/gimple-range-side-effect.cc b/gcc/gimple-range-side-effect.cc index 2c8c77dc569..548e4bea313 100644 --- a/gcc/gimple-range-side-effect.cc +++ b/gcc/gimple-range-side-effect.cc @@ -116,6 +116,23 @@

Re: [PATCH] Add divide by zero side effect.

2022-05-27 Thread Andi Kleen via Gcc-patches
Andrew MacLeod via Gcc-patches writes: > > diff --git a/gcc/gimple-range-side-effect.cc b/gcc/gimple-range-side-effect.cc > index 2c8c77dc569..548e4bea313 100644 > --- a/gcc/gimple-range-side-effect.cc > +++ b/gcc/gimple-range-side-effect.cc > @@ -116,6 +116,23 @@

Re: [PATCH] Add divide by zero side effect.

2022-05-22 Thread Alexander Monakov via Gcc-patches
On Fri, 20 May 2022, Richard Biener wrote: > > > > I suggest 'deduce', 'deduction', 'deducing a range'. What the code is > > > > actually > > > > doing is deducing that 'b' in 'a / b' cannot be zero. Function in GCC > > > > might be > > > > called like 'deduce_ranges_from_stmt'. > > > > > > So

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Bernhard Reutner-Fischer via Gcc-patches
On 20 May 2022 16:39:20 CEST, Segher Boessenkool wrote: >On Fri, May 20, 2022 at 10:11:32AM +0200, Eric Botcazou wrote: >> > I suggest 'deduce', 'deduction', 'deducing a range'. What the code is >> > actually doing is deducing that 'b' in 'a / b' cannot be zero. Function in >> > GCC might be

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Segher Boessenkool
On Fri, May 20, 2022 at 10:11:32AM +0200, Eric Botcazou wrote: > > I suggest 'deduce', 'deduction', 'deducing a range'. What the code is > > actually doing is deducing that 'b' in 'a / b' cannot be zero. Function in > > GCC might be called like 'deduce_ranges_from_stmt'. > > Or "infer",

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Alexandre Oliva via Gcc-patches
On May 18, 2022, Andrew MacLeod via Gcc-patches wrote: > I'm open to suggestions for a better term! How about inference? -- Alexandre Oliva, happy hackerhttps://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Richard Biener via Gcc-patches
On Fri, May 20, 2022 at 10:17 AM Alexander Monakov wrote: > > On Fri, 20 May 2022, Richard Biener wrote: > > > On Fri, May 20, 2022 at 8:38 AM Alexander Monakov > > wrote: > > > > > > On Fri, 20 May 2022, Richard Biener via Gcc-patches wrote: > > > > > > > > Still waiting for a suggestion,

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Alexander Monakov via Gcc-patches
On Fri, 20 May 2022, Richard Biener wrote: > On Fri, May 20, 2022 at 8:38 AM Alexander Monakov wrote: > > > > On Fri, 20 May 2022, Richard Biener via Gcc-patches wrote: > > > > > > Still waiting for a suggestion, since "side effect" is the description > > > > that made sense to me :-) > > > > >

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Eric Botcazou via Gcc-patches
> I think side-effect captures it quite well even if it overlaps with a term > used in language standards. IMO it's very confusing, see the subject: "Add divide by zero side effect". The only side effect of dividing by zero is (possibly) raising a trap. -- Eric Botcazou

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Eric Botcazou via Gcc-patches
> I suggest 'deduce', 'deduction', 'deducing a range'. What the code is > actually doing is deducing that 'b' in 'a / b' cannot be zero. Function in > GCC might be called like 'deduce_ranges_from_stmt'. Or "infer", "inference", "inferring a range". > Please don't overload 'side effect' if

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Richard Biener via Gcc-patches
On Fri, May 20, 2022 at 8:38 AM Alexander Monakov wrote: > > On Fri, 20 May 2022, Richard Biener via Gcc-patches wrote: > > > > Still waiting for a suggestion, since "side effect" is the description > > > that made sense to me :-) > > > > I think side-effect captures it quite well even if it

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Alexander Monakov via Gcc-patches
On Fri, 20 May 2022, Richard Biener via Gcc-patches wrote: > > Still waiting for a suggestion, since "side effect" is the description > > that made sense to me :-) > > I think side-effect captures it quite well even if it overlaps with a term > used in language standards. Doing c = a << b has

Re: [PATCH] Add divide by zero side effect.

2022-05-20 Thread Richard Biener via Gcc-patches
On Fri, May 20, 2022 at 4:15 AM Andrew MacLeod via Gcc-patches wrote: > > On 5/19/22 18:23, Segher Boessenkool wrote: > > On Thu, May 19, 2022 at 09:22:32AM -0400, Andrew MacLeod wrote: > >> On 5/18/22 16:40, Segher Boessenkool wrote: > >>> On Wed, May 18, 2022 at 04:24:06PM -0400, Andrew MacLeod

Re: [PATCH] Add divide by zero side effect.

2022-05-19 Thread Andrew MacLeod via Gcc-patches
On 5/19/22 18:23, Segher Boessenkool wrote: On Thu, May 19, 2022 at 09:22:32AM -0400, Andrew MacLeod wrote: On 5/18/22 16:40, Segher Boessenkool wrote: On Wed, May 18, 2022 at 04:24:06PM -0400, Andrew MacLeod wrote: On 5/18/22 14:13, Segher Boessenkool wrote: "Side effect" already has a

Re: [PATCH] Add divide by zero side effect.

2022-05-19 Thread Segher Boessenkool
On Thu, May 19, 2022 at 09:22:32AM -0400, Andrew MacLeod wrote: > On 5/18/22 16:40, Segher Boessenkool wrote: > >On Wed, May 18, 2022 at 04:24:06PM -0400, Andrew MacLeod wrote: > >>On 5/18/22 14:13, Segher Boessenkool wrote: > >>>"Side effect" already has a meaning, very commonly used in language

Re: [PATCH] Add divide by zero side effect.

2022-05-19 Thread Andrew MacLeod via Gcc-patches
On 5/18/22 16:40, Segher Boessenkool wrote: On Wed, May 18, 2022 at 04:24:06PM -0400, Andrew MacLeod wrote: On 5/18/22 14:13, Segher Boessenkool wrote: "Side effect" already has a meaning, very commonly used in language theory, and even in the C standard itself: a function has a side effect if

Re: [PATCH] Add divide by zero side effect.

2022-05-18 Thread Segher Boessenkool
On Wed, May 18, 2022 at 04:24:06PM -0400, Andrew MacLeod wrote: > On 5/18/22 14:13, Segher Boessenkool wrote: > >"Side effect" already has a meaning, very commonly used in language > >theory, and even in the C standard itself: a function has a side effect > >if it does something more than just

Re: [PATCH] Add divide by zero side effect.

2022-05-18 Thread Andrew MacLeod via Gcc-patches
On 5/18/22 14:13, Segher Boessenkool wrote: On Tue, May 17, 2022 at 02:39:11PM -0400, Andrew MacLeod via Gcc-patches wrote: I haven't checked this patch in yet.  This implements a side effect that the divisor cannot be 0 after a divide executes. This allows us to fold the divide away: "Side

Re: [PATCH] Add divide by zero side effect.

2022-05-18 Thread Segher Boessenkool
On Tue, May 17, 2022 at 02:39:11PM -0400, Andrew MacLeod via Gcc-patches wrote: > I haven't checked this patch in yet.  This implements a side effect that > the divisor cannot be 0 after a divide executes. This allows us to fold > the divide away: "Side effect" already has a meaning, very

Re: [PATCH] Add divide by zero side effect.

2022-05-18 Thread Andrew MacLeod via Gcc-patches
On 5/18/22 02:28, Richard Biener wrote: On Tue, May 17, 2022 at 8:40 PM Andrew MacLeod via Gcc-patches wrote: I haven't checked this patch in yet. This implements a side effect that the divisor cannot be 0 after a divide executes. This allows us to fold the divide away: a = b / c; if (c ==

Re: [PATCH] Add divide by zero side effect.

2022-05-18 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 8:40 PM Andrew MacLeod via Gcc-patches wrote: > > I haven't checked this patch in yet. This implements a side effect that > the divisor cannot be 0 after a divide executes. This allows us to fold > the divide away: > > a = b / c; > if (c == 0) >dead(); > > This

[PATCH] Add divide by zero side effect.

2022-05-17 Thread Andrew MacLeod via Gcc-patches
I haven't checked this patch in yet.  This implements a side effect that the divisor cannot be 0 after a divide executes. This allows us to fold the divide away: a = b / c; if (c == 0)   dead(); This bootstraps on x86_64-pc-linux-gnu with no regressions, but I first wanted to check to see if