February 13, 2023
https://issues.dlang.org/show_bug.cgi?id=23705

          Issue ID: 23705
           Summary: dmd: src/dmd/backend/cgcod.d:734: Assertion `sz >= 0'
                    failed.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: kdevel@vogtner.de

using a non-release build:

$ ./dmd --version
DMD64 D Compiler v2.102.0-98-g67b6ee0-dirty
Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
written by Walter Bright
$ cat test.d
void main ()
{
   ubyte [0x7fff_fffe] x;
}
$ ./dmd test.d
dmd: src/dmd/backend/cgcod.d:734: Assertion `sz >= 0' failed.
Abgebrochen

The values of some variables after casting to long are:

base = -2147483646
alig = 8
bias = 8
sz   = -2147483642

maybe related to issue 23679

--