[PATCH] Fix PR middle-end/28690, indexed load/store performance + reload bug

Ulrich Weigand uweigand@de.ibm.com
Mon Dec 11 16:36:00 GMT 2006


Michael Matz wrote:

> On Fri, 8 Dec 2006, Peter Bergner wrote:
> > > That's what I thought at first, but operand 0 in *addsi3_internal has 
> > > only 'r' as constraint, which should be interpreted as GENERAL_REGS, 
> > > and that class does not contain reg 65 ...
> > > 
> > > Any idea why global/regclass might not respect that?
> > 
> > It seems that this is normal.
> 
> Bummer.  I still don't understand why find_reg could chose register 65 
> although it's not in the register class contents for pseudo 238, patched 
> or unpatched compiler.  

I think this is the really interesting question here ...
 
> > exactly the same rtl insn (below) passed into eliminate_regs_in_insn as we
> > do with the patched compiler.  The difference is that the unpatched compiler
> > doesn't attempt to call recog on the insn and doesn't have an gcc_assert.
> 
> Hmm, I seem to be confused, but which patch are you refering to now?  I 
> don't see any which adds a recog() call.

It didn't add a recog call, but it changed the condition in the "if" that
guards the existing recog call, so it is called more often now.

I still think that having a non-recognizable insn in there (even temporarily)
is a hidden bug that could be exposed not just by this particular change,
but by any other change that just happens to trigger re-recognition a bit
more frequently than today ...

> > So I'm guessing, we need to just let this insn pass by without trying to 
> > call recog() on it?
> 
> If that's the problem, then the predicate (the one rejecting special 
> registers) needs testing for reload_in_progress.  Only when that is set 
> should we see temporarily invalid instructions with reg 65 in "r" operands 
> (although I still find that curious to have at all).

I agree that insns should be recogizable at all times.  So we need to find
out why reg 65 is placed there: if this is incorrect, we need to fix it,
if it is correct, we'd have to adapt the predicate along the lines Michael
points out.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list