This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Loop unroll fixes


> > 	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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]