www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18936] New: Internal error: dmd/backend/cgxmm.c 684

https://issues.dlang.org/show_bug.cgi?id=18936

          Issue ID: 18936
           Summary: Internal error: dmd/backend/cgxmm.c 684
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

// REQUIRED_ARGS: -fPIC -O -release -inline -m64 -betterC

// produces assert failure cgxmm.c line 684

import core.stdc.math;

struct S
{
    double re, im;


    static S sqrtcx(S* z)
    {
        S c;
        real x,y,w,r;

        {
            x = fabs(z.re);
            y = fabs(z.im);
            if (z.re >= 0)
            {
                c.im = (z.im >= 0) ? w : -w;
                c.re = z.im / (c.im + c.im);
            }
        }
        return c;
    }
}

Test case: https://github.com/dlang/dmd/pull/8326

--
Jun 02 2018