This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug in mark_referenced_regs?
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 26 Jun 2002 20:52:00 -0700
- Subject: Bug in mark_referenced_regs?
yI'm looking at a problem that seems to step from caller-save.c.
In particular, I've got:
(set (reg:SI r2) ...)
(.... (reg:SI r2) ...) ; A use of r2.
Caller-save.c decides to restore r2 right before the call. The only
problem is that it does that *after* the set, effectively throwing out
the value of the set.
In save_call_clobbered_regs (which despite its name also restores
call-clobberred regs), there is no code to remove registers written to
from hard_regs_saved.
(You might ask why we're saving and restoring r2. That's complicated.
r2 starts out as a subreg of a DI mode register, before register
allocation, which seems to perplex life analysis somewhat.)
Thoughts?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com