Linker error with array expressions

Clemens eriatarka84 at gmail.com
Thu Jan 7 01:26:35 PST 2010


Hey all,

I've run across a bizarre linker error when using array expressions of the form

buf1[] = buf1[] + 0.5f * buf2[];

The linker gives me errors like this one:

OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Test.obj(Test)  Offset 0037AH Record Type 00C3
 Error 1: Previous Definition Different :
__arraySliceSliceExpMulAddSliceAssign_f
--- errorlevel 2

This however only occurs under certain circumstances; I don't want to repeat the details, they are in

http://d.puremagic.com/issues/show_bug.cgi?id=3683

I've only tested this with DMD on Windows for D1 so far, so it would be interesting to know if the attached example gives the same error with D2.

In short, has anyone seen this before and knows of a workaround? Of course I could rewrite the array expressions as loops, but I seem to recall Walter mentioning that array expressions are optimized using SIMD operations. Is that true? If so, I'm hesitant to throw that overboard since performance is an issue (realtime audio synthesis).

Thanks,
Clemens



More information about the Digitalmars-d mailing list