This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/21182] gcc can use registers but uses stack instead
- From: "vda at port dot imtp dot ilyichevsk dot odessa dot ua" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Apr 2005 13:05:22 -0000
- Subject: [Bug rtl-optimization/21182] gcc can use registers but uses stack instead
- References: <20050423223032.21182.vda@port.imtp.ilyichevsk.odessa.ua>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From vda at port dot imtp dot ilyichevsk dot odessa dot ua 2005-04-24 13:05 -------
With 4.0.0: gcc -O2 gives the same result as gcc -O3,
which is better than gcc 3.4.3 -O2 but worse than 3.4.3 -O3.
For example:
movl %edx, -20(%ebp)
orl %ecx, %edi
movl %ebx, %esi
xorl %ecx, %esi
andl %eax, %ebx
xorl %edi, %ebx
movl %eax, %ecx
notl %ecx
xorl %ebx, %ecx
orl %edi, %eax
xorl %eax, %esi
rorl $19, %esi
rorl $29, -20(%ebp)
xorl %esi, %ebx
xorl -20(%ebp), %ecx
xorl -20(%ebp), %ebx
rorl $31, %ebx
leal 0(,%esi,8), %edx
1) Why %edx was stored in -20(%ebp), there is no %edx usage
in the following insns. %edx value could stay in register
and we can continue to work on its value in register.
2) rorl $31, %ebx == roll $1, %ebx, but 1 bit roll insn is
smaller.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21182