(CVS sources, ~6AM this morning US/eastern)

typedef unsigned long long uint64_t;
uint64_t foo (uint64_t n) {
  return (n >> 32) | (n << 32);
}

compiled with -O9 -fomit-frame-pointer:

foo:
        pushl   %ebx
        movl    12(%esp), %ebx
        movl    8(%esp), %ecx
        movl    %ebx, %eax
        popl    %ebx
        movl    %ecx, %edx
        ret

It should've been able to load 4(%esp) and 8(%esp) into %edx and %eax 
respectively, without using the 
extra stack slot to save ebx.

-- 
           Summary: swapping DImode halves produces poor x86 register
                    allocation
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raeburn at raeburn dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to