[llvm-bugs] [Bug 46764] New: Mangled names involving inline function incomplete local types lack discriminators

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 17 10:19:06 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46764

            Bug ID: 46764
           Summary: Mangled names involving inline function incomplete
                    local types lack discriminators
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at catmur.co.uk
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

void e(void(*)());
template<class> void f() {}
inline void g() {
    if (1)
        e(&f<struct S>);
    if (1)
        e(&f<struct S>);
}
void (*p)() = &g;

generates:

_Z1gv:                                  # @_Z1gv
        push    rax
        mov     edi, offset _Z1fIZ1gvE1SEvv
        call    _Z1ePFvvE
        mov     edi, offset _Z1fIZ1gvE1SEvv
        pop     rax
        jmp     _Z1ePFvvE                       # TAILCALL
_Z1fIZ1gvE1SEvv:                        # @_Z1fIZ1gvE1SEvv
        ret
p:
        .quad   _Z1gv

If 'inline' is removed the second 'S' is correctly assigned a discriminator,
giving _Z1fIZ1gvE1S_0Evv.

gcc compiles correctly (since 6.1).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200717/781ac9a8/attachment.html>


More information about the llvm-bugs mailing list