Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Tobias Grosser
On Thu, 2009-10-08 at 08:49 +0200, Zdenek Dvorak wrote: > Hi, > > > > Ah, indeed. Sorry for being confused. Is tree-niter-desc->assumptions > > > or ->may_be_zero non-NULL? > > > > Yes both. I attached the gdb content for both. > > you need to check may_be_zero, which in your case should conta

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Zdenek Dvorak
> On Wed, Oct 7, 2009 at 7:21 PM, Tobias Grosser > wrote: > > On Wed, 2009-10-07 at 18:30 +0200, Tobias Grosser wrote: > >> On Wed, 2009-10-07 at 17:44 +0200, Richard Guenther wrote: > >> > On Wed, Oct 7, 2009 at 5:35 PM, Tobias Grosser > >> > wrote: > >> > > On Wed, 2009-10-07 at 17:23 +0200, Ri

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Zdenek Dvorak
Hi, > > Ah, indeed. Sorry for being confused. Is tree-niter-desc->assumptions > > or ->may_be_zero non-NULL? > > Yes both. I attached the gdb content for both. you need to check may_be_zero, which in your case should contain something like N <= 49. If this condition is true, the number of ite

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Richard Guenther
On Wed, Oct 7, 2009 at 7:21 PM, Tobias Grosser wrote: > On Wed, 2009-10-07 at 18:30 +0200, Tobias Grosser wrote: >> On Wed, 2009-10-07 at 17:44 +0200, Richard Guenther wrote: >> > On Wed, Oct 7, 2009 at 5:35 PM, Tobias Grosser >> > wrote: >> > > On Wed, 2009-10-07 at 17:23 +0200, Richard Guenther

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Tobias Grosser
On Wed, 2009-10-07 at 18:30 +0200, Tobias Grosser wrote: > On Wed, 2009-10-07 at 17:44 +0200, Richard Guenther wrote: > > On Wed, Oct 7, 2009 at 5:35 PM, Tobias Grosser > > wrote: > > > On Wed, 2009-10-07 at 17:23 +0200, Richard Guenther wrote: > > >> On Wed, Oct 7, 2009 at 5:16 PM, Tobias Grosser

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Richard Guenther
On Wed, Oct 7, 2009 at 5:35 PM, Tobias Grosser wrote: > On Wed, 2009-10-07 at 17:23 +0200, Richard Guenther wrote: >> On Wed, Oct 7, 2009 at 5:16 PM, Tobias Grosser >> wrote: >> > On Wed, 2009-10-07 at 16:42 +0200, Richard Guenther wrote: >> >> On Wed, Oct 7, 2009 at 4:37 PM, Tobias Grosser >> >>

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Tobias Grosser
On Wed, 2009-10-07 at 17:23 +0200, Richard Guenther wrote: > On Wed, Oct 7, 2009 at 5:16 PM, Tobias Grosser > wrote: > > On Wed, 2009-10-07 at 16:42 +0200, Richard Guenther wrote: > >> On Wed, Oct 7, 2009 at 4:37 PM, Tobias Grosser > >> wrote: > >> > I try to analyse this code: > >> > ---

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Richard Guenther
On Wed, Oct 7, 2009 at 5:16 PM, Tobias Grosser wrote: > On Wed, 2009-10-07 at 16:42 +0200, Richard Guenther wrote: >> On Wed, Oct 7, 2009 at 4:37 PM, Tobias Grosser >> wrote: >> > I try to analyse this code: >> > -- >> > int foo (int N) >> > { >

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Tobias Grosser
On Wed, 2009-10-07 at 16:42 +0200, Richard Guenther wrote: > On Wed, Oct 7, 2009 at 4:37 PM, Tobias Grosser > wrote: > > I try to analyse this code: > > -- > > int foo (int N) > > { > > int ftab[257]; > > int i, j; > > > > for (i = 0; i < N -

Re: Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Richard Guenther
On Wed, Oct 7, 2009 at 4:37 PM, Tobias Grosser wrote: > I try to analyse this code: > -- > int foo (int N) > { >  int ftab[257]; >  int i, j; > >  for (i = 0; i < N  - 7488645; i++) >    j = ftab [i]; > >  return j; > } >

Scev analysing number of loop iterations returns (2^32-1) instead of -1

2009-10-07 Thread Tobias Grosser
I try to analyse this code: -- int foo (int N) { int ftab[257]; int i, j; for (i = 0; i < N - 7488645; i++) j = ftab [i]; return j; } -- The number of iterations I get is: (unsig