You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't enforce (normal) emission for pragma(inline, true) function templates
Debugging failing fail_compilation/ice19762.d (stack overflow in LDC)
was a trip down the rabbit hole.
By the looks of it, the root of all evil is again the frontend not
properly validating IndexExpressions - this time, for structs with fwd-
referencing errors (analogous to the problem for opaque structs with
compilable/ice20044.d, see https://issues.dlang.org/show_bug.cgi?id=20959).
The stack overflow happens in LLVM when trying to create a GEP for
core.internal.array.equality.at(), when checking the struct element type
(with cycles, i.e., containing a field of itself) for sizedness. This
little function now uses `pragma(inline, true)`, so it was newly
codegen'd although needsCodegen() returns false.
With the new available_externally emission into each referencing CU, I
think this enforced regular emission from the module members tree
shouldn't be required anymore, allowing to work around the test
regression and possibly more issues with speculative instantiations.
After adapting the codegen/inlining_templates.d lit-test accordingly (no
IR definitions anymore in .ll file, because available_externally doesn't
make it there), I've noticed that a lambda in imported and inlined
call_enforce_with_default_template_params() wasn't emitted - it got
culled by alreadyOrWillBeDefined().
Function/delegate literals aren't culled anymore.
0 commit comments