Bug 21813 – [REG-master] Bootstrap broken from dmd-cxx baseline.
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-09T07:00:08Z
Last change time
2021-04-09T15:05:54Z
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2021-04-09T07:00:08Z
First noticed in https://github.com/dlang/dmd/pull/12405
Confirmed that it's master that broke it in https://github.com/dlang/dmd/pull/12407
ICE when compiling dmd is:
-----------------------------------------------------------
src/dmd/target.d(122): called from here: defaultTargetOS()
dmd: statement.c:290: ErrorStatement::ErrorStatement(): Assertion `global.gaggedErrors || global.errors' failed.
posix.mak:107: recipe for target 'dmd' failed
Comment #2 by iamthewilsonator — 2021-04-09T07:27:08Z
defaultTargetOS is a trivial leaf function:
Target.OS defaultTargetOS()
{
static if (TARGET.Windows)
return Target.OS.Windows;
else static if (TARGET.Linux)
return Target.OS.linux;
else static if (TARGET.OSX)
return Target.OS.OSX;
else static if (TARGET.FreeBSD)
return Target.OS.FreeBSD;
else static if (TARGET.OpenBSD)
return Target.OS.OpenBSD;
else static if (TARGET.Solaris)
return Target.OS.Solaris;
else static if (TARGET.DragonFlyBSD)
return Target.OS.DragonFlyBSD;
else
static assert(0, "unknown TARGET");
}
is it hitting the static assert?
Comment #3 by ibuclaw — 2021-04-09T08:03:14Z
(In reply to Nicholas Wilson from comment #2)
> is it hitting the static assert?
Nope, reduced:
---
Target.OS defaultTargetOS()
{
return Target.OS.linux;
}
struct Target
{
enum OS { linux }
OS os = defaultTargetOS();
void deinitialize()
{
this.init;
}
@property isPOSIX() scope @nogc
{
}
}
---
Comment #4 by ibuclaw — 2021-04-09T08:04:45Z
(In reply to Iain Buclaw from comment #3)
> (In reply to Nicholas Wilson from comment #2)
> > is it hitting the static assert?
>
> Nope, reduced:
And removing the deinitialize function causes:
---
dmd/target.d(10): called from here: defaultTargetOS()
dmd: todt.c:77: virtual void Initializer_toDt(Initializer*, DtBuilder&)::InitToDt::visit(Initializer*): Assertion `0' failed.
Comment #5 by iamthewilsonator — 2021-04-09T08:13:07Z
And to confirm this is dmd-cxx compiling dmd master that fails?
Comment #6 by ibuclaw — 2021-04-09T08:54:04Z
(In reply to Nicholas Wilson from comment #5)
> And to confirm this is dmd-cxx compiling dmd master that fails?
Yes, which may mean some older versions of dmd fail too.
Comment #7 by ibuclaw — 2021-04-09T08:54:53Z
(In reply to Iain Buclaw from comment #6)
> (In reply to Nicholas Wilson from comment #5)
> > And to confirm this is dmd-cxx compiling dmd master that fails?
>
> Yes, which may mean some older versions of dmd fail too.
I say may, what I really mean is very likely.
Tracked it down, the ICE is related to, and is fixed by issue 19415.
Comment #8 by dlang-bot — 2021-04-09T10:10:22Z
@ibuclaw created dlang/dmd pull request #12411 "[dmd-cxx] fix Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline" mentioning this issue:
- [dmd-cxx] Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline
https://github.com/dlang/dmd/pull/12411
Comment #9 by dlang-bot — 2021-04-09T10:23:05Z
dlang/dmd pull request #12410 "Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline" was merged into master:
- 60f47687eb933e5b45ca7909cb1963453256e113 by Iain Buclaw:
Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline
https://github.com/dlang/dmd/pull/12410
Comment #10 by dlang-bot — 2021-04-09T10:29:26Z
dlang/dmd pull request #12411 "[dmd-cxx] fix Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline" was merged into dmd-cxx:
- f3d44ec5701b1b60b1f6bd6500b788be2a948320 by Iain Buclaw:
[dmd-cxx] Issue 21813 - [REG-master] Bootstrap broken from dmd-cxx baseline
https://github.com/dlang/dmd/pull/12411