Thread overview
[Issue 5592] New: Previous definition different: __arrayExpSliceMulSliceAddass_d
Feb 15, 2011
David Simcha
Feb 16, 2011
Walter Bright
Jun 15, 2011
yebblies
Feb 01, 2012
yebblies
February 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5592

           Summary: Previous definition different:
                    __arrayExpSliceMulSliceAddass_d
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: dsimcha@yahoo.com


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2011-02-15 09:29:27 PST ---
From reading the disassembly it looks like every time __arrayExpSliceMulSliceAddass_d is used, the implementation gets put in the object file instead of just an exterm reference.

main.d:

import module1;

void main() {
    double[] a, b;
    doStuff(a, b);
    a[0..b.length] += b[0] * b[0..a.length];
}

module1.d:

void doStuff(double[] arr1, double[] arr2) {
    arr1[0..arr2.length] += arr2[0] * arr2[0..arr1.length];
}

Command lines:

dmd -c main.d
dmd -c module1.d
dmd main.obj module1.obj

Result:

OPTLINK (R) for Win32  Release 8.00.8
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
module1.obj(module1)  Offset 001FDH Record Type 00C3
 Error 1: Previous Definition Different : __arrayExpSliceMulSliceAddass_d
--- errorlevel 1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 16, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5592


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2011-02-15 23:30:31 PST ---
The fix is to emit the array functions as COMDATs.

https://github.com/D-Programming-Language/dmd/commit/966bf4029137380294b42a797d93b07712e05dbc

https://github.com/D-Programming-Language/dmd/commit/15620d4087006f30cfdf1e1a4563f76924620e30

https://github.com/D-Programming-Language/dmd/commit/51e3528883825cc3ab5380acbf9c642b862a6663

https://github.com/D-Programming-Language/dmd/commit/27ae5cfe270226017929fad791d10e8972508697

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5592


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sandford@jhu.edu


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-06-15 00:11:35 PDT ---
*** Issue 3562 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5592


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eriatarka84@gmail.com


--- Comment #3 from yebblies <yebblies@gmail.com> 2012-02-02 02:41:15 EST ---
*** Issue 3683 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------