Index: Makefile.in
===================================================================
--- Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -264,4 +264,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
Index: benchmark/Makefile.am
===================================================================
--- benchmark/Makefile.am	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ benchmark/Makefile.am	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -22,5 +22,5 @@
 
 AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
-AM_CFAFLAGS = -quiet -nodebug -in-tree
+AM_CFAFLAGS = -quiet -nodebug
 AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
 
Index: benchmark/Makefile.in
===================================================================
--- benchmark/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ benchmark/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -214,4 +214,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
@@ -375,5 +376,5 @@
 # applies to both programs
 AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
-AM_CFAFLAGS = -quiet -nodebug -in-tree
+AM_CFAFLAGS = -quiet -nodebug
 AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
 BENCH_V_CC = $(__bench_v_CC_$(__quiet))
Index: configure
===================================================================
--- configure	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ configure	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -715,4 +715,5 @@
 BUILD_IN_TREE_FLAGS
 CFACPP
+CFACC_INSTALL
 CFACC
 DRIVER_DIR
@@ -3303,5 +3304,7 @@
 DRIVER_DIR=${TOP_BUILDDIR}driver/
 CFACC=${DRIVER_DIR}cfa
+CFACC_INSTALL=${CFA_BINDIR}${CFA_NAME}
 CFACPP=${DRIVER_DIR}cfa-cpp
+
 
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ configure.ac	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -93,7 +93,9 @@
 DRIVER_DIR=${TOP_BUILDDIR}driver/
 CFACC=${DRIVER_DIR}cfa
+CFACC_INSTALL=${CFA_BINDIR}${CFA_NAME}
 CFACPP=${DRIVER_DIR}cfa-cpp
 AC_SUBST(DRIVER_DIR)
 AC_SUBST(CFACC)
+AC_SUBST(CFACC_INSTALL)
 AC_SUBST(CFACPP)
 
Index: driver/Makefile.in
===================================================================
--- driver/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ driver/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -201,4 +201,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
Index: driver/cfa.cc
===================================================================
--- driver/cfa.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ driver/cfa.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -15,10 +15,11 @@
 
 #include <iostream>
-#include <cstdio>										// perror
-#include <cstdlib>										// putenv, exit
-#include <unistd.h>										// execvp
-#include <string>										// STL version
-#include <string.h>										// strcmp
-#include <algorithm>									// find
+#include <cstdio>      // perror
+#include <cstdlib>     // putenv, exit
+#include <climits>     // PATH_MAX
+#include <unistd.h>    // execvp
+#include <string>      // STL version
+#include <string.h>    // strcmp
+#include <algorithm>   // find
 
 #include <sys/types.h>
@@ -35,5 +36,6 @@
 // #define __DEBUG_H__
 
-static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );		// "N__=" suffix
+// "N__=" suffix
+static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );
 
 void Putenv( char * argv[], string arg ) {
@@ -57,5 +59,6 @@
 }
 
