The following: long test() { long r = 0x8000_0000_0000_0000L; long x = -1L; return r / x; // crashes here } import core.stdc.stdio; int main() { printf("result: %llx\n", test()); return 0; } crashes when compiled with -O on 64 bit code.
@WalterBright created dlang/dmd pull request #11244 "fix Issue 20903 - seg fault on long signed divide overflow" fixing this issue: - fix Issue 20903 - seg fault on long signed divide overflow https://github.com/dlang/dmd/pull/11244
dlang/dmd pull request #11244 "fix Issue 20903 - seg fault on long signed divide overflow" was merged into master: - 11c846737fc38474efdcaec3a9211babd43fc8a6 by Walter Bright: fix Issue 20903 - seg fault on long signed divide overflow https://github.com/dlang/dmd/pull/11244