This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re-run of loop pass
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: Re-run of loop pass
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Thu, 05 Nov 1998 14:50:07 +1300 (NZDT)
- Cc: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes), toon at moene dot indiv dot nluug dot nl, rth at cygnus dot com, law at cygnus dot com, egcs at cygnus dot com
- References: <13888.63202.808685.912226@ongaonga.elec.canterbury.ac.nz><199811050102.BAA16517@phal.cygnus.co.uk>
Joern Rennecke writes:
> > On a 2's complement machine, start is UINT_MAX, start + 5 is 4
> > due to unsigned arithmetic, i is assigned -1, and j is assigned 0.
> > The test fails immediately since an unsigned compare is performed
> > and (unsigned int) -1 is not less than 4. f() thus returns 0.
>
> So what prevents yout patched compiler from unrolling he test case?
The loop gets completely unrolled but there is still a guard
instruction at the top of the loop to bypass the loop if necessary.
Here's the code for the c4x.
_f:
ldiu ar2,r0
addi 5,r0
cmpi3 r0,ar2
bhsd L3 <= unsigned delayed branch (higher or same)
ldiu 0,r1
nop
nop
ldiu 5,r1
L3:
ldiu r1,r0
rets
(Hmmm, looking at this code, there's a grand oppoprtunity for a
conditional load that was missed.)
Michael.