This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cfg-branch] unroll-new cleanups
Hello.
> > But this is not the point!!! The point is, that this loop iterates (2^bits of
> > i - 1) times; unless you know exactly what "bits of i" is, you cannot
> > calculate the number of iterations exactly. If you think you can count this
> > safely, then do it and everything will work fine (I just was not quite sure
> > about it, so I've chosen more conservative way); but you cannot just ignore it.
>
> I see what you are shooting for. It is already taken care for in count_loop_iterations:
>
> /* Given that iteration_var is going to iterate over its own mode,
> not HOST_WIDE_INT, disregard higher bits that might have come
> into the picture due to sign extension of initial and final
> values. */
> abs_diff &= ((unsigned HOST_WIDE_INT) 1
> << (GET_MODE_BITSIZE (GET_MODE (desc->var)) - 1)
> << 1) - 1;
>
> so no need to worry about it anymore.
OK, I have overseen this. Then probably the best way to take care of loop
for (i=10;i<0;i++)
is really in count_loop_iterations (set niter to 0 in this case).
Zdenek