Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 3530f39a1b0739cf4d11f3a6e9ceb2a1498f96a0)
+++ src/SymTab/Validate.cc	(revision 25fcb84f4d4e0dd6a778f8ce5a1bb0777e946a31)
@@ -48,4 +48,5 @@
 #include "CodeGen/CodeGenerator.h"     // for genName
 #include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
+#include "ControlStruct/Mutate.h"      // for ForExprMutator
 #include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
 #include "Common/ScopedMap.h"          // for ScopedMap
@@ -76,5 +77,4 @@
 class SwitchStmt;
 
-
 #define debugPrint( x ) if ( doDebug ) { std::cout << x; }
 
@@ -275,4 +275,5 @@
 		Concurrency::applyKeywords( translationUnit );
 		acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
+		ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
 		autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
 		Concurrency::implementMutexFuncs( translationUnit );
