[Issue 234] New: dynamic arrays in combination with SSE instructions cause segment faults

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 2 07:09:28 PDT 2006


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

           Summary: dynamic arrays in combination with SSE instructions
                    cause segment faults
           Product: D
           Version: 0.162
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


If compiled with -version=dynamic, the code below segmentfaults.

import std.stdio;

int main(){
        version(dynamic){
                double[] a = new double[2];
                double[] b = new double[2];
        }else{
                double[2] a;
                double[2] b;
        }

        a[0] = 4.0;
        a[1] = 2.0;

        b[0] = -0.5;
        b[1] = -0.25;

        writefln("a:\t%s\t%s", a[0], a[1]);
        writefln("b:\t%s\t%s", b[0], b[1]);

        asm{
                movupd XMM0, a;
                movupd b, XMM0;
                emms;
        }
        writefln("-- asm finished --");

        writefln("a:\t%s\t%s", a[0], a[1]);
        writefln("b:\t%s\t%s", b[0], b[1]);

        return 0;
}

test cases:
http://dstress.kuehne.cn/run/o/odd_bug_05_A.d
http://dstress.kuehne.cn/run/o/odd_bug_05_B.d
http://dstress.kuehne.cn/run/o/odd_bug_05_C.d
http://dstress.kuehne.cn/run/o/odd_bug_05_D.d


-- 




More information about the Digitalmars-d-bugs mailing list