Sorry: the reduced example still depends on:
https://github.com/atilaneves/unit-threadedhttps://github.com/QAston/DMocks-revived
a.d:
import unit_threaded;
b.d:
import c;
c.d:
import dmocks.mocks;
> dmd -c -deps -IDMocks-revived -Iunit-threaded/source a.d b.d -of/dev/null
...
Segmentation fault
Workaround(?): use -o- instead of -of/dev/null
Comment #1 by dlang-bugzilla — 2017-07-06T16:11:27Z
Reducing.
Comment #2 by dlang-bugzilla — 2017-07-07T05:27:46Z
Reduced:
//////////// a.d ////////////
import b;
//////////// b.d ////////////
void foo() {
import c;
}
//////////// c.d ////////////
struct {
void ()
}
////////// build.sh /////////
dmd -c -deps a.d -of/dev/null
/////////////////////////////
Bisection points to https://github.com/dlang/dmd/pull/6748 but it's more likely that that change simply exposed a latent bug.
Comment #3 by code — 2017-07-14T13:05:09Z
We'll address this with 2.075.1 to not delay the release even further.
Comment #4 by code — 2017-08-03T17:29:48Z
The reduced case segfaults on invalid code, seems to be different from the reported issue.
Comment #5 by code — 2017-08-03T17:30:51Z
@Mario, try to avoid external dependencies in bug reports, but if you include them, please use a fixed commit/tag, so we can reproduce the issue.
Comment #6 by code — 2017-08-03T17:50:49Z
Happens because a function ends up in the glue layer in PASSsemantic2 state (std.range.SortedRange!(string[], "a < b").SortedRange.__xopEquals).
It's a side-effect of bluntly trying to run semantic3 on all imported modules (https://github.com/dlang/dmd/pull/6748).
Seems like the deferred STCinference mechanism added in https://github.com/dlang/dmd/pull/5075 isn't run for the compiler generated __x* methods.
Comment #7 by code — 2017-08-03T17:59:48Z
I'd say that the change in https://github.com/dlang/dmd/pull/6748 and using -deps without -o- are suboptimal, as you'd end up with all the codegen from the semantic3 in imported methods in your object files, not particularly nice.
This is unfortunately similar to how inlining is implemented in dmd :/.
Comment #8 by robert.schadek — 2024-12-13T18:53:09Z