Skip to content

Upgrade frontend & libs to v2.113#5113

Draft
kinke wants to merge 516 commits into
ldc-developers:masterfrom
kinke:merge-2.113
Draft

Upgrade frontend & libs to v2.113#5113
kinke wants to merge 516 commits into
ldc-developers:masterfrom
kinke:merge-2.113

Conversation

@kinke

@kinke kinke commented Apr 7, 2026

Copy link
Copy Markdown
Member

No description provided.

ibuclaw and others added 30 commits January 6, 2026 19:41
…value

Fix scoping and slice update in Array.reserve
This is a better fix than dlang/dmd#22359 because it is a more direct fix, rather than the rpair test.
For example, structs with mixed named and anonymous bitfields had their
bit offset correctly set, but only named fields had their byte offset
adjusted, which would incorrectly inform backend targets where in the
layout the explicit padding is.
Check noreturn access for typeid and in condition
Adjust offsets for all nameless fields in anon declaration
…-but-match

Improve error message when symbol lookup fails, show where the suggested symbol is located at
…in the build on platforms other than linux

selective imports require the requested symbol to be defined, but it is not for mismatched versions
allow including core.sys.linux.net.if_ and core.sys.linux.hdlc.ioctl …
ignoring access width is only valid for registers, not for memory
fix dlang/dmd!22381 - out-of-bounds access when masking ushort
importC: properly fix dlang/dmd!22153 and dlang/dmd!22365
rainers added 2 commits May 16, 2026 06:40
… "cannot be interpreted at compile time"

bad return type for empty keys and values when interpreting. The latter doesn't result in obvious errors because type.nextOf is as expected.
@kinke

kinke commented May 18, 2026

Copy link
Copy Markdown
Member Author

On Win64, the first hurdle/regression is pretty wild - the compiler quickly ends up with random garbage alignments (incl. for real - alignments over 1000 etc.). Going down that rabbit hole led to the observation that the MSVC++ POD logic is even more curious - not just any ctor makes a struct a non-POD, but apparently also any private (or non-public) data symbols (private functions don't trigger this). Which we have in the frontend for the structalign_t struct - which we treat as POD on the D side, but C++ wants a non-POD because of the private fields.

So any existing LDC miscompiles the new compiler sources on Win64. We can work around this by adding a ctor to the D structalign_t definition for now.

Edit: Filed #5139.

@kinke

kinke commented May 18, 2026

Copy link
Copy Markdown
Member Author

The next problem on Win64 is that we're hitting #3504 now when compiling Phobos' std.parallelism (not touched itself).

@kinke

kinke commented May 18, 2026

Copy link
Copy Markdown
Member Author

On macOS arm64, the single remaining std.uuid problem is dlang/phobos#10862 (comment).

For Linux AArch64, it's the usual annoying x87-centric upstream tests for std.internal.math.gammafunction that need to be adapted for quadruple precision. And probably some separate AArch64-specific thingy as well (NaN sign propagation?), as the unittests fails on musl aarch64 too, with its double-precision real.

The other Posix targets are all green.

rainers and others added 2 commits May 30, 2026 14:47
…sion with associative array (dlang/dmd!23189)

don't evaluate arrExp twice in `arrExp.length++` if non-trivial
…ance in struct .init with -c

A CTFE-evaluated class or struct instance baked into a struct's `.init` needs a
local backing symbol (named "internal", STB_LOCAL) in every object module that
emits the init image. That symbol was cached on the shared AST node
(`cre.value.origin.sym` / `sle.sym`), so when several modules are compiled in one
invocation (`dmd -c a.d b.d`) the symbol created for the first object module leaked
into the later ones, which then emitted only an undefined reference to a local
symbol they never define:

    dmd -c a.d b.d
    dmd a.o b.o -of=app   # undefined reference to `internal'

Track the literals that cache a backing symbol in the current object module and
clear those caches at each object-module boundary (resetCtfeSymbolCache, called
from obj_start, alongside the existing per-object resets), so every object module
re-creates and emits its own self-contained local copy. This matches the
array-literal path (DtBuilder.dtoff) and the separate-compilation behavior, and
keeps intra-module dedup intact. Also fixes the `-lib` variant (dlang/dmd!19439).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ys is handled unflexibly

for backward compatibility allow implicit conversion of `const(char[])` to `string` for AA keys, too.
@kinke kinke mentioned this pull request Jul 3, 2026
@kinke

kinke commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

We can work around (some/most instances of) #3504 for now by defaulting to new -foptimize-nothrow (DMD's -nothrow-optimizations) for MSVC targets. Are we good with that CLI option name?

@rainers

rainers commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

We can work around (some/most instances of) #3504 for now by defaulting to new -foptimize-nothrow (DMD's -nothrow-optimizations) for MSVC targets. Are we good with that CLI option name?

Sounds good to me. I have yet to understand why cleanup in case of Errors is suddenly necessary, while it was never guaranteed before (and only happened to work partially). Conflating Exceptions and Errors was a questionable decision anyway.

@kinke

kinke commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@ibuclaw: Have you already selected a CLI option name for DMD's -nothrow-optimizations? I went with -foptimize-nothrow for now.

@kinke

kinke commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

On macOS arm64, the single remaining std.uuid problem is dlang/phobos#10862 (comment).

That's the only remaining blocker. If you have such a device, a diagnosis/fix would be appreciated, as doing that via CI would be a pain.

@kinke kinke changed the title WIP: Upgrade frontend & libs to v2.113 Upgrade frontend & libs to v2.113 Jul 6, 2026
@ibuclaw

ibuclaw commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@ibuclaw: Have you already selected a CLI option name for DMD's -nothrow-optimizations? I went with -foptimize-nothrow for now.

No. There's no tests for it, and I'm not sure when it might be prefers behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.