-bool suffix( const string & arg ) {						// check if string has suffix
+// check if string has suffix
+bool suffix( const string & arg ) {
 	enum { NumSuffixes = 3 };
 	static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
@@ -76,4 +79,41 @@
 static inline string dir(const string & path) {
 	return path.substr(0, path.find_last_of('/'));
+}
+
+// Different path modes
+enum PathMode {
+	Installed,     // cfa is installed, use prefix
+	BuildTree,     // cfa is in the tree, use source and build tree
+	Distributed    // cfa is distributed, use build tree for includes and executable directory for .cfs
+};
+
+// Get path mode from /proc
+PathMode FromProc() {
+	std::string abspath;
+	abspath.resize(PATH_MAX);
+
+	// get executable path from /proc/self/exe
+	ssize_t size = readlink("/proc/self/exe", const_cast<char*>(abspath.c_str()), abspath.size());
+	if(size <= 0) {
+		std::cerr << "Error could not evaluate absolute path from /proc/self/exe" << std::endl;
+		std::cerr << "Failed with " << std::strerror(errno) << std::endl;
+		std::exit(1);
+	}
+
+	// Trim extra characters
+	abspath.resize(size);
+
+	// Are we installed
+	if(abspath.rfind(CFA_BINDIR  , 0) == 0) { return Installed; }
+
+	// Is this the build tree
+	if(abspath.rfind(TOP_BUILDDIR, 0) == 0) { return BuildTree; }
+
+	// Does this look like distcc
+	if(abspath.find("/.cfadistcc/") != std::string::npos) { return Distributed; }
+
+	// None of the above? Give up since we don't know where the prelude or include directories are
+	std::cerr << "Cannot find required files from excutable path " << abspath << std::endl;
+	std::exit(1);
 }
 
@@ -113,8 +153,8 @@
 	bool m32 = false;									// -m32 flag
 	bool m64 = false;									// -m64 flag
-	bool intree = false;								// build in tree
 	bool compiling_libs = false;
-	bool disttree = false;
 	int o_file = 0;										// -o filename position
+
+	PathMode path = FromProc();
 
 	const char *args[argc + 100];						// cfa command line values, plus some space for additional flags
@@ -171,8 +211,4 @@
 			} else if ( arg == "-no-include-stdhdr" ) {
 				noincstd_flag = true;					// strip the no-include-stdhdr flag
-			} else if ( arg == "-in-tree" ) {
-				intree = true;
-			} else if ( arg == "-dist-tree" ) {
-				disttree = true;
 			} else if ( arg == "-cfalib") {
 				compiling_libs = true;
@@ -283,18 +319,29 @@
 
 	// add the CFA include-library paths, which allow direct access to header files without directory qualification
-	if ( ! intree ) {
+	string libbase;
+	switch(path) {
+	case Installed:
 		args[nargs++] = "-I" CFA_INCDIR;
-		if ( ! noincstd_flag ) {						// do not use during build
+		// do not use during build
+		if ( ! noincstd_flag ) {
 			args[nargs++] = "-I" CFA_INCDIR "stdhdr";
 		} // if
 		args[nargs++] = "-I" CFA_INCDIR "concurrency";
 		args[nargs++] = "-I" CFA_INCDIR "containers";
-	} else {
+		libbase = CFA_LIBDIR;
+		break;
+	case BuildTree:
+	case Distributed:
 		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src";
-		if ( ! noincstd_flag ) {						// do not use during build
+		// do not use during build
+		if ( ! noincstd_flag ) {
 			args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr";
 		} // if
 		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency";
 		args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/containers";
+
+		libbase = TOP_BUILDDIR "libcfa/";
+
+		break;
 	} // if
 
@@ -302,11 +349,4 @@
 	args[nargs++] = "-imacros";
 	args[nargs++] = "stdbool.h";
-
-	string libbase;
-	if ( ! intree ) {
-		libbase = CFA_LIBDIR;
-	} else {
-		libbase = TOP_BUILDDIR "libcfa/";
-	} // if
 
 	if( compiling_libs ) {
@@ -326,5 +366,5 @@
 	string libdir = libbase + arch + "-" + config;
 
-	if (!disttree) {
+	if (path != Distributed) {
 		if ( ! nolib && ! dirExists( libdir ) ) {
 			cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
@@ -344,10 +384,8 @@
 	} // if
 
-	if(disttree) {
-		Putenv( argv, "--prelude-dir=" + dir(argv[0]) );
-	} else if(intree) {
-		Putenv( argv, "--prelude-dir=" + libdir + "/prelude" );
-	} else {
-		Putenv( argv, "--prelude-dir=" + libdir );
+	switch(path) {
+	case Installed   : Putenv( argv, "--prelude-dir=" + libdir ); break;
+	case BuildTree   : Putenv( argv, "--prelude-dir=" + libdir + "/prelude" ); break;
+	case Distributed : Putenv( argv, "--prelude-dir=" + dir(argv[0]) ); break;
 	}
 
@@ -365,6 +403,6 @@
 
 		// include the cfa library in case it is needed
-		args[nargs++] = ( *new string( string("-L" ) + libdir + (intree ? "/src/.libs" : "")) ).c_str();
-		args[nargs++] = ( *new string( string("-Wl,-rpath," ) + libdir + (intree ? "/src/.libs" : "")) ).c_str();
+		args[nargs++] = ( *new string( string("-L" ) + libdir + (path != Installed ? "/src/.libs" : "")) ).c_str();
+		args[nargs++] = ( *new string( string("-Wl,-rpath," ) + libdir + (path != Installed ? "/src/.libs" : "")) ).c_str();
 		args[nargs++] = "-Wl,--push-state,--as-needed";
 		args[nargs++] = "-lcfathread";
@@ -410,10 +448,8 @@
 
 	if ( bprefix.length() == 0 ) {
-		if(disttree) {
-			bprefix = dir(argv[0]);
-		} else if(intree) {
-			bprefix = srcdriverdir;
-		} else {
-			bprefix = installlibdir;
+		switch(path) {
+		case Installed   : bprefix = installlibdir; break;
+		case BuildTree   : bprefix = srcdriverdir ; break;
+		case Distributed : bprefix = dir(argv[0]) ; break;
 		}
 		if ( bprefix[bprefix.length() - 1] != '/' ) bprefix += '/';
Index: libcfa/Makefile.in
===================================================================
--- libcfa/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -296,5 +296,4 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PRELUDEFLAG = @PRELUDEFLAG@
 RANLIB = @RANLIB@
 SED = @SED@
Index: libcfa/configure
===================================================================
--- libcfa/configure	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/configure	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -707,5 +707,4 @@
 CONFIG_CFLAGS
 ARCH_FLAGS
-PRELUDEFLAG
 CFADIR_HASH
 LOCAL_CC1
@@ -2960,5 +2959,4 @@
 if test x$enable_distcc = xno; then
 	CFACC=${DRIVER_DIR}cfa
-	PRELUDEFLAG='-in-tree'
 	echo "no"
 else
@@ -2968,5 +2966,4 @@
 	CFADIR_HASH=$($tools/distcc_hash $config)
 	CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
-	PRELUDEFLAG='-dist-tree'
 	echo "yes (hash=${CFADIR_HASH})"
 fi
@@ -2982,5 +2979,4 @@
   ENABLE_DISTCC_FALSE=
 fi
-
 
 
@@ -3004,5 +3000,5 @@
 case $CONFIGURATION in
 	"debug"   )
-		CONFIG_CFLAGS="-Og -g"
+		CONFIG_CFLAGS="-O0 -g"
 		CONFIG_CFAFLAGS="-debug"
 		CONFIG_BUILDLIB="yes"
Index: libcfa/configure.ac
===================================================================
--- libcfa/configure.ac	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/configure.ac	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -34,5 +34,4 @@
 if test x$enable_distcc = xno; then
 	CFACC=${DRIVER_DIR}cfa
-	PRELUDEFLAG='-in-tree'
 	echo "no"
 else
@@ -42,5 +41,4 @@
 	CFADIR_HASH=$($tools/distcc_hash $config)
 	CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
-	PRELUDEFLAG='-dist-tree'
 	echo "yes (hash=${CFADIR_HASH})"
 fi
@@ -57,5 +55,4 @@
 AC_SUBST(CFADIR_HASH)
 AC_SUBST(CFA_VERSION)
-AC_SUBST(PRELUDEFLAG)
 
 #==============================================================================
@@ -71,5 +68,5 @@
 case $CONFIGURATION in
 	"debug"   )
-		CONFIG_CFLAGS="-Og -g"
+		CONFIG_CFLAGS="-O0 -g"
 		CONFIG_CFAFLAGS="-debug"
 		CONFIG_BUILDLIB="yes"
Index: libcfa/prelude/Makefile.in
===================================================================
--- libcfa/prelude/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/prelude/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -239,5 +239,4 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PRELUDEFLAG = @PRELUDEFLAG@
 RANLIB = @RANLIB@
 SED = @SED@
Index: libcfa/prelude/extras.regx
===================================================================
--- libcfa/prelude/extras.regx	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/prelude/extras.regx	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -19,4 +19,6 @@
 typedef.* uint32_t;
 typedef.* uint64_t;
+typedef.* __uint_least16_t;
+typedef.* __uint_least32_t;
 typedef.* char16_t;
 typedef.* char32_t;
Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/src/Makefile.am	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -32,5 +32,5 @@
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
@@ -96,9 +96,9 @@
 
 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
-	${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
+	${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA -l ${<} -c -o ${@}
 
 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
 	${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
-	$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
+	$(CFACOMPILE) -quiet -XCFA -l ${<} -c -o ${@}
 
 #----------------------------------------------------------------------------------------------------------------
Index: libcfa/src/Makefile.in
===================================================================
--- libcfa/src/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/src/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -349,5 +349,4 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
-PRELUDEFLAG = @PRELUDEFLAG@
 RANLIB = @RANLIB@
 SED = @SED@
@@ -445,5 +444,5 @@
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
@@ -954,9 +953,9 @@
 
 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
-	${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
+	${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA -l ${<} -c -o ${@}
 
 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
 	${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
-	$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
+	$(CFACOMPILE) -quiet -XCFA -l ${<} -c -o ${@}
 
 #----------------------------------------------------------------------------------------------------------------
Index: libcfa/src/concurrency/kernel_private.hfa
===================================================================
--- libcfa/src/concurrency/kernel_private.hfa	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/src/concurrency/kernel_private.hfa	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -34,4 +34,6 @@
 static inline void WakeThread( thread_desc * thrd ) {
 	if( !thrd ) return;
+
+	verify(thrd->state == Inactive);
 
 	disable_interrupts();
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ libcfa/src/stdlib.hfa	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 23 14:14:59 2019
-// Update Count     : 373
+// Last Modified On : Fri Sep 27 12:09:18 2019
+// Update Count     : 381
 //
 
@@ -81,4 +81,8 @@
 	} // alloc
 
+	T * alloc( T & fill ) {
+		return (T *)memcpy( (T *)alloc(), &fill, sizeof(T) ); // initialize with fill value
+	} // alloc
+
 	T * alloc( size_t dim ) {
 		if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
@@ -88,4 +92,14 @@
 	T * alloc( size_t dim, char fill ) {
 		return (T *)memset( (T *)alloc( dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value
+	} // alloc
+
+	T * alloc( size_t dim, T & fill ) {
+		T * r = (T *)alloc( dim );
+		for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value
+		return r;
+	} // alloc
+
+	T * alloc( size_t dim, T fill[] ) {
+		return (T *)memcpy( (T *)alloc( dim ), fill, dim * sizeof(T) ); // initialize with fill value
 	} // alloc
 
Index: longrun_tests/Makefile.am
===================================================================
--- longrun_tests/Makefile.am	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ longrun_tests/Makefile.am	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -43,5 +43,4 @@
 	-I$(srcdir) \
 	-DTEST_$(shell cat .type | tr a-z A-Z) \
-	-in-tree
 
 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
Index: longrun_tests/Makefile.in
===================================================================
--- longrun_tests/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ longrun_tests/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -348,4 +348,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
Index: src/CodeGen/GenType.cc
===================================================================
--- src/CodeGen/GenType.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/CodeGen/GenType.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -335,8 +335,4 @@
 			typeString = "_Atomic " + typeString;
 		} // if
-		if ( type->get_lvalue() && ! options.genC ) {
-			// when not generating C code, print lvalue for debugging.
-			typeString = "lvalue " + typeString;
-		}
 	}
 } // namespace CodeGen
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/GenPoly/Box.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -837,5 +837,4 @@
 					deref->args.push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) );
 					deref->result = arg->get_type()->clone();
-					deref->result->set_lvalue( true );
 					return deref;
 				} // if
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/GenPoly/Lvalue.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -54,5 +54,4 @@
 				delete ret->result;
 				ret->result = base->clone();
-				ret->result->set_lvalue( true );
 				return ret;
 			} else {
@@ -167,5 +166,4 @@
 				ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
 				appExpr->result = result->base->clone();
-				appExpr->result->set_lvalue( true );
 				if ( ! inIntrinsic ) {
 					// when not in an intrinsic function, add a cast to
@@ -436,5 +434,5 @@
 				delete ret->result;
 				ret->result = castExpr->result;
-				ret->result->set_lvalue( true ); // ensure result is lvalue
+				assert( ret->get_lvalue() ); // ensure result is lvalue
 				castExpr->env = nullptr;
 				castExpr->arg = nullptr;
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -231,5 +231,5 @@
 	SynTree/Initializer.$(OBJEXT) \
 	SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
-	SynTree/DeclReplacer.$(OBJEXT) SynTree/TopLvalue.$(OBJEXT)
+	SynTree/DeclReplacer.$(OBJEXT)
 am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \
 	$(am__objects_2) Concurrency/Keywords.$(OBJEXT) \
@@ -411,4 +411,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
@@ -695,6 +696,5 @@
       SynTree/TypeSubstitution.cc \
       SynTree/Attribute.cc \
-      SynTree/DeclReplacer.cc \
-      SynTree/TopLvalue.cc
+      SynTree/DeclReplacer.cc
 
 
@@ -1025,6 +1025,4 @@
 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
 	SynTree/$(DEPDIR)/$(am__dirstamp)
-SynTree/TopLvalue.$(OBJEXT): SynTree/$(am__dirstamp) \
-	SynTree/$(DEPDIR)/$(am__dirstamp)
 Tuples/$(am__dirstamp):
 	@$(MKDIR_P) Tuples
@@ -1337,5 +1335,4 @@
 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TopLvalue.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/ResolvExpr/ConversionCost.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -157,5 +157,4 @@
 			if ( typesCompatibleIgnoreQualifiers( src, destAsRef->base, indexer, env ) ) {
 				PRINT( std::cerr << "converting compatible base type" << std::endl; )
-				assert( src->get_lvalue() == srcIsLvalue );
 				if ( srcIsLvalue ) {
 					PRINT(
Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -156,5 +156,4 @@
 			for ( const auto& assn : x.assns ) {
 				// compute conversion cost from satisfying decl to assertion
-				assert( !assn.match.adjType->get_lvalue() );
 				k += computeConversionCost(
 					assn.match.adjType, assn.decl->get_type(), false, indexer, x.env );
Index: src/SymTab/Autogen.h
===================================================================
--- src/SymTab/Autogen.h	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SymTab/Autogen.h	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -97,5 +97,5 @@
 			//   type->get_qualifiers() = Type::Qualifiers();
 			Type * castType = addCast->clone();
-			castType->get_qualifiers() -= Type::Qualifiers( Type::Lvalue | Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
+			castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
 			// castType->set_lvalue( true ); // xxx - might not need this
 			dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) );
Index: src/SymTab/ManglerCommon.cc
===================================================================
--- src/SymTab/ManglerCommon.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SymTab/ManglerCommon.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -88,5 +88,4 @@
 				{ Type::Atomic, "DA" }, // A is array, so need something unique for atmoic. For now, go with multiletter DA
 				{ Type::Mutex, "X" },
-				{ Type::Lvalue, "L" },
 			};
 
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SymTab/Validate.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -81,5 +81,4 @@
 #include "SynTree/Label.h"             // for operator==, Label
 #include "SynTree/Mutator.h"           // for Mutator
-#include "SynTree/TopLvalue.h"         // for assertTopLvalue, clearInnerLvalue
 #include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
@@ -309,5 +308,4 @@
 		PassVisitor<FixQualifiedTypes> fixQual;
 
-		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-A");
@@ -318,27 +316,20 @@
 			acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling
 		}
-		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-B");
 			Stats::Time::BlockGuard guard("validate-B");
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Link Reference To Types", [&]() {
 				acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
 			});
-			clearInnerLvalue( translationUnit );
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
 				mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Hoist Structs", [&]() {
 				HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
 				EliminateTypedef::eliminateTypedef( translationUnit ); //
 			});
 		}
-		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-C");
@@ -349,77 +340,55 @@
 			InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
 		}
-		assertTopLvalue( translationUnit );
 		{
 			Stats::Heap::newPass("validate-D");
 			Stats::Time::BlockGuard guard("validate-D");
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
 				Concurrency::applyKeywords( translationUnit );
 			});
-			clearInnerLvalue( translationUnit );
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
 				acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
 				ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
 				autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old
 			});
-			clearInnerLvalue( translationUnit );
-		}
-		assertTopLvalue( translationUnit );
+		}
 		{
 			Stats::Heap::newPass("validate-E");
 			Stats::Time::BlockGuard guard("validate-E");
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
 				Concurrency::implementMutexFuncs( translationUnit );
 			});
-			clearInnerLvalue( translationUnit );
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Implement Thread Start", [&]() {
 				Concurrency::implementThreadStarter( translationUnit );
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Compound Literal", [&]() {
 				mutateAll( translationUnit, compoundliteral );
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
 				ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
 			});
