Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/Parser/StatementNode.cc	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -122,6 +122,5 @@
 	ast::Expr * cond = nullptr;
 	if ( ctl->condition ) {
-		// compare the provided condition against 0
-		cond = notZeroExpr( maybeMoveBuild( ctl->condition ) );
+		cond = maybeMoveBuild( ctl->condition );
 	} else {
 		for ( ast::ptr<ast::Stmt> & stmt : inits ) {
@@ -129,5 +128,5 @@
 			auto declStmt = stmt.strict_as<ast::DeclStmt>();
 			auto dwt = declStmt->decl.strict_as<ast::DeclWithType>();
-			ast::Expr * nze = notZeroExpr( new ast::VariableExpr( dwt->location, dwt ) );
+			ast::Expr * nze = new ast::VariableExpr( dwt->location, dwt );
 			cond = cond ? new ast::LogicalExpr( dwt->location, cond, nze, ast::AndExpr ) : nze;
 		}
@@ -200,5 +199,5 @@
 	// do-while cannot have declarations in the contitional, so init is always empty
 	return new ast::WhileDoStmt( location,
-		notZeroExpr( maybeMoveBuild( ctl ) ),
+		maybeMoveBuild( ctl ),
 		buildMoveSingle( stmt ),
 		buildMoveOptional( else_ ),
@@ -213,5 +212,5 @@
 
 	ast::Expr * astcond = nullptr;						// maybe empty
-	astcond = notZeroExpr( maybeMoveBuild( forctl->condition ) );
+	astcond = maybeMoveBuild( forctl->condition );
 
 	ast::Expr * astincr = nullptr;						// maybe empty
@@ -330,5 +329,5 @@
 	clause->target = maybeBuild( targetExpr );
 	clause->stmt = maybeMoveBuild( stmt );
-	clause->when_cond = notZeroExpr( maybeMoveBuild( when ) );
+	clause->when_cond = maybeMoveBuild( when );
 
 	ExpressionNode * next = targetExpr->next;
@@ -345,5 +344,5 @@
 ast::WaitForStmt * build_waitfor_else( const CodeLocation & location, ast::WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ) {
 	existing->else_stmt = maybeMoveBuild( stmt );
-	existing->else_cond = notZeroExpr( maybeMoveBuild( when ) );
+	existing->else_cond = maybeMoveBuild( when );
 
 	(void)location;
@@ -354,5 +353,5 @@
 	existing->timeout_time = maybeMoveBuild( timeout );
 	existing->timeout_stmt = maybeMoveBuild( stmt );
-	existing->timeout_cond = notZeroExpr( maybeMoveBuild( when ) );
+	existing->timeout_cond = maybeMoveBuild( when );
 
 	(void)location;
@@ -362,5 +361,5 @@
 ast::WaitUntilStmt::ClauseNode * build_waituntil_clause( const CodeLocation & loc, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ) {
 	ast::WhenClause * clause = new ast::WhenClause( loc );
-	clause->when_cond = notZeroExpr( maybeMoveBuild( when ) );
+	clause->when_cond = maybeMoveBuild( when );
 	clause->stmt = maybeMoveBuild( stmt );
 	clause->target = maybeMoveBuild( targetExpr );
@@ -369,5 +368,5 @@
 ast::WaitUntilStmt::ClauseNode * build_waituntil_else( const CodeLocation & loc, ExpressionNode * when, StatementNode * stmt ) {
 	ast::WhenClause * clause = new ast::WhenClause( loc );
-	clause->when_cond = notZeroExpr( maybeMoveBuild( when ) );
+	clause->when_cond = maybeMoveBuild( when );
 	clause->stmt = maybeMoveBuild( stmt );
 	return new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::ELSE, clause );
@@ -508,5 +507,5 @@
 
 	ast::Expr * astcond = nullptr;						// maybe empty
-	astcond = notZeroExpr( maybeMoveBuild( forctl->condition ) );
+	astcond = maybeMoveBuild( forctl->condition );
 
 	ast::Expr * astincr = nullptr;						// maybe empty
Index: src/Parser/module.mk
===================================================================
--- src/Parser/module.mk	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/Parser/module.mk	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -31,5 +31,4 @@
        Parser/parser.yy \
        Parser/ParserTypes.h \
-       Parser/parserutility.cc \
        Parser/parserutility.h \
        Parser/RunParser.cpp \
Index: c/Parser/parserutility.cc
===================================================================
--- src/Parser/parserutility.cc	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ 	(revision )
@@ -1,50 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// parserutility.cc --
-//
-// Author           : Rodolfo G. Esteves
-// Created On       : Sat May 16 15:30:39 2015
-// Last Modified By : Andrew Beach
-// Last Modified On : Wed Mar  1 10:42:00 2023
-// Update Count     : 9
-//
-
-#include "parserutility.h"
-
-#include <list>                  // for list
-#include <string>                // for string
-
-#include "AST/Expr.hpp"          // for UntypedExpr, CastExpr, ConstantExpr
-#include "AST/Type.hpp"          // for BasicType, ZeroType, BasicType::Kind...
-
-// rewrite
-//    if ( x ) ...
-// as
-//    if ( (int)(x != 0) ) ...
-
-ast::Expr * notZeroExpr( const ast::Expr * orig ) {
-	return ( !orig ) ? nullptr : new ast::CastExpr( orig->location,
-		ast::UntypedExpr::createCall( orig->location,
-			"?!=?",
-			{
-				orig,
-				new ast::ConstantExpr( orig->location,
-					new ast::ZeroType(),
-					"0",
-					std::optional<unsigned long long>( 0 )
-				),
-			}
-		),
-		new ast::BasicType( ast::BasicType::SignedInt )
-	);
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/Parser/parserutility.h
===================================================================
--- src/Parser/parserutility.h	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/Parser/parserutility.h	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -17,9 +17,4 @@
 
 #include "AST/Copy.hpp"            // for shallowCopy
-namespace ast {
-	class Expr;
-}
-
-ast::Expr * notZeroExpr( const ast::Expr *orig );
 
 template< typename T >
Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -46,5 +46,4 @@
 #include "AST/Type.hpp"
 #include "Common/utility.h"       // for move, copy
-#include "Parser/parserutility.h" // for notZeroExpr
 #include "SymTab/Mangler.h"
 #include "Tuples/Tuples.h"        // for handleTupleAssignment
@@ -1587,10 +1586,10 @@
 	void Finder::postvisit( const ast::LogicalExpr * logicalExpr ) {
 		CandidateFinder finder1( context, tenv );
-		ast::ptr<ast::Expr> arg1 = notZeroExpr( logicalExpr->arg1 );
+		ast::ptr<ast::Expr> arg1 = createCondExpr( logicalExpr->arg1 );
 		finder1.find( arg1, ResolveMode::withAdjustment() );
 		if ( finder1.candidates.empty() ) return;
 
 		CandidateFinder finder2( context, tenv );
-		ast::ptr<ast::Expr> arg2 = notZeroExpr( logicalExpr->arg2 );
+		ast::ptr<ast::Expr> arg2 = createCondExpr( logicalExpr->arg2 );
 		finder2.find( arg2, ResolveMode::withAdjustment() );
 		if ( finder2.candidates.empty() ) return;
@@ -1618,5 +1617,5 @@
 	void Finder::postvisit( const ast::ConditionalExpr * conditionalExpr ) {
 		// candidates for condition
-		ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
+		ast::ptr<ast::Expr> arg1 = createCondExpr( conditionalExpr->arg1 );
 		CandidateFinder finder1( context, tenv );
 		finder1.find( arg1, ResolveMode::withAdjustment() );
@@ -2201,4 +2200,20 @@
 }
 
+const ast::Expr * createCondExpr( const ast::Expr * expr ) {
+	assert( expr );
+	return new ast::CastExpr( expr->location,
+		ast::UntypedExpr::createCall( expr->location,
+			"?!=?",
+			{
+				expr,
+				new ast::ConstantExpr( expr->location,
+					new ast::ZeroType(), "0", std::make_optional( 0ull )
+				),
+			}
+		),
+		new ast::BasicType( ast::BasicType::SignedInt )
+	);
+}
+
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -70,4 +70,7 @@
 	const ast::Expr * expr, Cost & cost );
 
+/// Wrap an expression to convert the result to a conditional result.
+const ast::Expr * createCondExpr( const ast::Expr * expr );
+
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision c4024b46e673f27fbe00a125abbcd49efa50c164)
+++ src/ResolvExpr/Resolver.cc	(revision ab780e6afda20d69d650b2152ea5f5988f5f85e0)
@@ -340,4 +340,12 @@
 	}
 
+	ast::ptr< ast::Expr > findCondExpression(
+		const ast::Expr * untyped, const ResolveContext & context
+	) {
+		if ( nullptr == untyped ) return untyped;
+		ast::ptr<ast::Expr> condExpr = createCondExpr( untyped );
+		return findIntegralExpression( condExpr, context );
+	}
+
 	/// check if a type is a character type
 	bool isCharType( const ast::Type * t ) {
@@ -356,5 +364,5 @@
 		return it != end;
 	}
-}
+} // anonymous namespace
 
 class Resolver final
@@ -729,10 +737,10 @@
 const ast::IfStmt * Resolver::previsit( const ast::IfStmt * ifStmt ) {
 	return ast::mutate_field(
-		ifStmt, &ast::IfStmt::cond, findIntegralExpression( ifStmt->cond, context ) );
+		ifStmt, &ast::IfStmt::cond, findCondExpression( ifStmt->cond, context ) );
 }
 
 const ast::WhileDoStmt * Resolver::previsit( const ast::WhileDoStmt * whileDoStmt ) {
 	return ast::mutate_field(
-		whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, context ) );
+		whileDoStmt, &ast::WhileDoStmt::cond, findCondExpression( whileDoStmt->cond, context ) );
 }
 
