Index: src/SymTab/Mangler.cc
===================================================================
--- src/SymTab/Mangler.cc	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/SymTab/Mangler.cc	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -35,5 +35,5 @@
 		namespace {
 			/// Mangles names to a unique C identifier
-			struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards {
+			struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler> {
 				Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams );
 				Mangler( const Mangler & ) = delete;
@@ -70,5 +70,4 @@
 				bool typeMode;                  ///< Produce a unique mangled name for a type
 				bool mangleGenericParams;       ///< Include generic parameters in name mangling if true
-				bool inFunctionType = false;    ///< Include type qualifiers if false.
 
 				void mangleDecl( DeclarationWithType *declaration );
@@ -190,10 +189,6 @@
 
 			void Mangler::postvisit( ReferenceType * refType ) {
-				// don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload.
-				// Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.),
-				// by pretending every reference type is a function parameter.
-				GuardValue( inFunctionType );
-				inFunctionType = true;
 				printQualifiers( refType );
+				mangleName << "R";
 				maybeAccept( refType->base, *visitor );
 			}
@@ -211,9 +206,4 @@
 				printQualifiers( functionType );
 				mangleName << "F";
-				// turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters,
-				// since qualifiers on outermost parameter type do not differentiate function types, e.g.,
-				// void (*)(const int) and void (*)(int) are the same type, but void (*)(const int *) and void (*)(int *) are different
-				GuardValue( inFunctionType );
-				inFunctionType = true;
 				std::list< Type* > returnTypes = getTypes( functionType->get_returnVals() );
 				acceptAll( returnTypes, *visitor );
@@ -314,4 +304,5 @@
 				// skip if not including qualifiers
 				if ( typeMode ) return;
+
 				if ( ! type->get_forall().empty() ) {
 					std::list< std::string > assertionNames;
@@ -346,33 +337,24 @@
 					mangleName << "_";
 				} // if
-				if ( ! inFunctionType ) {
-					// these qualifiers do not distinguish the outermost type of a function parameter
-					if ( type->get_const() ) {
-						mangleName << "C";
-					} // if
-					if ( type->get_volatile() ) {
-						mangleName << "V";
-					} // if
-					// Removed due to restrict not affecting function compatibility in GCC
-					// if ( type->get_isRestrict() ) {
-					// 	mangleName << "E";
-					// } // if
-					if ( type->get_atomic() ) {
-						mangleName << "A";
-					} // if
-				}
+				if ( type->get_const() ) {
+					mangleName << "C";
+				} // if
+				if ( type->get_volatile() ) {
+					mangleName << "V";
+				} // if
 				if ( type->get_mutex() ) {
 					mangleName << "M";
 				} // if
+				// Removed due to restrict not affecting function compatibility in GCC
+		//		if ( type->get_isRestrict() ) {
+		//			mangleName << "E";
+		//		} // if
 				if ( type->get_lvalue() ) {
 					// mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues
 					mangleName << "L";
 				}
-
-				if ( inFunctionType ) {
-					// turn off inFunctionType so that types can be differentiated for nested qualifiers
-					GuardValue( inFunctionType );
-					inFunctionType = false;
-				}
+				if ( type->get_atomic() ) {
+					mangleName << "A";
+				} // if
 			}
 		}	// namespace
Index: src/tests/.expect/KRfunctions.x64.txt
===================================================================
--- src/tests/.expect/KRfunctions.x64.txt	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/tests/.expect/KRfunctions.x64.txt	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -53,5 +53,5 @@
     __attribute__ ((unused)) signed int *___retval_f8__Pi_1;
 }
-signed int *const __f9__FPi_PiiPi__1(signed int *__a__Pi_1, signed int __b__i_1, signed int *__c__Pi_1){
+signed int *const __f9__FCPi_PiiPi__1(signed int *__a__Pi_1, signed int __b__i_1, signed int *__c__Pi_1){
     __attribute__ ((unused)) signed int *const ___retval_f9__CPi_1;
 }
@@ -77,5 +77,5 @@
     __attribute__ ((unused)) signed int ___retval_f15__i_1;
 }