-			clearInnerLvalue( translationUnit );
-		}
-		assertTopLvalue( translationUnit );
+		}
 		{
 			Stats::Heap::newPass("validate-F");
 			Stats::Time::BlockGuard guard("validate-F");
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Object Type", [&]() {
 				FixObjectType::fix( translationUnit );
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Array Length", [&]() {
 				ArrayLength::computeLength( translationUnit );
 			});
-			clearInnerLvalue( translationUnit );
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Find Special Declarations", [&]() {
 				Validate::findSpecialDecls( translationUnit );
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Fix Label Address", [&]() {
 				mutateAll( translationUnit, labelAddrFixer );
 			});
-			assertTopLvalue( translationUnit );
 			Stats::Time::TimeBlock("Handle Attributes", [&]() {
 				Validate::handleAttributes( translationUnit );
 			});
 		}
-		assertTopLvalue( translationUnit );
 	}
 
@@ -1334,5 +1303,4 @@
 	void FixObjectType::previsit( ObjectDecl * objDecl ) {
 		Type * new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer );
-		new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 		objDecl->set_type( new_type );
 	}
@@ -1340,5 +1308,4 @@
 	void FixObjectType::previsit( FunctionDecl * funcDecl ) {
 		Type * new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer );
-		new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 		funcDecl->set_type( new_type );
 	}
