-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Upgrade frontend & libs to v2.096.0+ #3678
Conversation
It's apparently already in the AST, e.g., for core.internal.abort.
…ked critical section)
9c45b89
to
d7d89e8
Compare
This fixes dmd-testsuite's compilable/b16598.d by making sure to (partially) constant-fold dtor expressions of VarDeclarations too. dlang/dmd#12176 made these __cond temporaries const, triggering constant-folding and potentially getting rid of it altogether when optimizing a CondExp.
This fixes a new object.d unittest showing this pretty severe bug, which appears to be a v1.25 regression. The `TypeInfo_Interface.info` field (a TypeInfo_Class ref) pointed to its own TypeInfo_Interface (not derived from TypeInfo_Class; simply bitcast) instead of the interface's __InterfaceZ symbol.
Which is *returned* differently than a corresponding struct (but *passed* in memory too).
By returning them like c{float,double,real}, with a notable special case for cfloat.
…emplates for D executables
Hi @kinke . I see that on the macOS tester, there are warnings in compiling the Edit: dlang/druntime#3420 |
Hi Johan, thx. Does this fix the seemingly clang/libc++-specific failure? |
I did not test it. It probably doesn't fix it, because it already worked for DMD... I'll look into it tonight. |
The issue with the stdcpp memory test on macOS: we do a double delete. I simplified the testcase a bit: // In C++:
void doNothing(std::unique_ptr<int> x)
{
printf("cpp: %p\n", x.get());
x.reset();
printf("cpp: %p\n", x.get());
} // In D:
unique_ptr!int up = make_unique!int(10);
printf("%p\n", up.get);
doNothing(up.move); Running that (compiled with
A backtrace shows that the double free happens while running a |
I think I found the problem. The IR looks like this: %3 = bitcast %"core.stdcpp.memory.unique_ptr!(int, default_delete!int).unique_ptr"* %.hidden_copy_for_IndirectByvalRewrite to i8* ; [#uses = 1]
%4 = bitcast %"core.stdcpp.memory.unique_ptr!(int, default_delete!int).unique_ptr"* %__pfx6 to i8* ; [#uses = 1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %3, i8* align 8 %4, i64 8, i1 false)
call void @_Z9doNothingNSt3__110unique_ptrIiNS_14default_deleteIiEEEE(%"core.stdcpp.memory.unique_ptr!(int, default_delete!int).unique_ptr"* noalias nocapture align 8 %.hidden_copy_for_IndirectByvalRewrite) #1
br label %dtor.__pfx6 Note that the temporary for the |
Ah thx for digging. C++ interop wrt. non-PODs passed by value has been fixed on non-Windows with v2.096, making the caller responsible for destructing the arg (passed by ref under the hood). |
…all arguments Thus preventing bitcopies for IndirectByvalRewrite, passing the temporary directly by ref instead. This fixes druntime's stdcpp-memory test.
As upstream since v2.096.
Conflicts: gen/dibuilder.cpp
No description provided.