number_of_iterations_in_loop and a non-constant loop bound start
Daniel Berlin
dberlin@dberlin.org
Thu Aug 26 07:03:00 GMT 2004
On Aug 25, 2004, at 11:23 PM, Andrew Pinski wrote:
> While working on a loop pass I found that number_of_iterations_in_loop
> reported
> that a loop with a non constant start as being undetermined which is
> wrong for
> this case as we know that the initializer will always before the end.
>
> Take for an example:
>
>
> void g(int init, int max, char *a)
> {
> int i;
> for (i = init; i < max; i++)
> a[i] = 0;
> }
>
> in the loop we know that init < max as the tree looks like:
>
>
> Is there someway to get this fixed as this looks very wrong. It looks
> like
> it will also hurt the vectorizer also.
>
You need range info, which Diego is working on :)
>
More information about the Gcc
mailing list