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