[Bug rtl-optimization/70750] New: [6/7 Regression] Load and call no longer combined for indirect calls on x86

amonakov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 21 10:54:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70750

            Bug ID: 70750
           Summary: [6/7 Regression] Load and call no longer combined for
                    indirect calls on x86
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-*-*, i?86-*-*

int f(int (**p)(void))
{
  return -p[1]();
}

gcc-6 -O2 produces:

f:
        subq    $8, %rsp
        movq    8(%rdi), %rax
        call    *%rax
        addq    $8, %rsp
        negl    %eax
        ret

gcc-5.1 -O2 could combine movq+call into one memory-indirect call:

f:
        subq    $8, %rsp
        call    *8(%rdi)
        addq    $8, %rsp
        negl    %eax
        ret


More information about the Gcc-bugs mailing list