Re: [PATCH 1/2] Check negative combined step

2022-01-27 Thread Richard Biener via Gcc-patches
On Thu, 27 Jan 2022, Jiufu Guo wrote: > Hi Richard, > > Richard Biener writes: > > > On Tue, 25 Jan 2022, Richard Biener wrote: > > > >> On Tue, 25 Jan 2022, Jiufu Guo wrote: > >> > ... > >> > > > >> > > The point is that we may not change the iteration number at which > >> > > overflow occurs

Re: [PATCH 1/2] Check negative combined step

2022-01-27 Thread Jiufu Guo via Gcc-patches
Hi Richard, Richard Biener writes: > On Tue, 25 Jan 2022, Richard Biener wrote: > >> On Tue, 25 Jan 2022, Jiufu Guo wrote: >> ... >> > > >> > > The point is that we may not change the iteration number at which >> > > overflow occurs since that alters the result of the < compare. >> > > Only if w

Re: [PATCH 1/2] Check negative combined step

2022-01-25 Thread Richard Biener via Gcc-patches
On Tue, 25 Jan 2022, Richard Biener wrote: > On Tue, 25 Jan 2022, Jiufu Guo wrote: > > > Richard Biener writes: > > > > > On Tue, 25 Jan 2022, Jiufu Guo wrote: > > > > > >> Jiufu Guo writes: > > >> > > >> > Richard Biener writes: > > >> > > > >> >> On Thu, 13 Jan 2022, Jiufu Guo wrote: > > >

Re: [PATCH 1/2] Check negative combined step

2022-01-25 Thread Richard Biener via Gcc-patches
On Tue, 25 Jan 2022, Jiufu Guo wrote: > Richard Biener writes: > > > On Tue, 25 Jan 2022, Jiufu Guo wrote: > > > >> Jiufu Guo writes: > >> > >> > Richard Biener writes: > >> > > >> >> On Thu, 13 Jan 2022, Jiufu Guo wrote: > >> > ... > >> >> > >> >>> - /* No need to check sign of the new

Re: [PATCH 1/2] Check negative combined step

2022-01-25 Thread Jiufu Guo via Gcc-patches
Richard Biener writes: > On Tue, 25 Jan 2022, Jiufu Guo wrote: > >> Jiufu Guo writes: >> >> > Richard Biener writes: >> > >> >> On Thu, 13 Jan 2022, Jiufu Guo wrote: >> > ... >> >> >> >>> - /* No need to check sign of the new step since below code takes >> >>> care >> >>> - of th

Re: [PATCH 1/2] Check negative combined step

2022-01-24 Thread Richard Biener via Gcc-patches
On Tue, 25 Jan 2022, Jiufu Guo wrote: > Jiufu Guo writes: > > > Richard Biener writes: > > > >> On Thu, 13 Jan 2022, Jiufu Guo wrote: > > ... > >> > >>> - /* No need to check sign of the new step since below code takes > >>> care > >>> - of this well. */ > >>> + /* Like cases shown

Re: [PATCH 1/2] Check negative combined step

2022-01-24 Thread Jiufu Guo via Gcc-patches
Jiufu Guo writes: > Richard Biener writes: > >> On Thu, 13 Jan 2022, Jiufu Guo wrote: > ... >> >>> - /* No need to check sign of the new step since below code takes care >>> -of this well. */ >>> + /* Like cases shown in PR100740/102131, negtive step is not safe. */ >>> + if

Re: [PATCH 1/2] Check negative combined step

2022-01-24 Thread Jiufu Guo via Gcc-patches
Richard Biener writes: > On Thu, 13 Jan 2022, Jiufu Guo wrote: ... > >> - /* No need to check sign of the new step since below code takes care >> - of this well. */ >> + /* Like cases shown in PR100740/102131, negtive step is not safe. */ >> + if (tree_int_cst_sign_bit (step)

Re: [PATCH 1/2] Check negative combined step

2022-01-24 Thread Richard Biener via Gcc-patches
On Thu, 13 Jan 2022, Jiufu Guo wrote: > Hi, > > Previously, there is discussion in: > https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586460.html > I seperate it as two patches. > > This first patch is to avoid negative step when combining two ivs. > The second patch is adding more accur

[PATCH 1/2] Check negative combined step

2022-01-12 Thread Jiufu Guo via Gcc-patches
Hi, Previously, there is discussion in: https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586460.html I seperate it as two patches. This first patch is to avoid negative step when combining two ivs. The second patch is adding more accurate assumptions. This patch pass bootstrap and regtest