[Issue 7953] DMD Error: variable r used before set when compiling with -O

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 21 14:16:08 PDT 2012


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



--- Comment #3 from SomeDude <lovelydear at mailmetrash.com> 2012-04-21 14:17:06 PDT ---
I've reduced the test case to this:

import core.simd;
import std.conv;

 string gen(int D) {
        string s;
        s ~= "r = __simd(XMM.ADDPS, v1,v2);";
        return "res.ptr["~to!string(0)~"] = r.ptr["~to!string(0)~"];";
    }

T[D] simdAdd(T, int D)(T[D] a1, T[D] a2) {
    T[D] res;
    float4 r;
    mixin(gen(D));
    return res;
}

void main()
{
    float[8] v1 = [1,2,3,4,1,2,3,4];
    float[8] v2 = [1,2,3,4,1,2,3,4];
    simdAdd(v1,v2);
}

but I can't reproduce the error message, so maybe I've overlooked something.
However, interestingly, this compiles with -O flag and crashes the compiler
without.

PS E:\DigitalMars\dmd2\samples> rdmd bug.d
Internal error: ..\ztc\cg87.c 1699
PS E:\DigitalMars\dmd2\samples> rdmd -O bug.d
PS E:\DigitalMars\dmd2\samples>

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


More information about the Digitalmars-d-bugs mailing list