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

            Bug ID: 43695
           Summary: clang fatal error using __declspec(allocator) with -O3
                    : "error in backend: invalid symbol redefinition"
           Product: new-bugs
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: sylvain.a...@ubisoft.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

I discovered this bug with clang 9.0.0, under windows. It seems to be there in
trunk too.
Note that removing the _declspec(allocator), the expression in the alloc() call
parameter, or even the call to f2() will compile.


F:\>type test.cpp
__declspec(allocator) void *alloc(unsigned int size);

void f2();

void f1(unsigned int *size_ptr) {
    void *hg = alloc(size_ptr ? *size_ptr : 1UL);
    f2();
}

F:\>
F:\>
F:\>clang++.exe -cc1 -S -x86-asm-syntax=intel -debug-info-kind=limited
-fms-extensions -O3 -x c++ test.cpp

fatal error: error in backend: invalid symbol redefinition
Stack dump:
0.      Program arguments: clang++.exe -cc1 -S -x86-asm-syntax=intel
-debug-info-kind=limited -fms-extensions -O3 -x c++ test.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test.cpp'.
4.      Running pass 'X86 Assembly Printer' on function '@"?f1@@YAXPEAI@Z"'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to