This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: REG_N_REFS vs regmove
- To: law at cygnus dot com
- Subject: Re: REG_N_REFS vs regmove
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Fri, 26 Jun 1998 17:35:49 -0700
- cc: egcs-patches at cygnus dot com, amylaar at cygnus dot com
It looks like a reasonable patch to fix the code generation bug.
+ if (REG_N_REFS (sregno) <= 2)
+ REG_N_REFS (dregno) = 3;
I noticed one typo. This should be dregno in both places.
We would of course get better code if REG_N_REFS was exactly correct,
but I don't think that should be a requirement to fix the code generation
bug.
If a register is eliminated, but REG_N_REFS is still non-zero, then we end
up allocating a stack slot for it which will never be used. This causes
us to use more stack space than we should, but is otherwise harmless.
It would be nice if this was fixed. I have seen this happen before because
combine didn't update REG_N_REFS. Maybe we could just recompute REG_N_REFS
before register allocation rather than trying to keep it up-to-date as
we go along.
Jim