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]

Re: a strange infelicity of register allocation



  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


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