This is the mail archive of the gcc@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]
Other format: [Raw text]

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


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