This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/17237] New: inefficient parameter passing on x86


Compiling:
unsigned long long LLD(unsigned long long arg1, unsigned long long arg2)
{
  return arg1 /  arg2;
}

with gcc -O2 -fomit-frame-pointer generates:
        subl    $28, %esp
        movl    40(%esp), %eax
        movl    44(%esp), %edx
        movl    %eax, 8(%esp)
        movl    32(%esp), %eax
        movl    %edx, 12(%esp)
        movl    36(%esp), %edx
        movl    %eax, (%esp)
        movl    %edx, 4(%esp)
        call    __udivdi3
        addl    $28, %esp
        ret

which is 48 bytes.

The ICC generated code is 28 bytes:

        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        pushl     16(%esp)                                      #521.17
        call      __udivdi3                                     #521.17
        addl      $16, %esp                                     #521.17
        ret                                                     #521.17

-- 
           Summary: inefficient parameter passing on x86
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]