www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13841] New: infinite loop in compiler on simd arithmetic

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

          Issue ID: 13841
           Summary: infinite loop in compiler on simd arithmetic
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

import core.simd;

void foo()
{
    long4 a;
    ulong4 b;
    auto c = b - a;
}

The compiler gets stuck in semantic3. Tested on a variety of compiler versions
including git HEAD, all have the same problem.

Backtrace:


dmd`castTo(this=0x00007fff5fbfc7a8, sc=0x00000001006c3b30,
t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) + 53 at cast.c:1349, queue
= 'com.apple.main-thread', stop reason = signal SIGSTOP

sc=0x00000001006c3b30, t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) +
53 at cast.c:1349
   1346    
   1347            CastTo(Scope *sc, Type *t)
   1348                : sc(sc), t(t)
-> 1349            {
   1350                result = NULL;
   1351            }
   1352    
(lldb) bt all

dmd`castTo(this=0x00007fff5fbfc7a8, sc=0x00000001006c3b30,
t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) + 53 at cast.c:1349, queue
= 'com.apple.main-thread', stop reason = signal SIGSTOP

sc=0x00000001006c3b30, t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) +
53 at cast.c:1349

sc=0x00000001006c3b30, t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) +
37 at cast.c:1351

sc=0x00000001006c3b30, t=0x00000001006b8f40) + 40 at cast.c:2180

dmd`Expression::castTo(this=0x00000001006c4c00, sc=0x00000001006c3b30,
t=0x00000001006b8f40) + 37 at expression.h:170

e=0x00000001006058a0, pt=0x00000001006058c0, pe1=0x00000001006058d0,
pe2=0x00000001006058d8) + 8423 at cast.c:2920

sc=0x00000001006c3b30) + 332 at cast.c:3020

sc=0x00000001006c3b30) + 1236 at expression.c:12228

dmd`UnaExp::unaSemantic(this=0x00000001006058f0, sc=0x00000001006c3b30) + 44 at
expression.c:6432

sc=0x00000001006c3b30) + 79 at expression.c:9579

dmd`AssignExp::semantic(this=0x00000001006c4aa0, sc=0x00000001006c3b30) + 3716
at expression.c:11090

dmd`VarDeclaration::semantic(this=0x0000000100605970, sc=0x00000001006c3b30) +
11789 at declaration.c:1342

dmd`DeclarationExp::semantic(this=0x0000000100605ab0, sc=0x00000001006c3a10) +
258 at expression.c:5876

dmd`ExpStatement::semantic(this=0x0000000100605a90, sc=0x00000001006c3a10) + 62
at statement.c:830

dmd`CompoundStatement::semantic(this=0x0000000100606630, sc=0x00000001006c3a10)
+ 210 at statement.c:1035

dmd`FuncDeclaration::semantic3(this=0x00000001006050c0, sc=0x00000001006c3730)
+ 6504 at func.c:1513

dmd`Module::semantic3(this=0x00000001006045b0) + 156 at module.c:801

+ 13878 at mars.c:1538

42 at mars.c:1761



--
Dec 09 2014