This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21596] [4.0/4.1/4.2/4.3 Regression] extra temporaries when using global register variables
- From: "amacleod at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Mar 2007 22:43:32 -0000
- Subject: [Bug tree-optimization/21596] [4.0/4.1/4.2/4.3 Regression] extra temporaries when using global register variables
- References: <bug-21596-119@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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