This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unroll fixes
- To: dje at watson dot ibm dot com (David Edelsohn)
- Subject: Re: Loop unroll fixes
- From: Zoltan Hidvegi <hzoli at hzoli dot 2y dot net>
- Date: Fri, 14 Sep 2001 18:41:24 -0500 (CDT)
- Cc: bernds at redhat dot com, gcc-patches at gcc dot gnu dot org
> > emit_cmp_and_jump_insns() incorrectly is called with unsignedp
> > uniformly set to zero, regardless of comparison arguments.
>
> What about the two subsequent calls to emit_cmp_and_jump_insns, which
> also set unsignedp to zero?
That's comparing diff = (final-initial) % increment. increment is a
power of 2, diff is less than the increment and greater than 0. So
the signedness of the comparison does not matter. You are comparing a
positive value to a positive constant.
>
> > for (i = 0; --i < 6;)
>
> IMO, we should just bail on this kind of thing in precondition_loop_p,
> rather than waste effort on trying to optimize it. That's more likely
> to lead to correct results, and only testsuite authors write that kind
> of code.
But if we can handle it with no extra cost, why not do it? Note that
for count-register loops this case is excluded.
Zoli