------- Comment #4 from tony dot linthicum at amd dot com  2006-01-20 15:48 
-------
I've been looking at this a bit, and tried the patch.  It does indeed fix the
problem in test1 above, but it does not appear to be the complete solution. 
The load of 'x' in test1 is actually split fairly early, and from what I can
tell, the  superfluous move is actually the result of the register allocator
doing a poor job of live range analysis when confronted with subregs.  I
suspect this is why most things (i.e. those things other than branches) are not
split into subregs until after reload.  Unfortunately, the subreg lowering
won't touch a subreg if it's seen a reference to the "inner" register so we get
the same unnecessary move if the code looks like:

foo(long long y, long long z) 
{
  unsigned long long x;

  x = y + z;
  if (x) gh();
}

I'm going to experiment with moving where the subreg lowering code occurs and
moving up the splitting into subregs and see if I can get the desired results. 
I'm pretty new to GCC, so if any of the above seems like I'm off in the weeds
then please let me know.




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15792

Reply via email to