Repository navigation
Conversation
DMD perf check
All measurementsd1ba7a2 vs merge-base f5a2e5c · about these metrics · historical dashboard |
zxan
force-pushed
the
fix18202-toStringSymbol
branch
from
November 16, 2026 07:35
235d015 to
40db340
Compare
thewilsonator
approved these changes
Nov 16, 2026
thewilsonator
left a comment
Contributor
There was a problem hiding this comment.
otherwise looks good
zxan
force-pushed
the
fix18202-toStringSymbol
branch
from
November 16, 2026 11:50
40db340 to
9952963
Compare
dkorpel
reviewed
Nov 17, 2026
zxan
force-pushed
the
fix18202-toStringSymbol
branch
3 times, most recently
from
November 23, 2026 20:22
0bbb62a to
46527a0
Compare
zxan
force-pushed
the
fix18202-toStringSymbol
branch
from
November 25, 2026 12:31
46527a0 to
d1ba7a2
Compare
Comment on lines
+19
to
+20
| auto w8 = cast(long[1])"abcdefgh"c; | ||
| assert(w8[0] == 0x6867_6665_6463_6261); |
Contributor
There was a problem hiding this comment.
is this dependant on byte order?
Contributor
Author
There was a problem hiding this comment.
yes it is, thanks for catching, should I switch back to reading bytes back as char?
Contributor
Author
There was a problem hiding this comment.
replace it with this?
auto w8 = cast(long[1])"abcdefgh"c;
auto w8b = cast(const(char)*)w8.ptr;
foreach (i; 0 .. 8)
assert(w8b[i] == 'a' + i);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18202.
The ELF section flags were fixed earlier, but literals used as pointers never reached the mergeable section.
visitStringlowered theTpointercase toOPstring, which the backend pools separately and writes into plain.rodata, so"hello"and"hello".ptrwere two copies at two addresses even within a single module.Use
toStringSymbolfor pointers too, which is what Mach-O AArch64 already did. Nothing else depends onOPstring:the only folds keyed on it rewritestrcpy/strcmp, which the frontend never generates.toStringSymbolalso needed fixing. It pooled on the raw bytes without the code unit size, so"",""wand""dshared one symbol and whichever was emitted first decided the terminator width. That was harmless while only arrays used the pool, since arrays carry their length and never read the terminator, but it breaks pointers. The key now includessz.