-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ICE] extern(C) struct with ctor and field #624
Comments
This is with a release build of LLVM, right? Quite probably, we are generating invalid IR somewhere, which should be easy to catch with a debug build of LLVM. Unfortunately, I can't check this right now, as I am not at my dev machine. |
Sorry, should have written that. It happens on both 0.12.1 and 0.13.0-beta1. |
Okay, thanks – we indeed build those against an LLVM build with assertions disabled. |
I get the assertion, too. I think the root cause is incompatible types but I still need to check this. |
I added the |
This quick fix is disable adding the |
Thanks for the quick fix. |
Well, it was easy to prevent the crash. But now there is an unused optimization opportunity... |
core.demangle.mangleFunc for different linkage types
In case of a ctor 'this' is passed to the function and is also the return value. This is the perfect case for the 'Returned' attribute. But the x86_64 ABI missed the fact that the return value was a pointer to a struct and did a struct rewrite, resulting in an bitcast incompatible type.
ldc2 -c bug.d
Incompatible argument and return types for 'returned' attribute
{ i64, i64 } (%bug.Value_, { i64, i8_ })* @D3bug5Value6__ctorMUNcAyaZS3bug5Value
Broken module found, compilation aborted!
0 ldc2 0x000000000115b1d2 llvm::sys::PrintStackTrace(IO_FILE) + 34
1 ldc2 0x000000000115a781
2 libpthread.so.0 0x00007f7214e13750
3 libc.so.6 0x00007f7214051c39 gsignal + 57
4 libc.so.6 0x00007f7214053348 abort + 328
5 ldc2 0x000000000111dc3b
6 ldc2 0x00000000010f2f6c llvm::FPPassManager::runOnFunction(llvm::Function&) + 540
7 ldc2 0x00000000010f300b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
8 ldc2 0x00000000010f2bbc llvm::legacy::PassManagerImpl::run(llvm::Module&) + 748
9 ldc2 0x000000000111ba71 llvm::verifyModule(llvm::Module const&, llvm::VerifierFailureAction, std::string) + 913
10 ldc2 0x00000000006a206c Module::genLLVMModule(llvm::LLVMContext&) + 1724
11 ldc2 0x000000000055c898 main + 6200
12 libc.so.6 0x00007f721403dd65 __libc_start_main + 245
13 ldc2 0x000000000057566d
The text was updated successfully, but these errors were encountered: