Bug 19857 – Name mangling mismatch when compiling with -dip1000

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-05-09T10:51:13Z
Last change time
2019-05-14T12:10:02Z
Keywords
mangling, pull
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greeenify — 2019-05-09T10:51:13Z
``` struct Stack(T) { @safe: T[] data; @property ref T top() { return data[$ - 1]; } } void main() { auto s = Stack!(int[])(); auto b = s.top(); } ``` How to test: dmd -c test.d -oftest.o dmd -c -dip1000 test.d -oftest1000.o nm test.o > test.names nm test1000.o > test1000.names diff -u test.names test1000.names --- test.names 2019-05-09 11:49:20.545433782 +0100 +++ test1000.names 2019-05-09 11:49:24.042133904 +0100 @@ -15,7 +15,7 @@ 0000000000000000 V _D30TypeInfo_S4test__T5StackTAiZQk6__initZ 0000000000000000 R _D4test12__ModuleInfoZ 0000000000000000 W _D4test__T5StackTAiZQk11__xopEqualsFKxSQBl__TQBjTQBgZQBrKxQuZb -0000000000000000 W _D4test__T5StackTAiZQk3topMFNaNbNcNdNiNfZQy +0000000000000000 W _D4test__T5StackTAiZQk3topMFNaNbNcNdNiNjNfZQBa 0000000000000000 V _D4test__T5StackTAiZQk6__initZ 0000000000000000 W _D4test__T5StackTAiZQk9__xtoHashFNbNeKxSQBm__TQBkTQBhZQBsZm 0000000000000000 V _D6object__T10RTInfoImplVAmA2i16i2ZQxyG2m ``` Demangled: ``` --- test.names 2019-05-09 11:49:20.545433782 +0100 +++ test1000.names 2019-05-09 11:49:24.042133904 +0100 @@ -15,7 +15,7 @@ 0000000000000000 V TypeInfo_S4test__T5StackTAiZQk.__init 0000000000000000 R test.__ModuleInfo 0000000000000000 W bool test.Stack!(int[]).Stack.__xopEquals(ref const(test.Stack!(int[]).Stack), ref const(test.Stack!(int[]).Stack)) -0000000000000000 W pure nothrow ref @property @nogc @safe int[] test.Stack!(int[]).Stack.top() +0000000000000000 W pure nothrow ref @property @nogc return @safe int[] test.Stack!(int[]).Stack.top() 0000000000000000 V test.Stack!(int[]).Stack.__init 0000000000000000 W nothrow @trusted ulong test.Stack!(int[]).Stack.__xtoHash(ref const(test.Stack!(int[]).Stack)) 0000000000000000 V immutable(ulong[2]) object.RTInfoImpl!([16, 2]).RTInfoImpl ```
Comment #1 by greeenify — 2019-05-09T10:52:03Z
This is blocking compiling Phobos with -dip1000 - see e.g. https://github.com/dlang/phobos/pull/6931
Comment #2 by dlang-bot — 2019-05-14T09:22:46Z
@WalterBright created dlang/dmd pull request #9789 "fix Issue 19857 - Name mangling mismatch when compiling with -dip1000" fixing this issue: - fix Issue 19857 - Name mangling mismatch when compiling with -dip1000 https://github.com/dlang/dmd/pull/9789
Comment #3 by dlang-bot — 2019-05-14T12:10:02Z
dlang/dmd pull request #9789 "fix Issue 19857 - Name mangling mismatch when compiling with -dip1000" was merged into stable: - 8007aa83ded5db0d35fd8696f5fdfe1470ff5161 by Walter Bright: fix Issue 19857 - Name mangling mismatch when compiling with -dip1000 https://github.com/dlang/dmd/pull/9789