@@ -1347,5 +1314,4 @@
 		if ( typeDecl->get_base() ) {
 			Type * new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer );
-			new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 			typeDecl->set_base( new_type );
 		} // if
Index: src/SynTree/AddressExpr.cc
===================================================================
--- src/SynTree/AddressExpr.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/AddressExpr.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -53,6 +53,4 @@
 			} // if
 		}
-		// result of & is never an lvalue
-		get_result()->set_lvalue( false );
 	}
 }
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/ApplicationExpr.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -25,4 +25,5 @@
 #include "Declaration.h"         // for Declaration
 #include "Expression.h"          // for ParamEntry, ApplicationExpr, Expression
+#include "InitTweak/InitTweak.h" // for getFunction
 #include "ResolvExpr/typeops.h"  // for extractResultType
 #include "Type.h"                // for Type, PointerType, FunctionType
@@ -77,5 +78,10 @@
 
 bool ApplicationExpr::get_lvalue() const {
-	return result->get_lvalue();
+	// from src/GenPoly/Lvalue.cc: isIntrinsicReference
+	static std::set<std::string> lvalueFunctions = { "*?", "?[?]" };
+	if ( const DeclarationWithType * func = InitTweak::getFunction( this ) ) {
+		return func->linkage == LinkageSpec::Intrinsic && lvalueFunctions.count(func->name);
+	}
+	return false;
 }
 
