This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/7871: ICE on legal code, global register variables problems
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, rz at linux-m68k dot org, wilson at gcc dot gnu dot org
- Date: 28 Feb 2003 11:43:48 -0500
- Subject: Re: c/7871: ICE on legal code, global register variables problems
- References: <3E5ED649.9080002@tuliptree.org> <20030228054711.GB12834@redhat.com>
On Fri, 2003-02-28 at 00:47, Richard Henderson wrote:
> /* Calls may also reference any of the global registers,
> so they are made live. */
> for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> if (global_regs[i])
> mark_used_reg (pbi, regno_reg_rtx[i], cond, insn);
We first call mark_set_1 (... CLOBBER...) which kills the register.
Then we call mark_used_reg which makes it live again, and adds a
REG_DEAD note to the call. This REG_DEAD note is wrong. This confuses
combine into deleting the instruction because there is a REG_DEAD note
for it and no visible use of it after combination. It doesn't seem
right to modify combine to treat REG_DEAD notes for global regs
specially. I think we need to avoid adding the REG_DEAD note in the
first place.
Maybe what we should do here is call mark_set_reg (...SET...) for global
regs instead of mark_set_1 (...CLOBBER...). I think this might work. I
will try this. I have some other easier patches to deal with, so I will
get back to this later.
Jim