This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: peephole eliminating register use: how to not ICE?
- To: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Subject: Re: peephole eliminating register use: how to not ICE?
- From: Michael Poole <poole at troilus dot org>
- Date: 12 Apr 2001 15:17:22 -0400
- Cc: gcc at gcc dot gnu dot org
- References: <200104121850.f3CIoQq20212@phal.cambridge.redhat.com>
Joern Rennecke <amylaar@cambridge.redhat.com> writes:
> > I assume that the complaint is because register 9 was added in the
> > second regset (from verify_local_live_at_start, the new_live_at_start
> > set) but not in the first (new_live_at_start).
> >
> > So, digging back through the earlier dump files, I look to see when R9
> > was last used in that basic block. One of the peepholes removed it --
> > in mpls.c.21.flow2, I see:
> >
> > (insn 260 261 262 (set (reg/v:QI 9 R9 [73])
> > (zero_extract:QI (reg:QI 2 R2 [100])
> > (const_int 8 [0x8])
> > (const_int 24 [0x18]))) 35 {extzv} (nil)
> > (expr_list:REG_DEAD (reg:QI 2 R2 [100])
> > (nil)))
>
> Is that the first use of register 9 in bb 13? If so, that would indicate
> that life_at_start has been computed incorrectly. Note, it is not a list of
> registers that are used in the basic block, but a list of registers that are
> life at the start of the block, i.e. where it does matter what value they
> contain at the start.
Yes, it is the first use. BB 13 contains only notes plus the insns I
listed in my original email. Ah, and now I think I see the problem:
bb 23, an eventual successor of bb 13, tries to use R9, and so the
value is actually needed.
So it was incorrect for the peephole to eliminate setting of R9, and I
need to check liveness past the conditional branch. Since I didn't
understand exactly what the live_at_start meant, I didn't think to
check that.
Thanks!
-- Michael