@@ -740,5 +748,5 @@
 	if ( forStmt->cond ) {
 		forStmt = ast::mutate_field(
-			forStmt, &ast::ForStmt::cond, findIntegralExpression( forStmt->cond, context ) );
+			forStmt, &ast::ForStmt::cond, findCondExpression( forStmt->cond, context ) );
 	}
 
@@ -1075,5 +1083,5 @@
 
 		// Resolve the conditions as if it were an IfStmt, statements normally
-		clause2->when_cond = findSingleExpression( clause.when_cond, context );
+		clause2->when_cond = findCondExpression( clause.when_cond, context );
 		clause2->stmt = clause.stmt->accept( *visitor );
 
@@ -1089,5 +1097,5 @@
 			new ast::BasicType{ ast::BasicType::LongLongUnsignedInt };
 		auto timeout_time = findSingleExpression( stmt->timeout_time, target, context );
-		auto timeout_cond = findSingleExpression( stmt->timeout_cond, context );
+		auto timeout_cond = findCondExpression( stmt->timeout_cond, context );
 		auto timeout_stmt = stmt->timeout_stmt->accept( *visitor );
 
@@ -1102,5 +1110,5 @@
 	if ( stmt->else_stmt ) {
 		// resolve the condition like IfStmt, stmts normally
-		auto else_cond = findSingleExpression( stmt->else_cond, context );
+		auto else_cond = findCondExpression( stmt->else_cond, context );
 		auto else_stmt = stmt->else_stmt->accept( *visitor );
 