Index: src/SynTree/ArrayType.cc
===================================================================
--- src/SynTree/ArrayType.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/ArrayType.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -26,5 +26,4 @@
 ArrayType::ArrayType( const Type::Qualifiers &tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes )
 	: Type( tq, attributes ), base( base ), dimension( dimension ), isVarLen( isVarLen ), isStatic( isStatic ) {
-	base->set_lvalue( false );
 }
 
Index: src/SynTree/CommaExpr.cc
===================================================================
--- src/SynTree/CommaExpr.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/CommaExpr.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -23,9 +23,5 @@
 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 )
 		: Expression(), arg1( arg1 ), arg2( arg2 ) {
-	// xxx - result of a comma expression is never an lvalue, so should set lvalue
-	// to false on all result types. Actually doing this causes some strange things
-	// to happen in later passes (particularly, Specialize, Lvalue, and Box). This needs to be looked into.
 	set_result( maybeClone( arg2->get_result() ) );
-	// get_type->set_isLvalue( false );
 }
 
@@ -40,6 +36,7 @@
 
 bool CommaExpr::get_lvalue() const {
-	// xxx - as above, shouldn't be an lvalue but that information is used anyways.
-	return result->get_lvalue();
+	// This is wrong by C, but the current implementation uses it.
+	// (ex: Specialize, Lvalue and Box)
+	return arg2->get_lvalue();
 }
 
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/Expression.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -19,4 +19,5 @@
 #include <iostream>                  // for ostream, operator<<, basic_ostream
 #include <list>                      // for list, _List_iterator, list<>::co...
+#include <set>                       // for set
 
 #include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
@@ -64,5 +65,4 @@
 
 bool Expression::get_lvalue() const {
-	assert( !result->get_lvalue() );
 	return false;
 }
@@ -115,5 +115,4 @@
 	assert( var->get_type() );
 	Type * type = var->get_type()->clone();
-	type->set_lvalue( true );
 
 	// xxx - doesn't quite work yet - get different alternatives with the same cost
@@ -125,5 +124,5 @@
 	// 	long long int value;
 	// 	if ( decl->valueOf( var, value ) ) {
-	// 		type->set_lvalue( false );
+	// 		type->set_lvalue( false ); // Would have to move to get_lvalue.
 	// 	}
 	// }
@@ -140,5 +139,6 @@
 
 bool VariableExpr::get_lvalue() const {
-	return result->get_lvalue();
+	// It isn't always an lvalue, but it is never an rvalue.
+	return true;
 }
 
@@ -277,5 +277,6 @@
 
 bool CastExpr::get_lvalue() const {
-	return result->get_lvalue();
+	// This is actually wrong by C, but it works with our current set-up.
+	return arg->get_lvalue();
 }
 
@@ -360,4 +361,8 @@
 }
 
