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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|IPA SRA removes tail-call   |IPA SRA removes
                   |opportunities               |sibling-call opportunities

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
For example

struct X { int i; int j[2]; };

static int foo (int k, struct X x)
{
  return x.i + x.j[0] + x.j[1];
}

int bar (int k, struct X x)
{
  return foo (k, x);
}

Compiled with -O2 -fno-inline (or just make foo large enough):

foo.isra.0:
.LFB2:
        .cfi_startproc
        movq    %rdi, %rax
        shrq    $32, %rax
        addl    %eax, %edi
        leal    (%rdi,%rsi), %eax
        ret

bar:
.LFB1:
        .cfi_startproc
        movq    %rsi, %rdi
        movl    %edx, %esi
        jmp     foo.isra.0

with -fno-ipa-sra added:

foo:
.LFB0:
        .cfi_startproc
        movq    %rsi, %rax
        shrq    $32, %rax
        addl    %eax, %esi
        leal    (%rsi,%rdx), %eax
        ret

bar:
.LFB1:
        .cfi_startproc
        jmp     foo

Reply via email to