Manjaro/Arch x86_64, gdc 8.2.0 from AUR/gdc-git. > $ gdc --version > gdc (GDC 8.2.0 based on D v2.081.2 built with ISL 0.19 for Arch Linux) 8.2.0 The heavily reduced snippet at the following gist segfaults when compiling. > https://gist.github.com/zorael/f4a5f37a5bccdcb16539cc0c27d8f1f9
Reproducible on stable/2.076 also.
Reduced and pasted here (gists may have a habit of disappearing). --- void crash() { applyConfiguration(42); } void applyConfiguration(Things...)(Things things) { thingloop: foreach (i; things) { switch (i) { continue thingloop; default: } } } --- Problem is triggered by unrolled loop statements.
More complete test that covers three combinations of problems: 1. Continue label in unrolled loop 2. Break label in unrolled loop 3. Loop body unrolled more than once. I have something for 1 and 2, but not 3 currently. --- void test307() { apply307(1, 2, 3); } void apply307(T...)(T ts) { tloop: foreach (t; ts) { switch (t) { continue tloop; default: } } tloop2: foreach (t; ts) { switch (t) { break tloop; default: } } }
Actually, there's more. --- void test307() { apply307(1, 2, 3); } void apply307(T...)(T ts) { tloop: foreach (t; ts) { switch (t) { continue tloop; default: } } tloop2: foreach (t; ts) { switch (t) { break tloop; default: } } tloop3: foreach (t; ts) { switch (t) { continue; default: } } tloop4: foreach (t; ts) { switch (t) { break; default: } } } --- I think I have a fix, though will try it out later...