Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 931dd1264212048e4fe4b09741eb0442ebabcb99)
+++ src/ResolvExpr/Unify.cc	(revision 33e6a2cc471e9cc9c8faee7dd84043aaecd223f9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Unify.cc -- 
+// Unify.cc --
 //
 // Author           : Richard C. Bilson
@@ -38,5 +38,5 @@
 		WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
 		operator bool() { return widenFirst && widenSecond; }
-  
+
 		bool widenFirst : 1, widenSecond : 1;
 	};
@@ -45,5 +45,5 @@
 	  public:
 		Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
-  
+
 		bool get_result() const { return result; }
 	  private:
@@ -79,5 +79,5 @@
 	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common );
 	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
-  
+
 	bool typesCompatible( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
 		TypeEnvironment newEnv;
@@ -137,5 +137,5 @@
 		  case TypeDecl::Dtype:
 			return ! isFtype( type, indexer );
-  
+
 		  case TypeDecl::Ftype:
 			return isFtype( type, indexer );
@@ -196,5 +196,5 @@
 		bool widen1 = false, widen2 = false;
 		Type *type1 = 0, *type2 = 0;
-  
+
 		if ( env.lookup( var1->get_name(), class1 ) ) {
 			hasClass1 = true;
@@ -217,5 +217,5 @@
 			widen2 = widenMode.widenSecond && class2.allowWidening;
 		} // if
-  
+
 		if ( type1 && type2 ) {
 //    std::cout << "has type1 && type2" << std::endl;
@@ -436,7 +436,5 @@
 		// to unify, array types must both be VLA or both not VLA
 		// and must both have a dimension expression or not have a dimension
-		if ( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() 
-				&& ((arrayType->get_dimension() != 0 && otherArray->get_dimension() != 0)
-					|| (arrayType->get_dimension() == 0 && otherArray->get_dimension() == 0))) {
+		if ( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() ) {
 
 			// not positive this is correct in all cases, but it's needed for typedefs
@@ -449,12 +447,15 @@
 				ConstantExpr * ce1 = dynamic_cast< ConstantExpr * >( arrayType->get_dimension() );
 				ConstantExpr * ce2 = dynamic_cast< ConstantExpr * >( otherArray->get_dimension() );
-				assert(ce1 && ce2);
-
-				Constant * c1 = ce1->get_constant();
-				Constant * c2 = ce2->get_constant();
-
-				if ( c1->get_value() != c2->get_value() ) {
-					// does not unify if the dimension is different
-					return;
+				// see C11 Reference Manual 6.7.6.2.6
+				// two array types with size specifiers that are integer constant expressions are
+				// compatible if both size specifiers have the same constant value
+				if ( ce1 && ce2 ) {
+					Constant * c1 = ce1->get_constant();
+					Constant * c2 = ce2->get_constant();
+
+					if ( c1->get_value() != c2->get_value() ) {
+						// does not unify if the dimension is different
+						return;
+					}
 				}
 			}
@@ -485,5 +486,5 @@
 
 			if ( unifyDeclList( functionType->get_parameters().begin(), functionType->get_parameters().end(), otherFunction->get_parameters().begin(), otherFunction->get_parameters().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
-	
+
 				if ( unifyDeclList( functionType->get_returnVals().begin(), functionType->get_returnVals().end(), otherFunction->get_returnVals().begin(), otherFunction->get_returnVals().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
 
