-
-
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
Incorrect LLVM type for struct with single align(1) member #4719
Comments
Regression due to d16fba3 (note the changes in the gh2346.d testcase) |
Seems to only go wrong for nested contexts of delegates, but I don't yet see where it actually goes wrong in codegen (i.e. for release builds without the assert, does it actually result in a crashing program) ; LDC 1.30:
%.frame = call i8* @_d_allocmemory(i64 6)
; LDC 1.38:
%.gc_frame = call ptr @_d_allocmemory(i64 8) |
I think I came to the conclusion that the alignment cannot be represented for an IR type anyway, e.g., something exotic like Looks like there's something missing for closures then. Note that making sure the heap-allocated closures themselves are aligned sufficiently (to the max of their member alignments) is something pretty recent; |
In the LDC v1.38 IR, the problem is that the closure type somehow isn't packed, although a struct %onlineapp.TraceBuf = type { i32 }
%nest.foo = type { [2 x i8], %onlineapp.TraceBuf }
%onlineapp.Container = type <{ [2 x i8], %onlineapp.TraceBuf }> |
Ah, looks like that assertion in |
…turally aligned, to fix ldc-developers#4719
…turally aligned, to fix ldc-developers#4719
…turally aligned, to fix ldc-developers#4719
This test case triggers the assert:
ldc/ir/irtypeaggr.cpp
Line 43 in 48c1dff
This is a minimized testcase, that no longer crashes LDC. The original case ran into the error
Error: variable ... overlaps previous field. This is an ICE, please file an LDC issue.
The reason is that the LLVM type is wrong since 1.31.0.
Used to be:
%example.TraceBuf = type <{ i32 }>
but now is:
%example.TraceBuf = type { i32 }
, i.e. alignment is not 1 but 4.The text was updated successfully, but these errors were encountered: