Test case:
---
# timeout 5 dmd -O bug.d
struct Buf
{
char[7_000] buffer = void;
}
void main()
{
uint len;
auto b = Buf();
b.buffer[len] = 'a';
}
---
In case you thought that the timeout of 5 seconds is too short, I compared build times of the two releases in full.
Compiler | Build time
----------------------
2.077.1 | 0m0.527s
2.078.0 | 1m3.694s
Comment #7 by safety0ff.bugz — 2020-04-29T18:39:53Z
Created attachment 1781
preliminary patch
Attached a preliminary patch.
It doesn't help the other related bugzilla issues, but takes the test case from this issue from 1m5.368s -> 0m0.603s.
Comment #8 by dlang-bot — 2020-05-01T00:19:01Z
@WalterWaldron created dlang/dmd pull request #11085 "fix Issue 19550 - [REG 2.078] Massive compiler backend slowdown" fixing this issue:
- fix Issue 19550 - [REG 2.078] Massive compiler backend slowdown
Fixes typo which caused a redundant O(N^2) slowdown.
https://github.com/dlang/dmd/pull/11085
Comment #9 by dlang-bot — 2020-05-01T19:48:44Z
dlang/dmd pull request #11085 "fix Issue 19550 - [REG 2.078] Massive compiler backend slowdown" was merged into master:
- 8e4338627e5be46e79770289bb0948a9712a5330 by WalterWaldron:
fix Issue 19550 - [REG 2.078] Massive compiler backend slowdown
Fixes typo which caused a redundant O(N^2) slowdown.
https://github.com/dlang/dmd/pull/11085