[llvm-bugs] [Bug 41776] New: Using __attribute__((weak, dllimport)) results in clang generating invalid IR

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 6 12:47:32 PDT 2019


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

            Bug ID: 41776
           Summary: Using __attribute__((weak,dllimport)) results in clang
                    generating invalid IR
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Consder:

int __attribute__((weak, dllimport)) my_weak(int x); // { return x; }
int main() {
  if (my_weak)
    my_weak(0);
  return 13;
}

$ clang -cc1 -triple x86_64-windows-msvc t.c -S -o t.s
Global is marked as dllimport, but not external
i32 (i32)* @my_weak
fatal error: error in backend: Broken module found, compilation aborted!
Stack dump:
0.      Program arguments: C:\src\llvm-project\build\bin\clang.exe -cc1 -triple
x86_64-windows-msvc t.c -S -o t.s
1.      <eof> parser at end of file
2.      Per-function optimization

-- 
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/20190506/65f33072/attachment.html>


More information about the llvm-bugs mailing list