-const signed int __fred__Fi___1(){
+const signed int __fred__FCi___1(){
     __attribute__ ((unused)) const signed int ___retval_fred__Ci_1;
     signed int *(*__x__PFPi_ii__2)(signed int __anonymous_object4, signed int __anonymous_object5);
@@ -85,8 +85,8 @@
     ((void)(__x__PFPi_ii__2=(((void)(_tmp_cp_ret2=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret2)));
     ((void)(_tmp_cp_ret2) /* ^?{} */);
-    const signed int __f1__Fi_iPiPi__2(signed int __a__i_2, signed int *__b__Pi_2, signed int *__c__Pi_2){
+    const signed int __f1__FCi_iPiPi__2(signed int __a__i_2, signed int *__b__Pi_2, signed int *__c__Pi_2){
         __attribute__ ((unused)) const signed int ___retval_f1__Ci_2;
     }
-    const signed int __f2__Fi_iii__2(signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
+    const signed int __f2__FCi_iii__2(signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
         __attribute__ ((unused)) const signed int ___retval_f2__Ci_2;
     }
Index: src/tests/.expect/attributes.x64.txt
===================================================================
--- src/tests/.expect/attributes.x64.txt	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/tests/.expect/attributes.x64.txt	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -251,12 +251,12 @@
 __attribute__ ((used,used,used)) const signed int __vd5__A0Ci_1[((unsigned long int )5)];
 __attribute__ ((used,used,unused,used)) const signed int __vd6__A0Ci_1[((unsigned long int )5)];
-__attribute__ ((used,used,used,used)) const signed int (*__vd7__PFi___1)();
-__attribute__ ((used,used,unused,used,used)) const signed int (*__vd8__PFi___1)();
+__attribute__ ((used,used,used,used)) const signed int (*__vd7__PFCi___1)();
+__attribute__ ((used,used,unused,used,used)) const signed int (*__vd8__PFCi___1)();
 __attribute__ ((unused,used)) signed int __f1__Fi___1();
 __attribute__ ((unused)) signed int __f1__Fi___1(){
     __attribute__ ((unused)) signed int ___retval_f1__i_1;
 }
-__attribute__ ((unused,unused,unused,used)) signed int **const __f2__FPPi___1();
-__attribute__ ((unused,unused,unused)) signed int **const __f2__FPPi___1(){
+__attribute__ ((unused,unused,unused,used)) signed int **const __f2__FCPPi___1();
+__attribute__ ((unused,unused,unused)) signed int **const __f2__FCPPi___1(){
     __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1;
 }
Index: src/tests/.expect/declarationSpecifier.x64.txt
===================================================================
--- src/tests/.expect/declarationSpecifier.x64.txt	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/tests/.expect/declarationSpecifier.x64.txt	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -447,20 +447,20 @@
 }
 static volatile const struct __anonymous15 __x36__CV14s__anonymous15_1;
-static inline volatile const signed int __f11__Fi___1();
-static inline volatile const signed int __f12__Fi___1();
-static inline volatile const signed int __f13__Fi___1();
-static inline volatile const signed int __f14__Fi___1();
-static inline volatile const signed int __f15__Fi___1();
-static inline volatile const signed int __f16__Fi___1();
-static inline volatile const signed int __f17__Fi___1();
-static inline volatile const signed int __f18__Fi___1();
-static inline volatile const signed short int __f21__Fs___1();
-static inline volatile const signed short int __f22__Fs___1();
-static inline volatile const signed short int __f23__Fs___1();
-static inline volatile const signed short int __f24__Fs___1();
-static inline volatile const signed short int __f25__Fs___1();
-static inline volatile const signed short int __f26__Fs___1();
-static inline volatile const signed short int __f27__Fs___1();
-static inline volatile const signed short int __f28__Fs___1();
+static inline volatile const signed int __f11__FCVi___1();
+static inline volatile const signed int __f12__FCVi___1();
+static inline volatile const signed int __f13__FCVi___1();
+static inline volatile const signed int __f14__FCVi___1();
+static inline volatile const signed int __f15__FCVi___1();
+static inline volatile const signed int __f16__FCVi___1();
+static inline volatile const signed int __f17__FCVi___1();
+static inline volatile const signed int __f18__FCVi___1();
+static inline volatile const signed short int __f21__FCVs___1();
+static inline volatile const signed short int __f22__FCVs___1();
+static inline volatile const signed short int __f23__FCVs___1();
+static inline volatile const signed short int __f24__FCVs___1();
+static inline volatile const signed short int __f25__FCVs___1();
+static inline volatile const signed short int __f26__FCVs___1();
+static inline volatile const signed short int __f27__FCVs___1();
+static inline volatile const signed short int __f28__FCVs___1();
 struct __anonymous16 {
     signed int __i__i_1;
@@ -489,5 +489,5 @@
     ((void)((*___dst__R14s__anonymous16_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous16 __f31__F14s__anonymous16___1();
+static inline volatile const struct __anonymous16 __f31__FCV14s__anonymous16___1();
 struct __anonymous17 {
     signed int __i__i_1;
@@ -516,5 +516,5 @@
     ((void)((*___dst__R14s__anonymous17_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous17 __f32__F14s__anonymous17___1();
+static inline volatile const struct __anonymous17 __f32__FCV14s__anonymous17___1();
 struct __anonymous18 {
     signed int __i__i_1;
@@ -543,5 +543,5 @@
     ((void)((*___dst__R14s__anonymous18_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous18 __f33__F14s__anonymous18___1();
+static inline volatile const struct __anonymous18 __f33__FCV14s__anonymous18___1();
 struct __anonymous19 {
     signed int __i__i_1;
@@ -570,5 +570,5 @@
     ((void)((*___dst__R14s__anonymous19_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous19 __f34__F14s__anonymous19___1();
+static inline volatile const struct __anonymous19 __f34__FCV14s__anonymous19___1();
 struct __anonymous20 {
     signed int __i__i_1;
@@ -597,5 +597,5 @@
     ((void)((*___dst__R14s__anonymous20_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous20 __f35__F14s__anonymous20___1();
+static inline volatile const struct __anonymous20 __f35__FCV14s__anonymous20___1();
 struct __anonymous21 {
     signed int __i__i_1;
@@ -624,5 +624,5 @@
     ((void)((*___dst__R14s__anonymous21_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous21 __f36__F14s__anonymous21___1();
+static inline volatile const struct __anonymous21 __f36__FCV14s__anonymous21___1();
 struct __anonymous22 {
     signed int __i__i_1;
@@ -651,5 +651,5 @@
     ((void)((*___dst__R14s__anonymous22_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous22 __f37__F14s__anonymous22___1();
+static inline volatile const struct __anonymous22 __f37__FCV14s__anonymous22___1();
 struct __anonymous23 {
     signed int __i__i_1;
@@ -678,13 +678,13 @@
     ((void)((*___dst__R14s__anonymous23_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-static inline volatile const struct __anonymous23 __f38__F14s__anonymous23___1();
-static inline volatile const signed short int __f41__Fs___1();
-static inline volatile const signed short int __f42__Fs___1();
-static inline volatile const signed short int __f43__Fs___1();
-static inline volatile const signed short int __f44__Fs___1();
-static inline volatile const signed short int __f45__Fs___1();
-static inline volatile const signed short int __f46__Fs___1();
-static inline volatile const signed short int __f47__Fs___1();
-static inline volatile const signed short int __f48__Fs___1();
+static inline volatile const struct __anonymous23 __f38__FCV14s__anonymous23___1();
+static inline volatile const signed short int __f41__FCVs___1();
+static inline volatile const signed short int __f42__FCVs___1();
+static inline volatile const signed short int __f43__FCVs___1();
+static inline volatile const signed short int __f44__FCVs___1();
+static inline volatile const signed short int __f45__FCVs___1();
+static inline volatile const signed short int __f46__FCVs___1();
+static inline volatile const signed short int __f47__FCVs___1();
+static inline volatile const signed short int __f48__FCVs___1();
 signed int __main__Fi_iPPCc__1(signed int __argc__i_1, const char **__argv__PPCc_1){
     __attribute__ ((unused)) signed int ___retval_main__i_1;
Index: src/tests/.expect/functions.x64.txt
===================================================================
--- src/tests/.expect/functions.x64.txt	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/tests/.expect/functions.x64.txt	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -46,5 +46,5 @@
     __attribute__ ((unused)) signed int ___retval_fII1__i_1;
 }
-const signed int __fII2__Fi_i__1(signed int __i__i_1){
+const signed int __fII2__FCi_i__1(signed int __i__i_1){
     __attribute__ ((unused)) const signed int ___retval_fII2__Ci_1;
 }
@@ -52,5 +52,5 @@
     __attribute__ ((unused)) signed int ___retval_fII3__i_1;
 }
-extern const signed int __fII4__Fi_i__1(signed int __i__i_1){
+extern const signed int __fII4__FCi_i__1(signed int __i__i_1){
     __attribute__ ((unused)) const signed int ___retval_fII4__Ci_1;
 }
@@ -58,5 +58,5 @@
     __attribute__ ((unused)) signed int *___retval_fII5__Pi_1;
 }
-signed int *const __fII6__FPi___1(){
+signed int *const __fII6__FCPi___1(){
     __attribute__ ((unused)) signed int *const ___retval_fII6__CPi_1;
 }
@@ -76,5 +76,5 @@
     __attribute__ ((unused)) signed int ___retval_fO2__i_1;
 }
-const signed int __fO3__Fi_i__1(signed int __i__i_1){
+const signed int __fO3__FCi_i__1(signed int __i__i_1){
     __attribute__ ((unused)) const signed int ___retval_fO3__Ci_1;
 }
@@ -82,5 +82,5 @@
     __attribute__ ((unused)) signed int ___retval_fO4__i_1;
 }
-extern const signed int __fO5__Fi_i__1(signed int __i__i_1){
+extern const signed int __fO5__FCi_i__1(signed int __i__i_1){
     __attribute__ ((unused)) const signed int ___retval_fO5__Ci_1;
 }
@@ -176,10 +176,10 @@
 signed int __f11__Fi_i__1(signed int __anonymous_object16);
 signed int __f12__Fi___1(void);
-const double __bar1__Fd___1();
-const double __bar2__Fd_i__1(signed int __anonymous_object17);
-const double __bar3__Fd_d__1(double __anonymous_object18);
-const double __foo__Fd___1(void);
-const double __foo__Fd_i__1(signed int __anonymous_object19);
-const double __foo__Fd_d__1(double __anonymous_object20){
+const double __bar1__FCd___1();
+const double __bar2__FCd_i__1(signed int __anonymous_object17);
+const double __bar3__FCd_d__1(double __anonymous_object18);
+const double __foo__FCd___1(void);
+const double __foo__FCd_i__1(signed int __anonymous_object19);
+const double __foo__FCd_d__1(double __anonymous_object20){
     __attribute__ ((unused)) const double ___retval_foo__Cd_1;
     ((void)((*((double *)(&___retval_foo__Cd_1)))=3.0) /* ?{} */);
@@ -224,8 +224,8 @@
     __attribute__ ((unused)) const signed int *___retval_f1__PCi_1;
 }
-static const signed int *__f2__FPCi___1(void){
-    __attribute__ ((unused)) const signed int *___retval_f2__PCi_1;
-}
-static inline signed int *const __f3__FPi___1(void){
+static const signed int __f2__FCi___1(void){
+    __attribute__ ((unused)) const signed int ___retval_f2__Ci_1;
+}
+static inline signed int *const __f3__FCPi___1(void){
     __attribute__ ((unused)) signed int *const ___retval_f3__CPi_1;
 }
@@ -234,12 +234,12 @@
     signed int field_1;
 };
-static inline const struct _conc__tuple2_3 __f4__FTPii____1(void){
+static inline const struct _conc__tuple2_3 __f4__FCTPii____1(void){
     __attribute__ ((unused)) const struct _conc__tuple2_3 ___retval_f4__CTPii__1;
 }
-static const struct _conc__tuple2_3 __f5__FTPiCi____1(void){
+static const struct _conc__tuple2_3 __f5__FCTPiCi____1(void){
     __attribute__ ((unused)) const struct _conc__tuple2_3 ___retval_f5__CTPiCi__1;
 }
-signed int __f__Fi_PFi__PFPi__PFPPi__PFPCPi__PFPCPi__PiPiPPiPPiPPPiPPPiPPCPiPPCPiPCPCPiPCPCPi__1(signed int (*__anonymous_object27)(), signed int *(*__anonymous_object28)(), signed int **(*__anonymous_object29)(), signed int *const *(*__anonymous_object30)(), signed int *const *const (*__anonymous_object31)(), signed int *__anonymous_object32, signed int __anonymous_object33[((unsigned long int )10)], signed int **__anonymous_object34, signed int *__anonymous_object35[((unsigned long int )10)], signed int ***__anonymous_object36, signed int **__anonymous_object37[((unsigned long int )10)], signed int *const **__anonymous_object38, signed int *const *__anonymous_object39[((unsigned long int )10)], signed int *const *const *__anonymous_object40, signed int *const *const __anonymous_object41[((unsigned long int )10)]);
-signed int __f__Fi_PFi__PFPi__PFPPi__PFPCPi__PFPCPi__PiPiPPiPPiPPPiPPPiPPCPiPPCPiPCPCPiPCPCPi__1(signed int (*__anonymous_object42)(), signed int *(*__anonymous_object43)(), signed int **(*__anonymous_object44)(), signed int *const *(*__anonymous_object45)(), signed int *const *const (*__anonymous_object46)(), signed int *__anonymous_object47, signed int __anonymous_object48[((unsigned long int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned long int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned long int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned long int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned long int )10)]){
+signed int __f__Fi_PFi__PFPi__PFPPi__PFPCPi__PFCPCPi__PiPiPPiPPiPPPiPPPiPPCPiPPCPiPCPCPiPCPCPi__1(signed int (*__anonymous_object27)(), signed int *(*__anonymous_object28)(), signed int **(*__anonymous_object29)(), signed int *const *(*__anonymous_object30)(), signed int *const *const (*__anonymous_object31)(), signed int *__anonymous_object32, signed int __anonymous_object33[((unsigned long int )10)], signed int **__anonymous_object34, signed int *__anonymous_object35[((unsigned long int )10)], signed int ***__anonymous_object36, signed int **__anonymous_object37[((unsigned long int )10)], signed int *const **__anonymous_object38, signed int *const *__anonymous_object39[((unsigned long int )10)], signed int *const *const *__anonymous_object40, signed int *const *const __anonymous_object41[((unsigned long int )10)]);
+signed int __f__Fi_PFi__PFPi__PFPPi__PFPCPi__PFCPCPi__PiPiPPiPPiPPPiPPPiPPCPiPPCPiPCPCPiPCPCPi__1(signed int (*__anonymous_object42)(), signed int *(*__anonymous_object43)(), signed int **(*__anonymous_object44)(), signed int *const *(*__anonymous_object45)(), signed int *const *const (*__anonymous_object46)(), signed int *__anonymous_object47, signed int __anonymous_object48[((unsigned long int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned long int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned long int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned long int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned long int )10)]){
     __attribute__ ((unused)) signed int ___retval_f__i_1;
 }
Index: src/tests/functions.c
===================================================================
--- src/tests/functions.c	(revision 1a3eab86f23dc0bb8709ff1a369ab2a3e9b1663e)
+++ src/tests/functions.c	(revision b9c432fc0d6c9c1f4962af0e77cf031cf584dbf1)
@@ -1,10 +1,10 @@
-//
+// 
 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
 //
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
-//
-// functions.c --
-//
+// 
+// functions.c -- 
+// 
 // Author           : Peter A. Buhr
 // Created On       : Wed Aug 17 08:39:58 2016
@@ -12,5 +12,5 @@
 // Last Modified On : Wed Jan 17 22:44:12 2018
 // Update Count     : 12
-//
+// 
 
 // ANSI function definitions
@@ -123,5 +123,5 @@
 
 static const int * f1() {}
-static [ * const int ] f2() {}
+static [ const int ] f2() {}
 static inline [ const * int ] f3() {}
 static inline [ const [ * int, int ] ] f4() {}