+bool UntypedMemberExpr::get_lvalue() const {
+	return aggregate->get_lvalue();
+}
+
 void UntypedMemberExpr::print( std::ostream & os, Indenter indent ) const {
 	os << "Untyped Member Expression, with field: " << std::endl << indent+1;
@@ -378,5 +383,4 @@
 	sub.apply( res );
 	result = res;
-	result->set_lvalue( true );
 	result->get_qualifiers() |= aggregate->result->get_qualifiers();
 }
@@ -392,5 +396,5 @@
 
 bool MemberExpr::get_lvalue() const {
-	assert( result->get_lvalue() );
+	// This is actually wrong by C, but it works with our current set-up.
 	return true;
 }
@@ -427,7 +431,4 @@
 			// if references are still allowed in the AST, dereference returns a reference
 			ret->set_result( new ReferenceType( Type::Qualifiers(), ret->get_result() ) );
-		} else {
-			// references have been removed, in which case dereference returns an lvalue of the base type.
-			ret->result->set_lvalue( true );
 		}
 	}
@@ -447,5 +448,8 @@
 
 bool UntypedExpr::get_lvalue() const {
-	return result->get_lvalue();
+	// from src/GenPoly/Lvalue.cc: isIntrinsicReference
+	static std::set<std::string> lvalueFunctions = { "*?", "?[?]" };
+	std::string fname = InitTweak::getFunctionName( const_cast< UntypedExpr * >( this ) );
+	return lvalueFunctions.count(fname);
 }
 
@@ -510,5 +514,5 @@
 
 bool ConditionalExpr::get_lvalue() const {
-	return result->get_lvalue();
+	return false;
 }
 
@@ -570,5 +574,5 @@
 
 bool ConstructorExpr::get_lvalue() const {
-	return result->get_lvalue();
+	return false;
 }
 
@@ -582,5 +586,4 @@
 CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : initializer( initializer ) {
 	assert( type && initializer );
-	type->set_lvalue( true );
 	set_result( type );
 }
@@ -593,5 +596,4 @@
 
 bool CompoundLiteralExpr::get_lvalue() const {
-	assert( result->get_lvalue() );
 	return true;
 }
@@ -648,5 +650,5 @@
 }
 bool StmtExpr::get_lvalue() const {
-	return result->get_lvalue();
+	return false;
 }
 void StmtExpr::print( std::ostream & os, Indenter indent ) const {
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/Expression.h	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -275,4 +275,6 @@
 	virtual ~UntypedMemberExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_member() const { return member; }
 	void set_member( Expression * newValue ) { member = newValue; }
Index: c/SynTree/TopLvalue.cc
===================================================================
--- src/SynTree/TopLvalue.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ 	(revision )
@@ -1,132 +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.
-//
-// TopLvalue.cc -- Check and force that lvalue is only at the top of types.
-//
-// Author           : Andrew Beach
-// Created On       : Wed Jul 31 15:49:00 2019
-// Last Modified By : Andrew Beach
-// Last Modified On : Wed Aug  7 15:36:00 2019
-// Update Count     : 0
-//
-
-#include <iostream>
-
-#include "Common/PassVisitor.h"
-
-namespace {
-	class TopLvalue : public WithGuards {
-		bool inType = false;
-	public:
-		void previsit( const BaseSyntaxNode * ) {
-			if ( inType ) {
-				GuardValue( inType );
-				inType = false;
-			}
-		}
-
-		void previsit( const Type * type ) {
-			if ( inType ) {
-				assert( !type->get_lvalue() );
-			} else {
-				GuardValue( inType );
-				inType = true;
-			}
-		}
-
-	};
-
-	class ClearLvalue : public WithGuards {
-		bool inType = false;
-	public:
-		void previsit( BaseSyntaxNode * ) {
-			if ( inType ) {
-				GuardValue( inType );
-				inType = false;
-			}
-		}
-
-		void previsit( Type * type ) {
-			if ( !inType ) {
-				GuardValue( inType );
-				inType = true;
-			} else if ( type->get_lvalue() ) {
-				type->set_lvalue( false );
-			}
-		}
-	};
-
-	class TopLvaluePrint : public WithGuards, public WithShortCircuiting {
-		bool failed = false;
-		bool inType = false;
-		bool typeTop = false;
-	public:
-		bool failedAny = false;
-		void previsit() {
-			if ( failed ) {
-				visit_children = false;
-			} else if ( typeTop ) {
-				GuardValue( typeTop );
-				typeTop = false;
-			}
-		}
-
-		void previsit( const BaseSyntaxNode * ) {
-			previsit();
-			if ( inType ) {
-				GuardValue( inType );
-				inType = false;
-			}
-		}
-
-		void previsit( const Type * type ) {
-			previsit();
-			if ( inType ) {
-				if ( type->get_lvalue() ) {
-					failed = true;
-					failedAny = true;
-					visit_children = false;
-					std::cout << type->location << std::endl;
-				}
-				//assert( !type->get_lvalue() );
-			} else {
-				GuardValue( inType );
-				inType = true;
-				typeTop = true;
-			}
-		}
-
-		void postvisit( const Type * type ) {
-			if ( typeTop ) {
-				if ( failed ) {
-					std::cout << type->location << std::endl;
-					type->print( std::cout );
-					//assert( !failed );
-					failed = false;
-				}
-				typeTop = false;
-			}
-		}
-	};
-}
-
-void assertTopLvalue( const std::list< Declaration * > & translationUnit ) {
-	PassVisitor< TopLvaluePrint > visitor;
-	acceptAll( translationUnit, visitor );
-	assert( !visitor.pass.failedAny );
-}
-
-void clearInnerLvalue( std::list< Declaration * > & translationUnit ) {
-	PassVisitor< ClearLvalue > visitor;
-	acceptAll( translationUnit, visitor );
-}
-
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: c/SynTree/TopLvalue.h
===================================================================
--- src/SynTree/TopLvalue.h	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ 	(revision )
@@ -1,34 +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.
-//
-// TopLvalue.h -- Check and force that lvalue is only at the top of types.
-//
-// Author           : Andrew Beach
-// Created On       : Wed Jul 31 16:04:00 2019
-// Last Modified By : Andrew Beach
-// Last Modified On : Wed Aug  7 15:26:00 2019
-// Update Count     : 0
-//
-
-#include <list>
-class Declaration;
-
-void assertTopLvalue( const std::list< Declaration * > & translationUnit );
-/* Assert that all lvalue qualifiers are set on the top level.
- *
- * Does not return if the test fails.
- */
-
-void clearInnerLvalue( std::list< Declaration * > & translationUnit );
-/* Make all types that are not at the top level rvalues (not-lvalues).
- */
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
-
Index: src/SynTree/TupleExpr.cc
===================================================================
--- src/SynTree/TupleExpr.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/TupleExpr.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -58,5 +58,5 @@
 
 bool TupleExpr::get_lvalue() const {
-	return result->get_lvalue();
+	return false;
 }
 
@@ -71,6 +71,4 @@
 	assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested index %d in expr %s", type->size(), index, toString( tuple ).c_str() );
 	set_result( (*std::next( type->get_types().begin(), index ))->clone() );
-	// like MemberExpr, TupleIndexExpr is always an lvalue
-	get_result()->set_lvalue( true );
 }
 
