This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug tree-optimization/21596] [4.0/4.1/4.2/4.3 Regression] extra temporaries when using global register variables



------- Comment #7 from amacleod at redhat dot com  2007-03-05 22:43 -------
Created an attachment (id=13149)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13149&action=view)
proposed patch for 4.3

This patch removes one of the temporary copies.  With this minor tuning of one
of TERs heuristics, the tree optimizers produce:
  reg.27 = reg - 4B;
  reg = reg.27;
  return *reg.27 <= 0;

Getting rid of the remaining middle copy is slightly little tricker, because it
involves a VDEF.

On mainline, this produces the (I think) desired assembly:
        subl    $4, %edi
        xorl    %eax, %eax
        cmpl    $0, -4(%edi)
        setle   %al
        ret


-- 


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


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