Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 702e82665c2808485befeaea380f73e06086c920)
+++ src/Parser/parser.yy	(revision 1cdc05268b619ea9d6ec7b9de830a9eaf68a8bf4)
@@ -206,4 +206,23 @@
 #define MISSING_HIGH "Missing high value for down-to range so index is uninitialized."
 
+static ForCtrl * makeForCtrl(
+		DeclarationNode * init,
+		enum OperKinds compop,
+		ExpressionNode * comp,
+		ExpressionNode * inc ) {
+	// Wrap both comp/inc if they are non-null.
+	if ( comp ) comp = new ExpressionNode( build_binary_val(
+		compop,
+		new ExpressionNode( build_varref( new string( *init->name ) ) ),
+		comp ) );
+	if ( inc ) inc = new ExpressionNode( build_binary_val(
+		// choose += or -= for upto/downto
+		compop == OperKinds::LThan || compop == OperKinds::LEThan ? OperKinds::PlusAssn : OperKinds::MinusAssn,
+		new ExpressionNode( build_varref( new string( *init->name ) ) ),
+		inc ) );
+	// The StatementNode call frees init->name, it must happen later.
+	return new ForCtrl( new StatementNode( init ), comp, inc );
+}
+
 ForCtrl * forCtrl( DeclarationNode * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) {
 	if ( index->initializer ) {
@@ -213,9 +232,6 @@
 		SemanticError( yylloc, "Multiple loop indexes disallowed in for-loop declaration." );
 	} // if
-	return new ForCtrl( index->addInitializer( new InitializerNode( start ) ),
-		// NULL comp/inc => leave blank
-		comp ? new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index->name ) ) ), comp ) ) : nullptr,
-		inc ? new ExpressionNode( build_binary_val( compop == OperKinds::LThan || compop == OperKinds::LEThan ? // choose += or -= for upto/downto
-							OperKinds::PlusAssn : OperKinds::MinusAssn, new ExpressionNode( build_varref( new string( *index->name ) ) ), inc ) ) : nullptr );
+	DeclarationNode * initDecl = index->addInitializer( new InitializerNode( start ) );
+	return makeForCtrl( initDecl, compop, comp, inc );
 } // forCtrl
 
@@ -225,11 +241,9 @@
 		type = new ExpressionNode( new CastExpr( maybeMoveBuild( type ), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
 	} // if
-//	type = new ExpressionNode( build_func( new ExpressionNode( build_varref( new string( "__for_control_index_constraints__" ) ) ), type ) );
-	return new ForCtrl(
-		distAttr( DeclarationNode::newTypeof( type, true ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ),
-		// NULL comp/inc => leave blank
-		comp ? new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ) : nullptr,
-		inc ? new ExpressionNode( build_binary_val( compop == OperKinds::LThan || compop == OperKinds::LEThan ? // choose += or -= for upto/downto
-							OperKinds::PlusAssn : OperKinds::MinusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) : nullptr );
+	DeclarationNode * initDecl = distAttr(
+		DeclarationNode::newTypeof( type, true ),
+		DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) )
+	);
+	return makeForCtrl( initDecl, compop, comp, inc );
 } // forCtrl
 
@@ -1298,8 +1312,8 @@
 		{ $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ), $8 ) ); }
 	| FOR '(' ')' statement								%prec THEN // CFA => for ( ;; )
-		{ $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); }
+		{ $$ = new StatementNode( build_for( new ForCtrl( nullptr, nullptr, nullptr ), maybe_build_compound( $4 ) ) ); }
 	| FOR '(' ')' statement ELSE statement				// CFA
 		{
-			$$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) );
+			$$ = new StatementNode( build_for( new ForCtrl( nullptr, nullptr, nullptr ), maybe_build_compound( $4 ) ) );
 			SemanticWarning( yylloc, Warning::SuperfluousElse );
 		}
@@ -1335,14 +1349,17 @@
 for_control_expression:
 	';' comma_expression_opt ';' comma_expression_opt
-		{ $$ = new ForCtrl( (ExpressionNode * )nullptr, $2, $4 ); }
+		{ $$ = new ForCtrl( nullptr, $2, $4 ); }
 	| comma_expression ';' comma_expression_opt ';' comma_expression_opt
-		{ $$ = new ForCtrl( $1, $3, $5 ); }
+		{
+			StatementNode * init = $1 ? new StatementNode( new ExprStmt( maybeMoveBuild( $1 ) ) ) : nullptr;
+			$$ = new ForCtrl( init, $3, $5 );
+		}
 	| declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';'
-		{ $$ = new ForCtrl( $1, $2, $4 ); }
+		{ $$ = new ForCtrl( new StatementNode( $1 ), $2, $4 ); }
 
 	| '@' ';' comma_expression							// CFA, empty loop-index
-		{ $$ = new ForCtrl( (ExpressionNode *)nullptr, $3, nullptr ); }
+		{ $$ = new ForCtrl( nullptr, $3, nullptr ); }
 	| '@' ';' comma_expression ';' comma_expression		// CFA, empty loop-index
-		{ $$ = new ForCtrl( (ExpressionNode *)nullptr, $3, $5 ); }
+		{ $$ = new ForCtrl( nullptr, $3, $5 ); }
 
 	| comma_expression									// CFA, anonymous loop-index