@@ -83,6 +81,5 @@
 
 bool TupleIndexExpr::get_lvalue() const {
-	assert( result->get_lvalue() );
-	return true;
+	return tuple->get_lvalue();
 }
 
Index: src/SynTree/Type.cc
===================================================================
--- src/SynTree/Type.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/Type.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -85,5 +85,5 @@
 const char * Type::FuncSpecifiersNames[] = { "inline", "_Noreturn", "fortran" };
 const char * Type::StorageClassesNames[] = { "extern", "static", "auto", "register", "_Thread_local" };
-const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
+const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "mutex", "_Atomic" };
 
 Type * Type::stripDeclarator() {
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/Type.h	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -102,8 +102,8 @@
 	}; // StorageClasses
 
-	enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6 };
+	enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Mutex = 1 << 3, Atomic = 1 << 4, NumTypeQualifier = 5 };
 	static const char * QualifiersNames[];
 	union Qualifiers {
-		enum { Mask = ~(Restrict | Lvalue) };
+		enum { Mask = ~Restrict };
 		unsigned int val;
 		struct {
@@ -111,5 +111,4 @@
 			bool is_restrict : 1;
 			bool is_volatile : 1;
-			bool is_lvalue : 1;
 			bool is_mutex : 1;
 			bool is_atomic : 1;
@@ -153,5 +152,4 @@
 	bool get_volatile() const { return tq.is_volatile; }
 	bool get_restrict() const { return tq.is_restrict; }
-	bool get_lvalue() const { return tq.is_lvalue; }
 	bool get_mutex() const { return tq.is_mutex; }
 	bool get_atomic() const { return tq.is_atomic; }
@@ -159,5 +157,4 @@
 	void set_volatile( bool newValue ) { tq.is_volatile = newValue; }
 	void set_restrict( bool newValue ) { tq.is_restrict = newValue; }
-	void set_lvalue( bool newValue ) { tq.is_lvalue = newValue; }
 	void set_mutex( bool newValue ) { tq.is_mutex = newValue; }
 	void set_atomic( bool newValue ) { tq.is_atomic = newValue; }
Index: src/SynTree/module.mk
===================================================================
--- src/SynTree/module.mk	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/SynTree/module.mk	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -49,6 +49,5 @@
       SynTree/TypeSubstitution.cc \
       SynTree/Attribute.cc \
-      SynTree/DeclReplacer.cc \
-      SynTree/TopLvalue.cc
+      SynTree/DeclReplacer.cc
 
 SRC += $(SRC_SYNTREE)
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/Tuples/TupleExpansion.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -304,5 +304,5 @@
 		// produce the TupleType which aggregates the types of the exprs
 		std::list< Type * > types;
-		Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex );
+		Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic | Type::Mutex );
 		for ( Expression * expr : exprs ) {
 			assert( expr->get_result() );
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ src/main.cc	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -59,5 +59,4 @@
 #include "ResolvExpr/Resolver.h"            // for resolve
 #include "SymTab/Validate.h"                // for validate
-#include "SynTree/TopLvalue.h"              // for assertTopLvalue, clearInn...
 #include "SynTree/Declaration.h"            // for Declaration
 #include "SynTree/Visitor.h"                // for acceptAll
@@ -259,8 +258,4 @@
 		Stats::Time::StopBlock();
 
-		//std::cerr << "Post-Parse Check" << std::endl;
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
-
 		// add the assignment statement after the initialization of a type parameter
 		PASS( "Validate", SymTab::validate( translationUnit, symtabp ) );
@@ -281,13 +276,8 @@
 		} // if
 
