------- 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