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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|rguenth at gcc dot gnu.org         |

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it likely expects f1@GOTPCREL(%rip) to be CSEd?

f2:
.LFB2:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    *f1@GOTPCREL(%rip)
        leaq    f3(%rip), %rax
        call    *%rax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        jmp     *f1@GOTPCREL(%rip)

indeed with GCC 14 we get

f2:
.LFB2:
        .cfi_startproc
        pushq   %rbx
        .cfi_def_cfa_offset 16
        .cfi_offset 3, -16
        movq    f1@GOTPCREL(%rip), %rbx
        call    *%rbx
        leaq    f3(%rip), %rax
        call    *%rax
        movq    %rbx, %rax
        popq    %rbx
        .cfi_def_cfa_offset 8
        jmp     *%rax

I think both are perfectly OK for what the testcase should expect, so it's
a testism.  But I think it's also a missed optimization now.

Reply via email to