-		assertTopLvalue( translationUnit );
 		PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) );
-		assertTopLvalue( translationUnit );
 		PASS( "Fix Names", CodeGen::fixNames( translationUnit ) );
-		assertTopLvalue( translationUnit );
 		PASS( "Gen Init", InitTweak::genInit( translationUnit ) );
-		assertTopLvalue( translationUnit );
 		PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) );
-		assertTopLvalue( translationUnit );
 		if ( libcfap ) {
 			// generate the bodies of cfa library functions
@@ -313,6 +303,4 @@
 		} // if
 
-		assertTopLvalue( translationUnit );
-
 		PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
 		if ( exprp ) {
@@ -321,11 +309,6 @@
 		} // if
 
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
-
 		// fix ObjectDecl - replaces ConstructorInit nodes
 		PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) );
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
 		if ( ctorinitp ) {
 			dump ( translationUnit );
@@ -334,19 +317,12 @@
 
 		PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
-		assertTopLvalue( translationUnit );
 
 		PASS( "Translate EHM" , ControlStruct::translateEHM( translationUnit ) );
-		assertTopLvalue( translationUnit );
 
 		PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) );
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
 
 		PASS( "Convert Specializations",  GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
 
 		PASS( "Expand Tuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this?
-		assertTopLvalue( translationUnit );
 
 		if ( tuplep ) {
@@ -356,5 +332,4 @@
 
 		PASS( "Virtual Expand Casts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM
-		assertTopLvalue( translationUnit );
 
 		PASS( "Instantiate Generics", GenPoly::instantiateGeneric( translationUnit ) );
@@ -363,9 +338,6 @@
 			return EXIT_SUCCESS;
 		} // if
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
+
 		PASS( "Convert L-Value", GenPoly::convertLvalue( translationUnit ) );
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
 
 		if ( bboxp ) {
@@ -374,6 +346,4 @@
 		} // if
 		PASS( "Box", GenPoly::box( translationUnit ) );
-		clearInnerLvalue( translationUnit );
-		assertTopLvalue( translationUnit );
 
 		if ( bcodegenp ) {
@@ -387,5 +357,4 @@
 
 		CodeTools::fillLocations( translationUnit );
-		assertTopLvalue( translationUnit );
 		PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) );
 
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tests/Makefile.am	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -24,5 +24,4 @@
 archiveerrors=
 
-INSTALL_FLAGS=-in-tree
 DEBUG_FLAGS=-debug -O0
 
@@ -43,6 +42,9 @@
 	-DIN_DIR="${abs_srcdir}/.in/"
 
+# get the desired cfa to test
+TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
+
 # adjust CC to current flags
-CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
+CC = $(if $(ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 CFACC = $(CC)
 
@@ -51,5 +53,5 @@
 
 # adjusted CC but without the actual distcc call
-CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
+CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 
 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
Index: tests/Makefile.in
===================================================================
--- tests/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tests/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -214,5 +214,5 @@
 
 # adjust CC to current flags
-CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
+CC = $(if $(ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 CCAS = @CCAS@
 CCASDEPMODE = @CCASDEPMODE@
@@ -220,4 +220,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = $(CC)
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
@@ -381,5 +382,4 @@
 installed = no
 archiveerrors = 
-INSTALL_FLAGS = -in-tree
 DEBUG_FLAGS = -debug -O0
 quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
@@ -398,9 +398,12 @@
 
 
+# get the desired cfa to test
+TARGET_CFA = $(if $(filter $(installed),yes), @CFACC_INSTALL@, @CFACC@)
+
 # get local binary for depedencies
 CFACCBIN = @CFACC@
 
 # adjusted CC but without the actual distcc call
-CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})
+CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
 PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
 avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tests/pybin/settings.py	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -96,6 +96,6 @@
 			distribute = False
 
-		self.string = "installed" if value else "in-tree"
-		self.flags  = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree")
+		self.string = "installed" if value else "in tree"
+		self.flags  = """installed=%s""" % ("yes" if value else "no")
 
 class Timeouts:
Index: tests/pybin/tools.py
===================================================================
--- tests/pybin/tools.py	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tests/pybin/tools.py	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -343,5 +343,5 @@
 	# make a directory for this test
 	# mkdir makes the parent directory only so add a dummy
-	mkdir(os.path.join(dst, "dir"))
+	mkdir(os.path.join(dst, name ))
 
 	# moves the files
Index: tools/Makefile.in
===================================================================
--- tools/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tools/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -208,4 +208,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
Index: tools/prettyprinter/Makefile.in
===================================================================
--- tools/prettyprinter/Makefile.in	(revision 970141de748b8da353f768f0218cbba8c23a5769)
+++ tools/prettyprinter/Makefile.in	(revision 19858f64ece324c557d9e4748194f16f58d1e7e3)
@@ -237,4 +237,5 @@
 CCDEPMODE = @CCDEPMODE@
 CFACC = @CFACC@
+CFACC_INSTALL = @CFACC_INSTALL@
 CFACPP = @CFACPP@
 CFA_BACKEND_CC = @CFA_BACKEND_CC@
