← Back to index
|
Original Bugzilla link
Bug 13841 – infinite loop in compiler on simd arithmetic
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2014-12-09T12:35:00Z
Last change time
2015-02-18T03:41:06Z
Keywords
ice, pull
Assigned to
nobody
Creator
john.loughran.colvin
Comments
Comment #0
by john.loughran.colvin — 2014-12-09T12:35:35Z
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: * thread #1: tid = 0x1768c7, 0x000000010000d4a5 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 frame #0: 0x000000010000d4a5 dmd`castTo(this=0x00007fff5fbfc7a8, 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 * thread #1: tid = 0x1768c7, 0x000000010000d4a5 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 * frame #0: 0x000000010000d4a5 dmd`castTo(this=0x00007fff5fbfc7a8, sc=0x00000001006c3b30, t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) + 53 at cast.c:1349 frame #1: 0x0000000100007e05 dmd`castTo(this=0x00007fff5fbfc7a8, sc=0x00000001006c3b30, t=0x00000001006b8f40)::CastTo::CastTo(Scope*, Type*) + 37 at cast.c:1351 frame #2: 0x0000000100007da8 dmd`castTo(e=0x00000001006c4c00, sc=0x00000001006c3b30, t=0x00000001006b8f40) + 40 at cast.c:2180 frame #3: 0x000000010007d255 dmd`Expression::castTo(this=0x00000001006c4c00, sc=0x00000001006c3b30, t=0x00000001006b8f40) + 37 at expression.h:170 frame #4: 0x000000010000a607 dmd`typeMerge(sc=0x00000001006c3b30, e=0x00000001006058a0, pt=0x00000001006058c0, pe1=0x00000001006058d0, pe2=0x00000001006058d8) + 8423 at cast.c:2920 frame #5: 0x000000010000acec dmd`typeCombine(be=0x00000001006058a0, sc=0x00000001006c3b30) + 332 at cast.c:3020 frame #6: 0x00000001000758f4 dmd`MinExp::semantic(this=0x00000001006058a0, sc=0x00000001006c3b30) + 1236 at expression.c:12228 frame #7: 0x000000010005899c dmd`UnaExp::unaSemantic(this=0x00000001006058f0, sc=0x00000001006c3b30) + 44 at expression.c:6432 frame #8: 0x00000001000672af dmd`CastExp::semantic(this=0x00000001006058f0, sc=0x00000001006c3b30) + 79 at expression.c:9579 frame #9: 0x000000010006ee94 dmd`AssignExp::semantic(this=0x00000001006c4aa0, sc=0x00000001006c3b30) + 3716 at expression.c:11090 frame #10: 0x000000010002d6ad dmd`VarDeclaration::semantic(this=0x0000000100605970, sc=0x00000001006c3b30) + 11789 at declaration.c:1342 frame #11: 0x0000000100056292 dmd`DeclarationExp::semantic(this=0x0000000100605ab0, sc=0x00000001006c3a10) + 258 at expression.c:5876 frame #12: 0x000000010010dede dmd`ExpStatement::semantic(this=0x0000000100605a90, sc=0x00000001006c3a10) + 62 at statement.c:830 frame #13: 0x000000010010eca2 dmd`CompoundStatement::semantic(this=0x0000000100606630, sc=0x00000001006c3a10) + 210 at statement.c:1035 frame #14: 0x0000000100085428 dmd`FuncDeclaration::semantic3(this=0x00000001006050c0, sc=0x00000001006c3730) + 6504 at func.c:1513 frame #15: 0x00000001000baeec dmd`Module::semantic3(this=0x00000001006045b0) + 156 at module.c:801 frame #16: 0x00000001000b6296 dmd`tryMain(argc=4, argv=0x0000000100504b00) + 13878 at mars.c:1538 frame #17: 0x00000001000b74ba dmd`main(argc=4, argv=0x00007fff5fbffb68) + 42 at mars.c:1761 frame #18: 0x0000000100001908 dmd`_start + 230 frame #19: 0x0000000100001821 dmd`start + 33
Comment #1
by john.loughran.colvin — 2014-12-09T13:40:04Z
Of course those should be long2 and ulong2, I was using 4 when testing with ldc (which is also subject to the same bug).
Comment #2
by k.hara.pg — 2014-12-09T16:19:17Z
https://github.com/D-Programming-Language/dmd/pull/4206
Comment #3
by github-bugzilla — 2014-12-10T15:46:10Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/e4bacee1d515cd9c086952f168a63fcc3a2a6561
fix Issue 13841 - infinite loop in compiler on simd arithmetic
https://github.com/D-Programming-Language/dmd/commit/49fd3765544e5ca3a22192a685b1d01d083042ed
Merge pull request #4206 from 9rnsr/fix13841 Issue 13841 - infinite loop in compiler on simd arithmetic
Comment #4
by github-bugzilla — 2015-02-18T03:41:06Z
Commits pushed to 2.067 at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/e4bacee1d515cd9c086952f168a63fcc3a2a6561
fix Issue 13841 - infinite loop in compiler on simd arithmetic
https://github.com/D-Programming-Language/dmd/commit/49fd3765544e5ca3a22192a685b1d01d083042ed
Merge pull request #4206 from 9rnsr/fix13841