Open llvmbot opened 5 years ago
An unfortunate consequence of our unfortunate decision to represent the thiscall explicitly in the AST.
I don't think it was a mistake, actually. I think for the Microsoft C++ ABI implementation, it's mostly been the right decision.
Anyway, I reverted the "thiscall" part of r349212 in r349872. We still mangle fastcall and stdcall.
I could leave this issue open to cover fixing explicit 'thiscall' conventions, but it doesn't seem very high priority.
Re-titling, this uncovered an actual ABI compatibility bug in r349414.
GCC 8.1 doesn't mangle U8thiscall into member function pointer types, since it's the default convention for member pointers, and it probably would've change a lot of manglings for code that doesn't use explicit calling conventions.
Consider: struct Foo {}; void mem_ptr_test(Foo o, void (Foo::mp)()) { (o->*mp)(); }
GCC produces the name: __Z12mem_ptr_testP3FooMS_FvvE Clang now produces: __Z12mem_ptr_testP3FooMS_U8thiscallFvvE
I'll undo the change just for thiscall for now.
An unfortunate consequence of our unfortunate decision to represent the thiscall explicitly in the AST.
Re-titling, this uncovered an actual ABI compatibility bug in r349414.
GCC 8.1 doesn't mangle U8thiscall into member function pointer types, since it's the default convention for member pointers, and it probably would've change a lot of manglings for code that doesn't use explicit calling conventions.
Consider: struct Foo {}; void mem_ptr_test(Foo o, void (Foo::mp)()) { (o->*mp)(); }
GCC produces the name: __Z12mem_ptr_testP3FooMS_FvvE Clang now produces: __Z12mem_ptr_testP3FooMS_U8thiscallFvvE
I'll undo the change just for thiscall for now.
@llvm/issue-subscribers-clang-codegen
Author: None (llvmbot)
Extended Description
LLVM failed to run TEST 'Clang :: CodeGenCXX/cxx2a-compare.cpp' and TEST 'Clang :: CodeGenCXX/pr33080.cpp' on both x86|debug and x86|release congigurations with MSVC.
Repro steps: 1 git clone -c core.autocrlf=false https://github.com/llvm-mirror/llvm D:\llvm\src\
2 git clone -c core.autocrlf=false https://github.com/llvm-mirror/clang D:\llvm\src\tools\clang 3 open a VS 2017 x86 command prompt and browse to D:\llvm 4 mkdir build_x86 && pushd build_x86 5 cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 ..\src\ 6 msbuild /maxcpucount:4 /p:Platform=Win32 /p:Configuration=RelWithDebInfo build_x86\ALL_BUILD.vcxproj /t:Rebuild
Failures:
-- Testing: 1 tests, 1 threads -- FAIL: Clang :: CodeGenCXX/cxx2a-compare.cpp (1 of 1) **** TEST 'Clang :: CodeGenCXX/cxx2a-compare.cpp' FAILED **** Script:
: 'RUN: at line 1'; d:\llvm\build_x86\relwithdebinfo\bin\clang.EXE -cc1 -internal-isystem d:\llvm\build_x86\relwithdebinfo\lib\clang\8.0.0\include -nostdsysteminc -std=c++2a -emit-llvm D:\LLVM\src\tools\clang\test\CodeGenCXX\cxx2a-compare.cpp -o - -triple i686-pc-windows-gnu | D:\LLVM\build_x86\RelWithDebInfo\bin\FileCheck.EXE D:\LLVM\src\tools\clang\test\CodeGenCXX\cxx2a-compare.cpp '-DWE="class.std::1::weak_equality"' '-DSO="class.std::__1::strong_ordering"' '-DSE="class.std::1::strong_equality"' '-DPO="class.std::__1::partial_ordering"' -DEQ=0 -DLT=-1 -DGT=1 -DUNORD=-127 -DNE=1
Exit Code: 1
Command Output (stdout):
$ ":" "RUN: at line 1" $ "d:\llvm\build_x86\relwithdebinfo\bin\clang.EXE" "-cc1" "-internal-isystem" "d:\llvm\build_x86\relwithdebinfo\lib\clang\8.0.0\include" "-nostdsysteminc" "-std=c++2a" "-emit-llvm" "D:\LLVM\src\tools\clang\test\CodeGenCXX\cxx2a-compare.cpp" "-o" "-" "-triple" "i686-pc-windows-gnu" $ "D:\LLVM\build_x86\RelWithDebInfo\bin\FileCheck.EXE" "D:\LLVM\src\tools\clang\test\CodeGenCXX\cxx2a-compare.cpp" "-DWE="class.std::1::weak_equality"" "-DSO="class.std::__1::strong_ordering"" "-DSE="class.std::1::strong_equality"" "-DPO="class.std::__1::partial_ordering"" "-DEQ=0" "-DLT=-1" "-DGT=1" "-DUNORD=-127" "-DNE=1"
command stderr:
D:\LLVM\src\tools\clang\test\CodeGenCXX\cxx2a-compare.cpp:76:17: error: CHECK-LABEL: expected string not found in input // CHECK-LABEL: @_Z12mem_ptrtestM6MemPtrFvvES1 ^