Bug 12836 – CTFE ICE CompiledCtfeFunction::walkAllVars

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-01T17:11:00Z
Last change time
2014-06-07T18:28:40Z
Keywords
CTFE, ice, pull
Assigned to
nobody
Creator
ibuclaw
Depends on
12397

Comments

Comment #0 by ibuclaw — 2014-06-01T17:11:24Z
This is similar to #12397 and I'd imagine the same fix will apply to both, but the test case is different enough that it warrants a new issue. --- immutable C L = 1 << K; --- Here's the ICE with backtrace. ctfeice.d:2: error: undefined identifier C ctfeice.d:2: error: undefined identifier K cc1d: ../../gcc/d/dfrontend/interpret.c:314: static int CompiledCtfeFunction::walkAllVars(Expression*, void*): Assertion `0' failed. cc1d: internal compiler error: Aborted 0xa9f00f crash_signal ../../gcc/toplev.c:337 0x606ed4 CompiledCtfeFunction::walkAllVars(Expression*, void*) ../../gcc/d/dfrontend/interpret.c:314 0x5862b7 BinExp::apply(int (*)(Expression*, void*), void*) ../../gcc/d/dfrontend/apply.c:68 0x609352 CompiledCtfeFunction::onExpression(Expression*) ../../gcc/d/dfrontend/interpret.c:298 0x609352 Expression::ctfeInterpret() ../../gcc/d/dfrontend/interpret.c:707 0x600dde ExpInitializer::semantic(Scope*, Type*, NeedInterpret) ../../gcc/d/dfrontend/init.c:828 0x5bee67 VarDeclaration::semantic(Scope*) ../../gcc/d/dfrontend/declaration.c:1489 0x58ac0c AttribDeclaration::semanticNewSc(Scope*, unsigned long, LINK, PROT, int, unsigned int) ../../gcc/d/dfrontend/attrib.c:141 0x58ad38 StorageClassDeclaration::semantic(Scope*) ../../gcc/d/dfrontend/attrib.c:462 0x6411ac Module::semantic() ../../gcc/d/dfrontend/module.c:744
Comment #1 by ibuclaw — 2014-06-01T17:13:45Z
And what happens when DMD runs the code: ctfeice.d(2): Error: undefined identifier C ctfeice.d(2): Error: undefined identifier K dmd: interpret.c:310: static int CompiledCtfeFunction::walkAllVars(Expression*, void*): Assertion `0' failed. Aborted
Comment #2 by k.hara.pg — 2014-06-07T17:41:49Z
This is already worksforme in git-head, so it's not directly related to 12397. Just add a test case: https://github.com/D-Programming-Language/dmd/pull/3642
Comment #3 by github-bugzilla — 2014-06-07T18:28:39Z