This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a strange infelicity of register allocation
- To: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: a strange infelicity of register allocation
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Thu, 28 Jan 1999 09:02:45 -0700
- cc: Joern Rennecke <amylaar at cygnus dot co dot uk>, egcs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <199901271634.LAA20086@blastula.phys.columbia.edu>you write:
> On Tue, 26 Jan 1999 15:44:06 +0000 (GMT), Joern Rennecke wrote:
>
> >> C:
> >> buf = xrealloc (buf, op - buf);
> >> fp->buf = buf;
> >> return op - buf;
> >>
> >> becomes
> [...]
>
> >The first problem here is that (op - buf) hasn't been subjected to cse.
> >Is the address of buf taken anywhere in this function?
>
> No, neither buf nor op has its address taken.
>
> Right before CSE, we have this RTL for the above code. CSE makes no
> changes except to annotate insns with patterns. Flow thinks this is
> one basic block, and that reg 86 is dead after insn 608.
>
> Local register allocation says reg 86 is bb-local but doesn't give it
> a hard register. Combine collapses reg 87 into reg 28.
There is no common subespression here because "buf" is changed (it's the return
value of the xrealloc call).
Thus, the value computed into pseudo 86 by insn 606 is not necessarily the same
as the value computed into pseudo 87 by insn 620.
jeff