public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7620] PR modula2/109675 implementation of writeAddress is non portable
@ 2023-07-28 11:56 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2023-07-28 11:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:542cba5b5d9d8aae94e3143df7a8cb4714373691

commit r13-7620-g542cba5b5d9d8aae94e3143df7a8cb4714373691
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Fri Jul 28 12:55:12 2023 +0100

    PR modula2/109675 implementation of writeAddress is non portable
    
    The implementation of gcc/m2/gm2-libs/DynamicStrings.mod:writeAddress
    is non portable as it casts a void * into an unsigned long int.  This
    procedure has been re-implemented to use snprintf.  As it is a library
    the support tools 'mc' and 'pge' have been rebuilt.  There have been
    linking changes in the library and the underlying boolean type is now
    bool since the last rebuild hence the size of the patch.
    
    gcc/m2/ChangeLog:
    
            PR modula2/109675
            * Make-lang.in (MC-LIB-DEFS): Remove M2LINK.def.
            (BUILD-PGE-O): Remove GM2LINK.o.
            * Make-maintainer.in (PPG-DEFS): New define.
            (PPG-LIB-DEFS): Remove M2LINK.def.
            (BUILD-BOOT-PPG-H): Add PPGDEF .h files.
            (m2/ppg$(exeext)): Remove M2LINK.o
            (PGE-DEPS): New define.
            (m2/pg$(exeext)): Remove M2LINK.o.
            (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Add -Im2/gm2-pge-boot.
            (m2/pge$(exeext)): Remove M2LINK.o.
            (pge-maintainer): Re-implement.
            (pge-libs-push): Re-implement.
            (m2/m2obj3/cc1gm2$(exeext)): Remove M2LINK.o.
            * gm2-libs/DynamicStrings.mod (writeAddress): Re-implement
            using snprintf.
            * gm2-libs/M2Dependent.mod: Remove commented out imports.
            * mc-boot/GDynamicStrings.cc: Rebuild.
            * mc-boot/GFIO.cc: Rebuild.
            * mc-boot/GFormatStrings.cc: Rebuild.
            * mc-boot/GM2Dependent.cc: Rebuild.
            * mc-boot/GM2Dependent.h: Rebuild.
            * mc-boot/GM2RTS.cc: Rebuild.
            * mc-boot/GM2RTS.h: Rebuild.
            * mc-boot/GRTExceptions.cc: Rebuild.
            * mc-boot/GRTint.cc: Rebuild.
            * mc-boot/GSFIO.cc: Rebuild.
            * mc-boot/GStringConvert.cc: Rebuild.
            * mc-boot/Gdecl.cc: Rebuild.
            * pge-boot/GASCII.cc: Rebuild.
            * pge-boot/GASCII.h: Rebuild.
            * pge-boot/GArgs.cc: Rebuild.
            * pge-boot/GArgs.h: Rebuild.
            * pge-boot/GAssertion.cc: Rebuild.
            * pge-boot/GAssertion.h: Rebuild.
            * pge-boot/GBreak.h: Rebuild.
            * pge-boot/GCmdArgs.h: Rebuild.
            * pge-boot/GDebug.cc: Rebuild.
            * pge-boot/GDebug.h: Rebuild.
            * pge-boot/GDynamicStrings.cc: Rebuild.
            * pge-boot/GDynamicStrings.h: Rebuild.
            * pge-boot/GEnvironment.h: Rebuild.
            * pge-boot/GFIO.cc: Rebuild.
            * pge-boot/GFIO.h: Rebuild.
            * pge-boot/GFormatStrings.h:: Rebuild.
            * pge-boot/GFpuIO.h:: Rebuild.
            * pge-boot/GIO.cc: Rebuild.
            * pge-boot/GIO.h: Rebuild.
            * pge-boot/GIndexing.cc: Rebuild.
            * pge-boot/GIndexing.h: Rebuild.
            * pge-boot/GLists.cc: Rebuild.
            * pge-boot/GLists.h: Rebuild.
            * pge-boot/GM2Dependent.cc: Rebuild.
            * pge-boot/GM2Dependent.h: Rebuild.
            * pge-boot/GM2EXCEPTION.cc: Rebuild.
            * pge-boot/GM2EXCEPTION.h: Rebuild.
            * pge-boot/GM2RTS.cc: Rebuild.
            * pge-boot/GM2RTS.h: Rebuild.
            * pge-boot/GNameKey.cc: Rebuild.
            * pge-boot/GNameKey.h: Rebuild.
            * pge-boot/GNumberIO.cc: Rebuild.
            * pge-boot/GNumberIO.h: Rebuild.
            * pge-boot/GOutput.cc: Rebuild.
            * pge-boot/GOutput.h: Rebuild.
            * pge-boot/GPushBackInput.cc: Rebuild.
            * pge-boot/GPushBackInput.h: Rebuild.
            * pge-boot/GRTExceptions.cc: Rebuild.
            * pge-boot/GRTExceptions.h: Rebuild.
            * pge-boot/GSArgs.h: Rebuild.
            * pge-boot/GSEnvironment.h: Rebuild.
            * pge-boot/GSFIO.cc: Rebuild.
            * pge-boot/GSFIO.h: Rebuild.
            * pge-boot/GSYSTEM.h: Rebuild.
            * pge-boot/GScan.h: Rebuild.
            * pge-boot/GStdIO.cc: Rebuild.
            * pge-boot/GStdIO.h: Rebuild.
            * pge-boot/GStorage.cc: Rebuild.
            * pge-boot/GStorage.h: Rebuild.
            * pge-boot/GStrCase.cc: Rebuild.
            * pge-boot/GStrCase.h: Rebuild.
            * pge-boot/GStrIO.cc: Rebuild.
            * pge-boot/GStrIO.h: Rebuild.
            * pge-boot/GStrLib.cc: Rebuild.
            * pge-boot/GStrLib.h: Rebuild.
            * pge-boot/GStringConvert.h: Rebuild.
            * pge-boot/GSymbolKey.cc: Rebuild.
            * pge-boot/GSymbolKey.h: Rebuild.
            * pge-boot/GSysExceptions.h: Rebuild.
            * pge-boot/GSysStorage.cc: Rebuild.
            * pge-boot/GSysStorage.h: Rebuild.
            * pge-boot/GTimeString.h: Rebuild.
            * pge-boot/GUnixArgs.h: Rebuild.
            * pge-boot/Gbnflex.cc: Rebuild.
            * pge-boot/Gbnflex.h: Rebuild.
            * pge-boot/Gdtoa.h: Rebuild.
            * pge-boot/Gerrno.h: Rebuild.
            * pge-boot/Gldtoa.h: Rebuild.
            * pge-boot/Glibc.h: Rebuild.
            * pge-boot/Glibm.h: Rebuild.
            * pge-boot/Gpge.cc: Rebuild.
            * pge-boot/Gtermios.h: Rebuild.
            * pge-boot/Gwrapc.h: Rebuild.
            * mc-boot/GM2LINK.h: Removed.
            * pge-boot/GM2LINK.cc: Removed.
            * pge-boot/GM2LINK.h: Removed.
    
    (cherry picked from commit 9525daf0fbc5c836ee028f5b58612857de7da51d)
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 gcc/m2/Make-lang.in                |   2 -
 gcc/m2/Make-maintainer.in          | 143 ++++++++--
 gcc/m2/gm2-libs/DynamicStrings.mod |   9 +-
 gcc/m2/gm2-libs/M2Dependent.mod    |   2 -
 gcc/m2/mc-boot/GDynamicStrings.cc  |  29 +-
 gcc/m2/mc-boot/GFIO.cc             |   2 -
 gcc/m2/mc-boot/GFormatStrings.cc   |   2 -
 gcc/m2/mc-boot/GM2Dependent.cc     |  85 +++---
 gcc/m2/mc-boot/GM2Dependent.h      |   2 +-
 gcc/m2/mc-boot/GM2LINK.h           |  60 ----
 gcc/m2/mc-boot/GM2RTS.cc           |   6 +-
 gcc/m2/mc-boot/GM2RTS.h            |   2 +-
 gcc/m2/mc-boot/GRTExceptions.cc    |   1 -
 gcc/m2/mc-boot/GRTint.cc           |   6 +-
 gcc/m2/mc-boot/GSFIO.cc            |   1 -
 gcc/m2/mc-boot/GStringConvert.cc   |   4 +-
 gcc/m2/mc-boot/Gdecl.cc            |   2 +-
 gcc/m2/pge-boot/GASCII.cc          |   1 +
 gcc/m2/pge-boot/GASCII.h           |   1 +
 gcc/m2/pge-boot/GArgs.cc           |   5 +-
 gcc/m2/pge-boot/GArgs.h            |   3 +-
 gcc/m2/pge-boot/GAssertion.cc      |   5 +-
 gcc/m2/pge-boot/GAssertion.h       |   3 +-
 gcc/m2/pge-boot/GBreak.h           |   1 +
 gcc/m2/pge-boot/GCmdArgs.h         |   3 +-
 gcc/m2/pge-boot/GDebug.cc          |  14 +-
 gcc/m2/pge-boot/GDebug.h           |   5 +-
 gcc/m2/pge-boot/GDynamicStrings.cc | 150 +++++-----
 gcc/m2/pge-boot/GDynamicStrings.h  |  15 +-
 gcc/m2/pge-boot/GEnvironment.h     |   5 +-
 gcc/m2/pge-boot/GFIO.cc            | 131 +++++----
 gcc/m2/pge-boot/GFIO.h             |  19 +-
 gcc/m2/pge-boot/GFormatStrings.h   |   1 +
 gcc/m2/pge-boot/GFpuIO.h           |   1 +
 gcc/m2/pge-boot/GIO.cc             | 113 ++++----
 gcc/m2/pge-boot/GIO.h              |   9 +-
 gcc/m2/pge-boot/GIndexing.cc       |  20 +-
 gcc/m2/pge-boot/GIndexing.h        |   5 +-
 gcc/m2/pge-boot/GLists.cc          |  15 +-
 gcc/m2/pge-boot/GLists.h           |   3 +-
 gcc/m2/pge-boot/GM2Dependent.cc    | 188 ++++++------
 gcc/m2/pge-boot/GM2Dependent.h     |   5 +-
 gcc/m2/pge-boot/GM2EXCEPTION.cc    |   5 +-
 gcc/m2/pge-boot/GM2EXCEPTION.h     |   3 +-
 gcc/m2/pge-boot/GM2LINK.cc         |  27 --
 gcc/m2/pge-boot/GM2LINK.h          |  59 ----
 gcc/m2/pge-boot/GM2RTS.cc          |  51 ++--
 gcc/m2/pge-boot/GM2RTS.h           |  13 +-
 gcc/m2/pge-boot/GNameKey.cc        |  17 +-
 gcc/m2/pge-boot/GNameKey.h         |   5 +-
 gcc/m2/pge-boot/GNumberIO.cc       |  81 +++---
 gcc/m2/pge-boot/GNumberIO.h        |   1 +
 gcc/m2/pge-boot/GOutput.cc         |  15 +-
 gcc/m2/pge-boot/GOutput.h          |   3 +-
 gcc/m2/pge-boot/GPushBackInput.cc  |  15 +-
 gcc/m2/pge-boot/GPushBackInput.h   |   3 +-
 gcc/m2/pge-boot/GRTExceptions.cc   |  52 ++--
 gcc/m2/pge-boot/GRTExceptions.h    |   9 +-
 gcc/m2/pge-boot/GSArgs.h           |   3 +-
 gcc/m2/pge-boot/GSEnvironment.h    |   5 +-
 gcc/m2/pge-boot/GSFIO.cc           |  10 +-
 gcc/m2/pge-boot/GSFIO.h            |   5 +-
 gcc/m2/pge-boot/GSYSTEM.h          |   1 +
 gcc/m2/pge-boot/GScan.h            |   5 +-
 gcc/m2/pge-boot/GStdIO.cc          |   1 +
 gcc/m2/pge-boot/GStdIO.h           |   1 +
 gcc/m2/pge-boot/GStorage.cc        |   5 +-
 gcc/m2/pge-boot/GStorage.h         |   3 +-
 gcc/m2/pge-boot/GStrCase.cc        |   1 +
 gcc/m2/pge-boot/GStrCase.h         |   1 +
 gcc/m2/pge-boot/GStrIO.cc          |   9 +-
 gcc/m2/pge-boot/GStrIO.h           |   1 +
 gcc/m2/pge-boot/GStrLib.cc         |  27 +-
 gcc/m2/pge-boot/GStrLib.h          |   7 +-
 gcc/m2/pge-boot/GStringConvert.h   |  25 +-
 gcc/m2/pge-boot/GSymbolKey.cc      |  27 +-
 gcc/m2/pge-boot/GSymbolKey.h       |   9 +-
 gcc/m2/pge-boot/GSysExceptions.h   |   1 +
 gcc/m2/pge-boot/GSysStorage.cc     |  29 +-
 gcc/m2/pge-boot/GSysStorage.h      |   3 +-
 gcc/m2/pge-boot/GTimeString.h      |   1 +
 gcc/m2/pge-boot/GUnixArgs.h        |   1 +
 gcc/m2/pge-boot/Gbnflex.cc         |  45 +--
 gcc/m2/pge-boot/Gbnflex.h          |  11 +-
 gcc/m2/pge-boot/Gdtoa.h            |   5 +-
 gcc/m2/pge-boot/Gerrno.h           |   1 +
 gcc/m2/pge-boot/Gldtoa.h           |   5 +-
 gcc/m2/pge-boot/Glibc.h            |   3 +-
 gcc/m2/pge-boot/Glibm.h            |   1 +
 gcc/m2/pge-boot/Gpge.cc            | 569 +++++++++++++++++++------------------
 gcc/m2/pge-boot/Gtermios.h         |   9 +-
 gcc/m2/pge-boot/Gwrapc.h           |   1 +
 92 files changed, 1137 insertions(+), 1132 deletions(-)

diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index b34db0d9156..57949ffdb1c 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -1161,7 +1161,6 @@ MC-LIB-DEFS = \
    IO.def \
    M2Dependent.def \
    M2EXCEPTION.def \
-   M2LINK.def \
    M2RTS.def \
    MemUtils.def \
    NumberIO.def \
@@ -1710,7 +1709,6 @@ BUILD-PGE-O = \
    m2/pge-boot/Glibc.o \
    m2/pge-boot/Gerrno.o \
    m2/pge-boot/GUnixArgs.o \
-   m2/pge-boot/GM2LINK.o \
    m2/pge-boot/Gtermios.o \
    m2/pge-boot/GSysExceptions.o \
    m2/pge-boot/Gabort.o \
diff --git a/gcc/m2/Make-maintainer.in b/gcc/m2/Make-maintainer.in
index 17bd9a2d37e..6bd15503f53 100644
--- a/gcc/m2/Make-maintainer.in
+++ b/gcc/m2/Make-maintainer.in
@@ -34,13 +34,15 @@ PPG-INTERFACE-CC = UnixArgs.cc ldtoa.cc dtoa.cc
 
 PPG-MODS         = SymbolKey.mod   NameKey.mod  Lists.mod  bnflex.mod  Output.mod
 
+PPG-DEFS         = SymbolKey.def   NameKey.def  Lists.def  bnflex.def  Output.def
+
 # Core library definition modules used by ppg found in the gm2-libs directory.
 
 PPG-LIB-DEFS     = Args.def Assertion.def ASCII.def Debug.def \
                    DynamicStrings.def FIO.def Indexing.def IO.def \
                    NumberIO.def PushBackInput.def \
                    M2Dependent.def \
-                   M2EXCEPTION.def M2LINK.def M2RTS.def \
+                   M2EXCEPTION.def M2RTS.def \
                    RTExceptions.def \
                    StdIO.def SFIO.def StrIO.def StrLib.def \
                    Storage.def StrCase.def SysStorage.def
@@ -97,7 +99,8 @@ BUILD-PPG-H = m2/boot-bin/mc$(exeext) $(BUILD-PPG-LIBS-H)
 
 BUILD-BOOT-PPG-H: $(BUILD-BOOT-H) \
                  m2/gm2-ppg-boot/$(SRC_PREFIX)M2RTS.h \
-                 m2/gm2-ppg-boot/$(SRC_PREFIX)M2Dependent.h
+                 m2/gm2-ppg-boot/$(SRC_PREFIX)M2Dependent.h \
+		 $(PPG-DEFS:%.def=m2/gm2-ppg-boot/$(SRC_PREFIX)%.h)
 
 m2/gm2-ppg-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
 	-test -d m2/gm2-ppg-boot || $(mkinstalldirs) m2/gm2-ppg-boot
@@ -133,12 +136,10 @@ m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BU
               -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)$*.cc -o $@
 
 m2/ppg$(exeext): m2/boot-bin/mc $(BUILD-PPG-O) $(BUILD-MC-INTERFACE-O) m2/gm2-ppg-boot/main.o \
-                 m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o \
-                 m2/gm2-libs-boot/M2LINK.o
+                 m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o
 	-test -d m2 || $(mkinstalldirs) m2
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PPG-O) m2/gm2-ppg-boot/main.o \
-                 m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o \
-                 m2/gm2-libs-boot/M2LINK.o -lm
+                 m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o -lm
 
 m2/gm2-ppg-boot/main.o: $(M2LINK) $(srcdir)/m2/init/mcinit
 	-test -d m2/gm2-ppg-boot || $(mkinstalldirs) m2/gm2-ppg-boot
@@ -168,7 +169,6 @@ PGE-DEF = ASCII.def \
    IO.def \
    M2Dependent.def \
    M2EXCEPTION.def \
-   M2LINK.def \
    M2RTS.def \
    MemUtils.def \
    NumberIO.def \
@@ -199,6 +199,98 @@ PGE-DEF = ASCII.def \
    termios.def \
    wrapc.def \
 
+PGE-DEPS = Gabort.cc \
+   GArgs.cc \
+   GArgs.h \
+   GASCII.cc \
+   GASCII.h \
+   GAssertion.cc \
+   GAssertion.h \
+   Gbnflex.cc \
+   Gbnflex.h \
+   GBreak.h \
+   GBuiltins.cc \
+   Gcbuiltin.cc \
+   GCmdArgs.h \
+   GDebug.cc \
+   GDebug.h \
+   Gdtoa.cc \
+   Gdtoa.h \
+   GDynamicStrings.cc \
+   GDynamicStrings.h \
+   GEnvironment.h \
+   Gerrno.cc \
+   Gerrno.h \
+   GFIO.cc \
+   GFIO.h \
+   GFormatStrings.h \
+   GFpuIO.h \
+   GIndexing.cc \
+   GIndexing.h \
+   GIO.cc \
+   GIO.h \
+   Gldtoa.cc \
+   Gldtoa.h \
+   Glibc.cc \
+   Glibc.h \
+   Glibm.cc \
+   Glibm.h \
+   GLists.cc \
+   GLists.h \
+   GM2Dependent.cc \
+   GM2Dependent.h \
+   GM2EXCEPTION.cc \
+   GM2EXCEPTION.h \
+   GM2RTS.cc \
+   GM2RTS.h \
+   Gmcrts.cc \
+   Gmcrts.h \
+   GNameKey.cc \
+   GNameKey.h \
+   Gnetwork.h \
+   GNumberIO.cc \
+   GNumberIO.h \
+   GOutput.cc \
+   GOutput.h \
+   Gpge.cc \
+   GPushBackInput.cc \
+   GPushBackInput.h \
+   GRTco.cc \
+   GRTExceptions.cc \
+   GRTExceptions.h \
+   GSArgs.h \
+   GScan.h \
+   GSelective.cc \
+   GSEnvironment.h \
+   GSFIO.cc \
+   GSFIO.h \
+   GStdIO.cc \
+   GStdIO.h \
+   GStorage.cc \
+   GStorage.h \
+   GStrCase.cc \
+   GStrCase.h \
+   GStringConvert.h \
+   GStrIO.cc \
+   GStrIO.h \
+   GStrLib.cc \
+   GStrLib.h \
+   GSymbolKey.cc \
+   GSymbolKey.h \
+   GSysExceptions.cc \
+   GSysExceptions.h \
+   GSysStorage.cc \
+   GSysStorage.h \
+   GSYSTEM.cc \
+   GSYSTEM.h \
+   Gtermios.cc \
+   Gtermios.h \
+   GTimeString.h \
+   GUnixArgs.cc \
+   GUnixArgs.h \
+   Gwrapc.cc \
+   Gwrapc.h
+
 BUILD-PG-O = $(PPG-INTERFACE-C:%.c=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
              $(PPG-INTERFACE-CC:%.cc=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
              $(PPG-MODS:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
@@ -252,11 +344,10 @@ m2/gm2-pg-boot/$(SRC_PREFIX)pg.o:  m2/gm2-auto/pg.mod $(MCDEPS) $(BUILD-BOOT-PG-
 m2/pg$(exeext): m2/boot-bin/mc \
     $(BUILD-PG-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pg-boot/%.o) \
     $(BUILD-MC-INTERFACE-O) m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
-    m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o
+    m2/mc-boot-ch/$(SRC_PREFIX)abort.o
 	-test -d m2 || $(mkinstalldirs) m2
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PG-O) \
          m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
-         m2/gm2-libs-boot/M2LINK.o \
          m2/mc-boot-ch/$(SRC_PREFIX)abort.o -lm
 
 m2/gm2-auto/pginit:
@@ -369,7 +460,7 @@ m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BU
 	-test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot
 	$(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.cc $(srcdir)/m2/gm2-compiler/$*.mod
 	$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot -Im2/gm2-compiler-boot \
-              -Im2/gm2-libs-boot \
+              -Im2/gm2-libs-boot -Im2/gm2-pge-boot \
               -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.cc -o $@
 
 m2/gm2-pge-boot/$(SRC_PREFIX)pge.o:  m2/gm2-auto/pge.mod $(MCDEPS) $(BUILD-BOOT-PGE-H)
@@ -382,11 +473,11 @@ m2/gm2-pge-boot/$(SRC_PREFIX)pge.o:  m2/gm2-auto/pge.mod $(MCDEPS) $(BUILD-BOOT-
 m2/pge$(exeext): m2/boot-bin/mc \
     $(BUILD-PGE-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pge-boot/%.o) \
     $(BUILD-MC-INTERFACE-O) m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
-    m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o
+    m2/mc-boot-ch/$(SRC_PREFIX)abort.o
 	-test -d m2 || $(mkinstalldirs) m2
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PGE-O) \
          m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
-         m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o -lm
+         m2/mc-boot-ch/$(SRC_PREFIX)abort.o -lm
 	$(SHELL) $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod t > m2/gm2-auto/t.bnf
 	./m2/pge$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t1.mod
 	./m2/pg$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t2.mod
@@ -436,25 +527,29 @@ pge-help: force
 	@echo " make pge-app-push   # copy pge C++ application modules into srcdir/m2/pge-boot"
 	@echo " make pge-clean"
 
-pge-maintainer: $(PGE)
+# pge-maintainer: $(PGE)
+pge-maintainer: pge-clean $(PGE) pge-verify pge-push
 
 # Copy the C++ sources for ppe.mod into $(srcdir)/pge-boot.
 
 pge-push: pge-libs-push pge-app-push
 
 pge-libs-push: force
-	for i in $(cat $(srcdir)/m2/init/ppginit) ; do \
-	    if [ -f $(srcdir)/m2/gm2-libs-ch/${i}.h ] ; then \
-                cp $(srcdir)/m2/gm2-libs-ch/${i}.h $(srcdir) ; \
-            else \
-                echo "not found ${i}" ; \
-            fi ; \
-	    if [ -f $(srcdir)/m2/gm2-libs-ch/${i}.c* ] ; then \
-                cp $(srcdir)/m2/gm2-libs-ch/${i}.c* $(srcdir) ; \
-	    elif [ -f $(srcdir)/m2/gm2-pge-libs/${i}.c* ] ; then \
-                cp $(srcdir)/m2/gm2-pge-libs/${i}.c* $(srcdir) ; \
+	for i in ${PGE-DEPS} ; do \
+	    if [ -f ${srcdir}/m2/gm2-libs-ch/$${i} ] ; then \
+               echo cp ${srcdir}/m2/gm2-libs-ch/$${i} ${srcdir}/m2/pge-boot ; \
+               cp ${srcdir}/m2/gm2-libs-ch/$${i} ${srcdir}/m2/pge-boot ; \
+            elif [ -f m2/gm2-pge-boot/$${i} ] ; then \
+               echo cp m2/gm2-pge-boot/$${i} ${srcdir}/m2/pge-boot ; \
+               cp m2/gm2-pge-boot/$${i} ${srcdir}/m2/pge-boot ; \
+            elif [ -f m2/gm2-compiler-boot/$${i} ] ; then \
+               echo cp m2/gm2-compiler-boot/$${i} ${srcdir}/m2/pge-boot ; \
+               cp m2/gm2-compiler-boot/$${i} ${srcdir}/m2/pge-boot ; \
+            elif [ -f m2/gm2-libs-boot/$${i} ] ; then \
+               echo cp m2/gm2-libs-boot/$${i} ${srcdir}/m2/pge-boot ; \
+               cp m2/gm2-libs-boot/$${i} ${srcdir}/m2/pge-boot ; \
             else \
-                echo "not found ${i}" ; \
+               echo "not found $${i}" ; \
             fi ; \
         done
 
diff --git a/gcc/m2/gm2-libs/DynamicStrings.mod b/gcc/m2/gm2-libs/DynamicStrings.mod
index 37a7ed8c205..2c93130382c 100644
--- a/gcc/m2/gm2-libs/DynamicStrings.mod
+++ b/gcc/m2/gm2-libs/DynamicStrings.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 IMPLEMENTATION MODULE DynamicStrings ;
 
-FROM libc IMPORT strlen, strncpy, write, exit ;
+FROM libc IMPORT strlen, strncpy, write, exit, snprintf ;
 FROM StrLib IMPORT StrLen ;
 FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
 FROM Assertion IMPORT Assert ;
@@ -411,12 +411,15 @@ END writeLongcard ;
 
 
 (*
-   writeAddress -
+   writeAddress - writes out the address of a with a C style hex prefix.
 *)
 
 PROCEDURE writeAddress (a: ADDRESS) ;
+VAR
+   buffer: ARRAY [0..30] OF CHAR ;
 BEGIN
-   writeLongcard (VAL (LONGCARD, a))
+   snprintf (ADR (buffer), SIZE (buffer), "0x%", a) ;
+   writeString (buffer) ;
 END writeAddress ;
 
 
diff --git a/gcc/m2/gm2-libs/M2Dependent.mod b/gcc/m2/gm2-libs/M2Dependent.mod
index 052d2ceef8e..47bbf13aed4 100644
--- a/gcc/m2/gm2-libs/M2Dependent.mod
+++ b/gcc/m2/gm2-libs/M2Dependent.mod
@@ -28,8 +28,6 @@ IMPLEMENTATION MODULE M2Dependent ;
 
 
 FROM libc IMPORT abort, exit, write, getenv, printf, snprintf, strncpy ;
-(* FROM Builtins IMPORT strncmp, strcmp ;  not available during bootstrap.  *)
-(* FROM M2LINK IMPORT ForcedModuleInitOrder, StaticInitialization, PtrToChar ; *)
 FROM ASCII IMPORT nul, nl ;
 FROM SYSTEM IMPORT ADR, SIZE ;
 FROM Storage IMPORT ALLOCATE ;
diff --git a/gcc/m2/mc-boot/GDynamicStrings.cc b/gcc/m2/mc-boot/GDynamicStrings.cc
index e97764db71a..0076047b3d1 100644
--- a/gcc/m2/mc-boot/GDynamicStrings.cc
+++ b/gcc/m2/mc-boot/GDynamicStrings.cc
@@ -463,7 +463,7 @@ static void writeCard (unsigned int c);
 static void writeLongcard (long unsigned int l);
 
 /*
-   writeAddress -
+   writeAddress - writes out the address of a with a C style hex prefix.
 */
 
 static void writeAddress (void * a);
@@ -684,8 +684,6 @@ static void writeNspace (unsigned int n)
 
 static void DumpStringInfo (DynamicStrings_String s, unsigned int i)
 {
-  DynamicStrings_String t;
-
   if (s != NULL)
     {
       writeNspace (i);
@@ -901,12 +899,18 @@ static void writeLongcard (long unsigned int l)
 
 
 /*
-   writeAddress -
+   writeAddress - writes out the address of a with a C style hex prefix.
 */
 
 static void writeAddress (void * a)
 {
-  writeLongcard ((long unsigned int ) (a));
+  typedef struct writeAddress__T4_a writeAddress__T4;
+
+  struct writeAddress__T4_a { char array[30+1]; };
+  writeAddress__T4 buffer;
+
+  libc_snprintf (&buffer, static_cast<size_t> (sizeof (buffer)), (const char *) "0x%", 3, a);
+  writeString ((const char *) &buffer.array[0], 30);
 }
 
 
@@ -1655,10 +1659,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a)
 
 extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch)
 {
-  typedef struct InitStringChar__T4_a InitStringChar__T4;
+  typedef struct InitStringChar__T5_a InitStringChar__T5;
 
-  struct InitStringChar__T4_a { char array[1+1]; };
-  InitStringChar__T4 a;
+  struct InitStringChar__T5_a { char array[1+1]; };
+  InitStringChar__T5 a;
   DynamicStrings_String s;
 
   a.array[0] = ch;
@@ -1763,10 +1767,10 @@ extern "C" DynamicStrings_String DynamicStrings_ConCat (DynamicStrings_String a,
 
 extern "C" DynamicStrings_String DynamicStrings_ConCatChar (DynamicStrings_String a, char ch)
 {
-  typedef struct ConCatChar__T5_a ConCatChar__T5;
+  typedef struct ConCatChar__T6_a ConCatChar__T6;
 
-  struct ConCatChar__T5_a { char array[1+1]; };
-  ConCatChar__T5 b;
+  struct ConCatChar__T6_a { char array[1+1]; };
+  ConCatChar__T6 b;
   DynamicStrings_String t;
 
   if (PoisonOn)
@@ -2620,7 +2624,6 @@ extern "C" void DynamicStrings_PopAllocation (bool halt)
 extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e)
 {
   DynamicStrings_String s;
-  DynamicStrings_frame f;
   bool b;
 
   Init ();
@@ -2630,7 +2633,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool hal
       if (frameHead == NULL)
         {
           stop ();
-          M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, (const char *) "PopAllocationExemption", 22, 177);
+          M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, (const char *) "PopAllocationExemption", 22, 174);
         }
       else
         {
diff --git a/gcc/m2/mc-boot/GFIO.cc b/gcc/m2/mc-boot/GFIO.cc
index ce7f0bc7b5c..a3f53626f26 100644
--- a/gcc/m2/mc-boot/GFIO.cc
+++ b/gcc/m2/mc-boot/GFIO.cc
@@ -814,7 +814,6 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
   typedef unsigned char *BufferedRead__T3;
 
   void * t;
-  int result;
   int total;
   int n;
   BufferedRead__T3 p;
@@ -1242,7 +1241,6 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a)
   typedef unsigned char *BufferedWrite__T5;
 
   void * t;
-  int result;
   int total;
   int n;
   BufferedWrite__T5 p;
diff --git a/gcc/m2/mc-boot/GFormatStrings.cc b/gcc/m2/mc-boot/GFormatStrings.cc
index b8d0f922a7a..c8fdefaea00 100644
--- a/gcc/m2/mc-boot/GFormatStrings.cc
+++ b/gcc/m2/mc-boot/GFormatStrings.cc
@@ -370,7 +370,6 @@ static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int
   int width;
   int nextperc;
   int afterperc;
-  int endpos;
   char leader;
   char ch;
   char ch2;
@@ -544,7 +543,6 @@ static DynamicStrings_String Copy (DynamicStrings_String fmt, DynamicStrings_Str
 static DynamicStrings_String HandlePercent (DynamicStrings_String fmt, DynamicStrings_String s, int startpos)
 {
   int prevpos;
-  DynamicStrings_String result;
 
   if ((startpos == ((int ) (DynamicStrings_Length (fmt)))) || (startpos < 0))
     {
diff --git a/gcc/m2/mc-boot/GM2Dependent.cc b/gcc/m2/mc-boot/GM2Dependent.cc
index 23fb28d26a9..1fe5de2c922 100644
--- a/gcc/m2/mc-boot/GM2Dependent.cc
+++ b/gcc/m2/mc-boot/GM2Dependent.cc
@@ -51,7 +51,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define _M2Dependent_C
 
 #   include "Glibc.h"
-#   include "GM2LINK.h"
 #   include "GASCII.h"
 #   include "GSYSTEM.h"
 #   include "GStorage.h"
@@ -62,6 +61,8 @@ typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP;
 
 typedef struct M2Dependent_DependencyList_r M2Dependent_DependencyList;
 
+typedef char *M2Dependent_PtrToChar;
+
 typedef struct M2Dependent__T2_r M2Dependent__T2;
 
 typedef M2Dependent__T2 *M2Dependent_ModuleChain;
@@ -93,6 +94,7 @@ struct M2Dependent__T2_r {
                          };
 
 static M2Dependent__T3 Modules;
+static bool DynamicInitialization;
 static bool Initialized;
 static bool WarningTrace;
 static bool ModuleTrace;
@@ -107,7 +109,7 @@ static bool ForceTrace;
                       module constructor in turn.
 */
 
-extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 
 /*
    DeconstructModules - resolve dependencies and then call each
@@ -127,7 +129,7 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
 /*
    RequestDependant - used to specify that modulename is dependant upon
                       module dependantmodule.  It only takes effect
-                      if we are not using StaticInitialization.
+                      if we are using DynamicInitialization.
 */
 
 extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
@@ -195,20 +197,20 @@ static void toCString (char *str, unsigned int _str_high);
             We cannot use Builtins.def during bootstrap.
 */
 
-static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b);
+static int strcmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b);
 
 /*
    strncmp - return 0 if both strings are equal.
              We cannot use Builtins.def during bootstrap.
 */
 
-static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n);
+static int strncmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b, unsigned int n);
 
 /*
    strlen - returns the length of string.
 */
 
-static int strlen_ (M2LINK_PtrToChar string);
+static int strlen_ (M2Dependent_PtrToChar string);
 
 /*
    traceprintf - wrap printf with a boolean flag.
@@ -294,7 +296,7 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
                        the dynamic ordering with the preference.
 */
 
-static void ForceDependencies (void);
+static void ForceDependencies (void * overrideliborder);
 
 /*
    CheckApplication - check to see that the application is the last entry in the list.
@@ -360,8 +362,6 @@ static void CheckInitialized (void);
 static M2Dependent_ModuleChain CreateModule (void * name, void * libname, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies)
 {
   M2Dependent_ModuleChain mptr;
-  void * p0;
-  void * p1;
 
   Storage_ALLOCATE ((void **) &mptr, sizeof (M2Dependent__T2));
   mptr->name = name;
@@ -503,7 +503,7 @@ static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state,
     {
       ptr = Modules.array[state-M2Dependent_unregistered];
       do {
-        if (((strncmp (reinterpret_cast<M2LINK_PtrToChar> (ptr->name), reinterpret_cast<M2LINK_PtrToChar> (name), max (namelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (ptr->name)))))) == 0) && ((strncmp (reinterpret_cast<M2LINK_PtrToChar> (ptr->libname), reinterpret_cast<M2LINK_PtrToChar> (libname), max (libnamelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (ptr->libname)))))) == 0))
+        if (((strncmp (reinterpret_cast<M2Dependent_PtrToChar> (ptr->name), reinterpret_cast<M2Dependent_PtrToChar> (name), max (namelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (ptr->name)))))) == 0) && ((strncmp (reinterpret_cast<M2Dependent_PtrToChar> (ptr->libname), reinterpret_cast<M2Dependent_PtrToChar> (libname), max (libnamelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (ptr->libname)))))) == 0))
           {
             return ptr;
           }
@@ -523,7 +523,7 @@ static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state,
 
 static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name, void * libname)
 {
-  return LookupModuleN (state, name, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (name))), libname, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (libname))));
+  return LookupModuleN (state, name, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (name))), libname, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (libname))));
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -567,7 +567,7 @@ static void toCString (char *str, unsigned int _str_high)
             We cannot use Builtins.def during bootstrap.
 */
 
-static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b)
+static int strcmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b)
 {
   if ((a != NULL) && (b != NULL))
     {
@@ -600,7 +600,7 @@ static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b)
              We cannot use Builtins.def during bootstrap.
 */
 
-static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n)
+static int strncmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b, unsigned int n)
 {
   if (n == 0)
     {
@@ -637,7 +637,7 @@ static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n)
    strlen - returns the length of string.
 */
 
-static int strlen_ (M2LINK_PtrToChar string)
+static int strlen_ (M2Dependent_PtrToChar string)
 {
   int count;
 
@@ -910,8 +910,6 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de
 
 static void DumpModuleData (bool flag)
 {
-  M2Dependent_ModuleChain mptr;
-
   if (flag)
     {
       DisplayModuleInfo (M2Dependent_unregistered, (const char *) "unregistered", 12);
@@ -993,20 +991,20 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
                        the dynamic ordering with the preference.
 */
 
-static void ForceDependencies (void)
+static void ForceDependencies (void * overrideliborder)
 {
   unsigned int len;
   unsigned int modlen;
   unsigned int liblen;
-  M2LINK_PtrToChar modname;
-  M2LINK_PtrToChar libname;
-  M2LINK_PtrToChar pc;
-  M2LINK_PtrToChar start;
+  M2Dependent_PtrToChar modname;
+  M2Dependent_PtrToChar libname;
+  M2Dependent_PtrToChar pc;
+  M2Dependent_PtrToChar start;
 
-  if (M2LINK_ForcedModuleInitOrder != NULL)
+  if (overrideliborder != NULL)
     {
-      traceprintf2 (ForceTrace, (const char *) "user forcing order: %s\\n", 24, reinterpret_cast<void *> (M2LINK_ForcedModuleInitOrder));
-      pc = M2LINK_ForcedModuleInitOrder;
+      traceprintf2 (ForceTrace, (const char *) "user forcing order: %s\\n", 24, overrideliborder);
+      pc = static_cast<M2Dependent_PtrToChar> (overrideliborder);
       start = pc;
       len = 0;
       modname = NULL;
@@ -1123,7 +1121,7 @@ static bool equal (void * cstr, const char *str_, unsigned int _str_high)
   /* make a local copy of each unbounded array.  */
   memcpy (str, str_, _str_high+1);
 
-  return (strncmp (reinterpret_cast<M2LINK_PtrToChar> (cstr), reinterpret_cast<M2LINK_PtrToChar> (&str), StrLib_StrLen ((const char *) str, _str_high))) == 0;
+  return (strncmp (reinterpret_cast<M2Dependent_PtrToChar> (cstr), reinterpret_cast<M2Dependent_PtrToChar> (&str), StrLib_StrLen ((const char *) str, _str_high))) == 0;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1239,6 +1237,7 @@ static void Init (void)
     {
       Modules.array[state-M2Dependent_unregistered] = NULL;
     }
+  DynamicInitialization = false;
 }
 
 
@@ -1264,13 +1263,13 @@ static void CheckInitialized (void)
                       module constructor in turn.
 */
 
-extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp)
+extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp)
 {
   M2Dependent_ModuleChain mptr;
-  M2Dependent_ArgCVEnvP nulp;
 
   CheckInitialized ();
-  traceprintf3 (ModuleTrace, (const char *) "application module: %s [%s]\\n", 29, applicationmodule, libname);
+  DynamicInitialization = true;  /* This procedure is only called if we desire dynamic initialization.  */
+  traceprintf3 (ModuleTrace, (const char *) "application module: %s [%s]\\n", 29, applicationmodule, libname);  /* This procedure is only called if we desire dynamic initialization.  */
   mptr = LookupModule (M2Dependent_unordered, applicationmodule, libname);
   if (mptr != NULL)
     {
@@ -1281,7 +1280,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * l
   ResolveDependencies (applicationmodule, libname);
   traceprintf (PreTrace, (const char *) "Post resolving dependents\\n", 27);
   DumpModuleData (PostTrace);
-  ForceDependencies ();
+  ForceDependencies (overrideliborder);
   traceprintf (ForceTrace, (const char *) "After user forcing ordering\\n", 29);
   DumpModuleData (ForceTrace);
   CheckApplication ();
@@ -1366,19 +1365,16 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
   M2Dependent_ModuleChain mptr;
 
   CheckInitialized ();
-  if (! M2LINK_StaticInitialization)
+  mptr = LookupModule (M2Dependent_unordered, modulename, libname);
+  if (mptr == NULL)
     {
-      mptr = LookupModule (M2Dependent_unordered, modulename, libname);
-      if (mptr == NULL)
-        {
-          traceprintf3 (ModuleTrace, (const char *) "module: %s [%s] registering", 27, modulename, libname);
-          moveTo (M2Dependent_unordered, CreateModule (modulename, libname, init, fini, dependencies));
-          traceprintf (ModuleTrace, (const char *) "\\n", 2);
-        }
-      else
-        {
-          warning3 ((const char *) "module: %s [%s] (ignoring duplicate registration)\\n", 51, modulename, libname);
-        }
+      traceprintf3 (ModuleTrace, (const char *) "module: %s [%s] registering", 27, modulename, libname);
+      moveTo (M2Dependent_unordered, CreateModule (modulename, libname, init, fini, dependencies));
+      traceprintf (ModuleTrace, (const char *) "\\n", 2);
+    }
+  else
+    {
+      warning3 ((const char *) "module: %s [%s] (ignoring duplicate registration)\\n", 51, modulename, libname);
     }
 }
 
@@ -1386,16 +1382,13 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
 /*
    RequestDependant - used to specify that modulename is dependant upon
                       module dependantmodule.  It only takes effect
-                      if we are not using StaticInitialization.
+                      if we are using DynamicInitialization.
 */
 
 extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname)
 {
   CheckInitialized ();
-  if (! M2LINK_StaticInitialization)
-    {
-      PerformRequestDependant (modulename, libname, dependantmodule, dependantlibname);
-    }
+  PerformRequestDependant (modulename, libname, dependantmodule, dependantlibname);
 }
 
 extern "C" void _M2_M2Dependent_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
diff --git a/gcc/m2/mc-boot/GM2Dependent.h b/gcc/m2/mc-boot/GM2Dependent.h
index a26f957bccb..caa49e754c6 100644
--- a/gcc/m2/mc-boot/GM2Dependent.h
+++ b/gcc/m2/mc-boot/GM2Dependent.h
@@ -54,7 +54,7 @@ typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP;
 typedef void (*M2Dependent_ArgCVEnvP_t) (int, void *, void *);
 struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; };
 
-EXTERN void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+EXTERN void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 EXTERN void M2Dependent_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
 
 /*
diff --git a/gcc/m2/mc-boot/GM2LINK.h b/gcc/m2/mc-boot/GM2LINK.h
deleted file mode 100644
index edbcc9c5ae8..00000000000
--- a/gcc/m2/mc-boot/GM2LINK.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* do not edit automatically generated by mc from M2LINK.  */
-/* M2LINK.def defines the linking mode used in Modula-2.
-
-Copyright (C) 2022-2023 Free Software Foundation, Inc.
-Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
-
-This file is part of GNU Modula-2.
-
-GNU Modula-2 is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU Modula-2 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-
-#if !defined (_M2LINK_H)
-#   define _M2LINK_H
-
-#include "config.h"
-#include "system.h"
-#   ifdef __cplusplus
-extern "C" {
-#   endif
-#include <stdbool.h>
-#   if !defined (PROC_D)
-#      define PROC_D
-       typedef void (*PROC_t) (void);
-       typedef struct { PROC_t proc; } PROC;
-#   endif
-
-
-#   if defined (_M2LINK_C)
-#      define EXTERN
-#   else
-#      define EXTERN extern
-#   endif
-
-typedef char *M2LINK_PtrToChar;
-
-EXTERN M2LINK_PtrToChar M2LINK_ForcedModuleInitOrder;
-EXTERN bool M2LINK_StaticInitialization;
-#   ifdef __cplusplus
-}
-#   endif
-
-#   undef EXTERN
-#endif
diff --git a/gcc/m2/mc-boot/GM2RTS.cc b/gcc/m2/mc-boot/GM2RTS.cc
index cc3f559d3a2..dd04dcdcc6d 100644
--- a/gcc/m2/mc-boot/GM2RTS.cc
+++ b/gcc/m2/mc-boot/GM2RTS.cc
@@ -97,7 +97,7 @@ static bool Initialized;
                       module constructor in turn.
 */
 
-extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 
 /*
    DeconstructModules - resolve dependencies and then call each
@@ -435,9 +435,9 @@ static void CheckInitialized (void)
                       module constructor in turn.
 */
 
-extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp)
+extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp)
 {
-  M2Dependent_ConstructModules (applicationmodule, libname, argc, argv, envp);
+  M2Dependent_ConstructModules (applicationmodule, libname, overrideliborder, argc, argv, envp);
 }
 
 
diff --git a/gcc/m2/mc-boot/GM2RTS.h b/gcc/m2/mc-boot/GM2RTS.h
index 8d2387683c4..d9acb54dd6c 100644
--- a/gcc/m2/mc-boot/GM2RTS.h
+++ b/gcc/m2/mc-boot/GM2RTS.h
@@ -54,7 +54,7 @@ typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP;
 typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *);
 struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; };
 
-EXTERN void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+EXTERN void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 EXTERN void M2RTS_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
 
 /*
diff --git a/gcc/m2/mc-boot/GRTExceptions.cc b/gcc/m2/mc-boot/GRTExceptions.cc
index 2986aad4936..15ff0949060 100644
--- a/gcc/m2/mc-boot/GRTExceptions.cc
+++ b/gcc/m2/mc-boot/GRTExceptions.cc
@@ -1075,7 +1075,6 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n
 extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int number)
 {
   RTExceptions_Handler h;
-  RTExceptions_Handler i;
 
   h = findHandler (e, number);
   if (h != NULL)
diff --git a/gcc/m2/mc-boot/GRTint.cc b/gcc/m2/mc-boot/GRTint.cc
index d44db637ba5..e8f4bc46a6c 100644
--- a/gcc/m2/mc-boot/GRTint.cc
+++ b/gcc/m2/mc-boot/GRTint.cc
@@ -934,10 +934,6 @@ extern "C" void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, un
   RTint_Vector vec;
   Selective_SetOfFd inSet;
   Selective_SetOfFd outSet;
-  unsigned int b4s;
-  unsigned int b4m;
-  unsigned int afs;
-  unsigned int afm;
   unsigned int sec;
   unsigned int micro;
   int maxFd;
@@ -1001,7 +997,7 @@ extern "C" void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, un
         }
       if (((untilInterrupt && (inSet == NULL)) && (outSet == NULL)) && ! found)
         {
-          M2RTS_Halt ((const char *) "deadlock found, no more processes to run and no interrupts active", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "Listen", 6, 732);
+          M2RTS_Halt ((const char *) "deadlock found, no more processes to run and no interrupts active", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "Listen", 6, 728);
         }
       /* printf('}
       ') ;  */
diff --git a/gcc/m2/mc-boot/GSFIO.cc b/gcc/m2/mc-boot/GSFIO.cc
index 43be478c506..50ed65b1780 100644
--- a/gcc/m2/mc-boot/GSFIO.cc
+++ b/gcc/m2/mc-boot/GSFIO.cc
@@ -190,7 +190,6 @@ extern "C" DynamicStrings_String SFIO_WriteS (FIO_File file, DynamicStrings_Stri
 extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file)
 {
   DynamicStrings_String s;
-  unsigned int c;
 
   s = DynamicStrings_InitString ((const char *) "", 0);
   while (((! (FIO_EOLN (file))) && (! (FIO_EOF (file)))) && (FIO_IsNoError (file)))
diff --git a/gcc/m2/mc-boot/GStringConvert.cc b/gcc/m2/mc-boot/GStringConvert.cc
index f3696607abe..123fd492bb2 100644
--- a/gcc/m2/mc-boot/GStringConvert.cc
+++ b/gcc/m2/mc-boot/GStringConvert.cc
@@ -770,8 +770,6 @@ static DynamicStrings_String doDecimalPlaces (DynamicStrings_String s, unsigned
   int l;
   int point;
   DynamicStrings_String t;
-  DynamicStrings_String whole;
-  DynamicStrings_String fraction;
   DynamicStrings_String tenths;
   DynamicStrings_String hundreths;
 
@@ -1917,7 +1915,7 @@ extern "C" DynamicStrings_String StringConvert_ToSigFig (DynamicStrings_String s
   int point;
   unsigned int poTen;
 
-  Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1222, (const char *) "ToSigFig", 8);
+  Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1220, (const char *) "ToSigFig", 8);
   point = DynamicStrings_Index (s, '.', 0);
   if (point < 0)
     {
diff --git a/gcc/m2/mc-boot/Gdecl.cc b/gcc/m2/mc-boot/Gdecl.cc
index 21949b3fa69..72acd827876 100644
--- a/gcc/m2/mc-boot/Gdecl.cc
+++ b/gcc/m2/mc-boot/Gdecl.cc
@@ -1028,7 +1028,7 @@ extern "C" void SYSTEM_ShiftRight (unsigned int *s, unsigned int _s_high, unsign
 extern "C" void SYSTEM_RotateVal (unsigned int *s, unsigned int _s_high, unsigned int *d, unsigned int _d_high, unsigned int SetSizeInBits, int RotateCount);
 extern "C" void SYSTEM_RotateLeft (unsigned int *s, unsigned int _s_high, unsigned int *d, unsigned int _d_high, unsigned int SetSizeInBits, unsigned int RotateCount);
 extern "C" void SYSTEM_RotateRight (unsigned int *s, unsigned int _s_high, unsigned int *d, unsigned int _d_high, unsigned int SetSizeInBits, unsigned int RotateCount);
-extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 extern "C" void M2RTS_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
 extern "C" void M2RTS_RegisterModule (void * name, void * libname, M2RTS_ArgCVEnvP init, M2RTS_ArgCVEnvP fini, PROC dependencies);
 extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
diff --git a/gcc/m2/pge-boot/GASCII.cc b/gcc/m2/pge-boot/GASCII.cc
index 077cdffb613..64dcb5a8420 100644
--- a/gcc/m2/pge-boot/GASCII.cc
+++ b/gcc/m2/pge-boot/GASCII.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GASCII.h b/gcc/m2/pge-boot/GASCII.h
index b5091fd6df7..952fbf3b228 100644
--- a/gcc/m2/pge-boot/GASCII.h
+++ b/gcc/m2/pge-boot/GASCII.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GArgs.cc b/gcc/m2/pge-boot/GArgs.cc
index 819a46f2806..badd1fc2820 100644
--- a/gcc/m2/pge-boot/GArgs.cc
+++ b/gcc/m2/pge-boot/GArgs.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -54,7 +55,7 @@ static Args__T1 Source;
             The success of the operation is returned.
 */
 
-extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
+extern "C" bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
 
 /*
    Narg - returns the number of arguments available from
@@ -69,7 +70,7 @@ extern "C" unsigned int Args_Narg (void);
             The success of the operation is returned.
 */
 
-extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n)
+extern "C" bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n)
 {
   int i;
   unsigned int High;
diff --git a/gcc/m2/pge-boot/GArgs.h b/gcc/m2/pge-boot/GArgs.h
index d7c93ea80b8..9866f432fd6 100644
--- a/gcc/m2/pge-boot/GArgs.h
+++ b/gcc/m2/pge-boot/GArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
             The success of the operation is returned.
 */
 
-EXTERN unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
+EXTERN bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
 
 /*
    Narg - returns the number of arguments available from
diff --git a/gcc/m2/pge-boot/GAssertion.cc b/gcc/m2/pge-boot/GAssertion.cc
index 5088db4068d..9d4486a7679 100644
--- a/gcc/m2/pge-boot/GAssertion.cc
+++ b/gcc/m2/pge-boot/GAssertion.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -42,14 +43,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    Assert - tests the boolean Condition, if it fails then HALT is called.
 */
 
-extern "C" void Assertion_Assert (unsigned int Condition);
+extern "C" void Assertion_Assert (bool Condition);
 
 
 /*
    Assert - tests the boolean Condition, if it fails then HALT is called.
 */
 
-extern "C" void Assertion_Assert (unsigned int Condition)
+extern "C" void Assertion_Assert (bool Condition)
 {
   if (! Condition)
     {
diff --git a/gcc/m2/pge-boot/GAssertion.h b/gcc/m2/pge-boot/GAssertion.h
index f983353dcee..0e0af34d8ce 100644
--- a/gcc/m2/pge-boot/GAssertion.h
+++ b/gcc/m2/pge-boot/GAssertion.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
             is called.
 */
 
-EXTERN void Assertion_Assert (unsigned int Condition);
+EXTERN void Assertion_Assert (bool Condition);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GBreak.h b/gcc/m2/pge-boot/GBreak.h
index 397328c5286..328bc8bd423 100644
--- a/gcc/m2/pge-boot/GBreak.h
+++ b/gcc/m2/pge-boot/GBreak.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GCmdArgs.h b/gcc/m2/pge-boot/GCmdArgs.h
index f35ef0daa4d..65668aa0a96 100644
--- a/gcc/m2/pge-boot/GCmdArgs.h
+++ b/gcc/m2/pge-boot/GCmdArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
             the success of the operation is returned.
 */
 
-EXTERN unsigned int CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
+EXTERN bool CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
 
 /*
    Narg - returns the number of arguments available from
diff --git a/gcc/m2/pge-boot/GDebug.cc b/gcc/m2/pge-boot/GDebug.cc
index 431068492ee..df4a0e45fb0 100644
--- a/gcc/m2/pge-boot/GDebug.cc
+++ b/gcc/m2/pge-boot/GDebug.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -46,12 +47,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 /*
    Halt - writes a message in the format:
-          Module:Line:Message
+          Module:Function:Line:Message
 
           It then terminates by calling HALT.
 */
 
-extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high);
+extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, const char *Module_, unsigned int _Module_high, const char *Function_, unsigned int _Function_high, unsigned int LineNo);
 
 /*
    DebugString - writes a string to the debugging device (Scn.Write).
@@ -83,12 +84,12 @@ static void WriteLn (void)
 
 /*
    Halt - writes a message in the format:
-          Module:Line:Message
+          Module:Function:Line:Message
 
           It then terminates by calling HALT.
 */
 
-extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high)
+extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, const char *Module_, unsigned int _Module_high, const char *Function_, unsigned int _Function_high, unsigned int LineNo)
 {
   typedef struct Halt__T1_a Halt__T1;
 
@@ -96,12 +97,17 @@ extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, un
   Halt__T1 No;
   char Message[_Message_high+1];
   char Module[_Module_high+1];
+  char Function[_Function_high+1];
 
   /* make a local copy of each unbounded array.  */
   memcpy (Message, Message_, _Message_high+1);
   memcpy (Module, Module_, _Module_high+1);
+  memcpy (Function, Function_, _Function_high+1);
 
   Debug_DebugString ((const char *) Module, _Module_high);  /* should be large enough for most source files..  */
+  Debug_DebugString ((const char *) ":", 1);
+  Debug_DebugString ((const char *) Function, _Function_high);
+  Debug_DebugString ((const char *) ":", 1);
   NumberIO_CardToStr (LineNo, 0, (char *) &No.array[0], MaxNoOfDigits);
   Debug_DebugString ((const char *) ":", 1);
   Debug_DebugString ((const char *) &No.array[0], MaxNoOfDigits);
diff --git a/gcc/m2/pge-boot/GDebug.h b/gcc/m2/pge-boot/GDebug.h
index ed509a27a24..8ec800c94fc 100644
--- a/gcc/m2/pge-boot/GDebug.h
+++ b/gcc/m2/pge-boot/GDebug.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -50,12 +51,12 @@ extern "C" {
 
 /*
    Halt - writes a message in the format:
-          Module:Line:Message
+          Module:Function:Line:Message
 
           It then terminates by calling HALT.
 */
 
-EXTERN void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high);
+EXTERN void Debug_Halt (const char *Message_, unsigned int _Message_high, const char *Module_, unsigned int _Module_high, const char *Function_, unsigned int _Function_high, unsigned int LineNo);
 
 /*
    DebugString - writes a string to the debugging device (Scn.Write).
diff --git a/gcc/m2/pge-boot/GDynamicStrings.cc b/gcc/m2/pge-boot/GDynamicStrings.cc
index 2dd4985b47e..dacf2d4a169 100644
--- a/gcc/m2/pge-boot/GDynamicStrings.cc
+++ b/gcc/m2/pge-boot/GDynamicStrings.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -61,10 +62,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   include "GM2RTS.h"
 
 #   define MaxBuf 127
-#   define PoisonOn FALSE
-#   define DebugOn FALSE
-#   define CheckOn FALSE
-#   define TraceOn FALSE
+#   define PoisonOn false
+#   define DebugOn false
+#   define CheckOn false
+#   define TraceOn false
 typedef struct DynamicStrings_Contents_r DynamicStrings_Contents;
 
 typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo;
@@ -93,10 +94,10 @@ struct DynamicStrings_DebugInfo_r {
                                   };
 
 struct DynamicStrings_descriptor_r {
-                                     unsigned int charStarUsed;
+                                     bool charStarUsed;
                                      void *charStar;
                                      unsigned int charStarSize;
-                                     unsigned int charStarValid;
+                                     bool charStarValid;
                                      DynamicStrings_desState state;
                                      DynamicStrings_String garbage;
                                    };
@@ -120,7 +121,7 @@ struct DynamicStrings_stringRecord_r {
                                        DynamicStrings_DebugInfo debug;
                                      };
 
-static unsigned int Initialized;
+static bool Initialized;
 static DynamicStrings_frame frameHead;
 static DynamicStrings_String captured;
 
@@ -205,21 +206,21 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy
    Equal - returns TRUE if String, a, and, b, are equal.
 */
 
-extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
+extern "C" bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
 
 /*
    EqualCharStar - returns TRUE if contents of String, s, is the same as the
                    string, a.
 */
 
-extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
+extern "C" bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
 
 /*
    EqualArray - returns TRUE if contents of String, s, is the same as the
                 string, a.
 */
 
-extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
+extern "C" bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
 
 /*
    Mult - returns a new string which is n concatenations of String, s.
@@ -366,19 +367,19 @@ extern "C" void DynamicStrings_PushAllocation (void);
                    with an exit code of 1.
 */
 
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt);
+extern "C" void DynamicStrings_PopAllocation (bool halt);
 
 /*
    PopAllocationExemption - test to see that all strings are deallocated, except
-                            string, e, since the last push.
-                            Then it pops to the previous allocation/deallocation
+                            string e since the last push.
+                            Post-condition: it pops to the previous allocation/deallocation
                             lists.
 
                             If halt is true then the application terminates
                             with an exit code of 1.
 */
 
-extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e);
+extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e);
 
 /*
  writeStringDesc write out debugging information about string, s.  */
@@ -465,7 +466,7 @@ static void writeCard (unsigned int c);
 static void writeLongcard (long unsigned int l);
 
 /*
-   writeAddress -
+   writeAddress - writes out the address of a with a C style hex prefix.
 */
 
 static void writeAddress (void * a);
@@ -486,7 +487,7 @@ static DynamicStrings_String AssignDebug (DynamicStrings_String s, const char *f
    IsOn - returns TRUE if, s, is on one of the debug lists.
 */
 
-static unsigned int IsOn (DynamicStrings_String list, DynamicStrings_String s);
+static bool IsOn (DynamicStrings_String list, DynamicStrings_String s);
 
 /*
    AddTo - adds string, s, to, list.
@@ -516,13 +517,13 @@ static void AddDeallocated (DynamicStrings_String s);
    IsOnAllocated - returns TRUE if the string, s, has ever been allocated.
 */
 
-static unsigned int IsOnAllocated (DynamicStrings_String s);
+static bool IsOnAllocated (DynamicStrings_String s);
 
 /*
    IsOnDeallocated - returns TRUE if the string, s, has ever been deallocated.
 */
 
-static unsigned int IsOnDeallocated (DynamicStrings_String s);
+static bool IsOnDeallocated (DynamicStrings_String s);
 
 /*
    SubAllocated - removes string, s, from the list of allocated strings.
@@ -592,13 +593,13 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin
    IsOnGarbage - returns TRUE if, s, is on string, e, garbage list.
 */
 
-static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s);
+static bool IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s);
 
 /*
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
 
 /*
    DumpState -
@@ -686,8 +687,6 @@ static void writeNspace (unsigned int n)
 
 static void DumpStringInfo (DynamicStrings_String s, unsigned int i)
 {
-  DynamicStrings_String t;
-
   if (s != NULL)
     {
       writeNspace (i);
@@ -738,7 +737,7 @@ static void doDSdbExit (DynamicStrings_String s)
 {
   if (CheckOn)
     {
-      s = DynamicStrings_PopAllocationExemption (TRUE, s);
+      s = DynamicStrings_PopAllocationExemption (true, s);
     }
 }
 
@@ -903,12 +902,18 @@ static void writeLongcard (long unsigned int l)
 
 
 /*
-   writeAddress -
+   writeAddress - writes out the address of a with a C style hex prefix.
 */
 
 static void writeAddress (void * a)
 {
-  writeLongcard ((long unsigned int ) (a));
+  typedef struct writeAddress__T4_a writeAddress__T4;
+
+  struct writeAddress__T4_a { char array[30+1]; };
+  writeAddress__T4 buffer;
+
+  libc_snprintf (&buffer, static_cast<size_t> (sizeof (buffer)), (const char *) "0x%", 3, a);
+  writeString ((const char *) &buffer.array[0], 30);
 }
 
 
@@ -960,7 +965,7 @@ static DynamicStrings_String AssignDebug (DynamicStrings_String s, const char *f
    IsOn - returns TRUE if, s, is on one of the debug lists.
 */
 
-static unsigned int IsOn (DynamicStrings_String list, DynamicStrings_String s)
+static bool IsOn (DynamicStrings_String list, DynamicStrings_String s)
 {
   while ((list != s) && (list != NULL))
     {
@@ -1050,7 +1055,7 @@ static void AddDeallocated (DynamicStrings_String s)
    IsOnAllocated - returns TRUE if the string, s, has ever been allocated.
 */
 
-static unsigned int IsOnAllocated (DynamicStrings_String s)
+static bool IsOnAllocated (DynamicStrings_String s)
 {
   DynamicStrings_frame f;
 
@@ -1059,14 +1064,14 @@ static unsigned int IsOnAllocated (DynamicStrings_String s)
   do {
     if (IsOn (f->alloc, s))
       {
-        return TRUE;
+        return true;
       }
     else
       {
         f = f->next;
       }
   } while (! (f == NULL));
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1076,7 +1081,7 @@ static unsigned int IsOnAllocated (DynamicStrings_String s)
    IsOnDeallocated - returns TRUE if the string, s, has ever been deallocated.
 */
 
-static unsigned int IsOnDeallocated (DynamicStrings_String s)
+static bool IsOnDeallocated (DynamicStrings_String s)
 {
   DynamicStrings_frame f;
 
@@ -1085,14 +1090,14 @@ static unsigned int IsOnDeallocated (DynamicStrings_String s)
   do {
     if (IsOn (f->dealloc, s))
       {
-        return TRUE;
+        return true;
       }
     else
       {
         f = f->next;
       }
   } while (! (f == NULL));
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1238,10 +1243,10 @@ static void DeallocateCharStar (DynamicStrings_String s)
         {
           Storage_DEALLOCATE (&s->head->charStar, s->head->charStarSize);
         }
-      s->head->charStarUsed = FALSE;
+      s->head->charStarUsed = false;
       s->head->charStar = NULL;
       s->head->charStarSize = 0;
-      s->head->charStarValid = FALSE;
+      s->head->charStarValid = false;
     }
 }
 
@@ -1275,7 +1280,7 @@ static void MarkInvalid (DynamicStrings_String s)
     }
   if (s->head != NULL)
     {
-      s->head->charStarValid = FALSE;
+      s->head->charStarValid = false;
     }
 }
 
@@ -1371,7 +1376,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin
    IsOnGarbage - returns TRUE if, s, is on string, e, garbage list.
 */
 
-static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s)
+static bool IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s)
 {
   if ((e != NULL) && (s != NULL))
     {
@@ -1379,7 +1384,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
         {
           if (e->head->garbage == s)
             {
-              return TRUE;
+              return true;
             }
           else
             {
@@ -1387,7 +1392,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
             }
         }
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1397,7 +1402,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
 {
   return (ch == ' ') || (ch == ASCII_tab);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -1506,7 +1511,7 @@ static void Init (void)
 {
   if (! Initialized)
     {
-      Initialized = TRUE;
+      Initialized = true;
       frameHead = NULL;
       DynamicStrings_PushAllocation ();
     }
@@ -1531,10 +1536,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi
   s->contents.next = NULL;
   ConcatContents (&s->contents, (const char *) a, _a_high, StrLib_StrLen ((const char *) a, _a_high), 0);
   Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor));
-  s->head->charStarUsed = FALSE;
+  s->head->charStarUsed = false;
   s->head->charStar = NULL;
   s->head->charStarSize = 0;
-  s->head->charStarValid = FALSE;
+  s->head->charStarValid = false;
   s->head->garbage = NULL;
   s->head->state = DynamicStrings_inuse;
   AddDebugInfo (s);
@@ -1634,10 +1639,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a)
       ConcatContentsAddress (&s->contents, a, static_cast<unsigned int> (libc_strlen (a)));
     }
   Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor));
-  s->head->charStarUsed = FALSE;
+  s->head->charStarUsed = false;
   s->head->charStar = NULL;
   s->head->charStarSize = 0;
-  s->head->charStarValid = FALSE;
+  s->head->charStarValid = false;
   s->head->garbage = NULL;
   s->head->state = DynamicStrings_inuse;
   AddDebugInfo (s);
@@ -1657,10 +1662,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a)
 
 extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch)
 {
-  typedef struct InitStringChar__T4_a InitStringChar__T4;
+  typedef struct InitStringChar__T5_a InitStringChar__T5;
 
-  struct InitStringChar__T4_a { char array[1+1]; };
-  InitStringChar__T4 a;
+  struct InitStringChar__T5_a { char array[1+1]; };
+  InitStringChar__T5 a;
   DynamicStrings_String s;
 
   a.array[0] = ch;
@@ -1765,10 +1770,10 @@ extern "C" DynamicStrings_String DynamicStrings_ConCat (DynamicStrings_String a,
 
 extern "C" DynamicStrings_String DynamicStrings_ConCatChar (DynamicStrings_String a, char ch)
 {
-  typedef struct ConCatChar__T5_a ConCatChar__T5;
+  typedef struct ConCatChar__T6_a ConCatChar__T6;
 
-  struct ConCatChar__T5_a { char array[1+1]; };
-  ConCatChar__T5 b;
+  struct ConCatChar__T6_a { char array[1+1]; };
+  ConCatChar__T6 b;
   DynamicStrings_String t;
 
   if (PoisonOn)
@@ -1860,7 +1865,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy
    Equal - returns TRUE if String, a, and, b, are equal.
 */
 
-extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b)
+extern "C" bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b)
 {
   unsigned int i;
 
@@ -1879,18 +1884,18 @@ extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicSt
             {
               if (a->contents.buf.array[i] != b->contents.buf.array[i])
                 {
-                  return FALSE;
+                  return false;
                 }
               i += 1;
             }
           a = a->contents.next;
           b = b->contents.next;
         }
-      return TRUE;
+      return true;
     }
   else
     {
-      return FALSE;
+      return false;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -1902,7 +1907,7 @@ extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicSt
                    string, a.
 */
 
-extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a)
+extern "C" bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a)
 {
   DynamicStrings_String t;
 
@@ -1919,12 +1924,12 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v
   if (DynamicStrings_Equal (t, s))
     {
       t = DynamicStrings_KillString (t);
-      return TRUE;
+      return true;
     }
   else
     {
       t = DynamicStrings_KillString (t);
-      return FALSE;
+      return false;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -1936,7 +1941,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v
                 string, a.
 */
 
-extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high)
+extern "C" bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high)
 {
   DynamicStrings_String t;
   char a[_a_high+1];
@@ -1957,12 +1962,12 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons
   if (DynamicStrings_Equal (t, s))
     {
       t = DynamicStrings_KillString (t);
-      return TRUE;
+      return true;
     }
   else
     {
       t = DynamicStrings_KillString (t);
-      return FALSE;
+      return false;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -2438,7 +2443,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s)
               DeallocateCharStar (s);
               Storage_ALLOCATE (&s->head->charStar, l+1);
               s->head->charStarSize = l+1;
-              s->head->charStarUsed = TRUE;
+              s->head->charStarUsed = true;
             }
           p = static_cast<string__T2> (s->head->charStar);
           a = s;
@@ -2454,7 +2459,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s)
               a = a->contents.next;
             }
           (*p) = ASCII_nul;
-          s->head->charStarValid = TRUE;
+          s->head->charStarValid = true;
         }
       return s->head->charStar;
     }
@@ -2599,7 +2604,7 @@ extern "C" void DynamicStrings_PushAllocation (void)
                    with an exit code of 1.
 */
 
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt)
+extern "C" void DynamicStrings_PopAllocation (bool halt)
 {
   if (CheckOn)
     {
@@ -2611,19 +2616,18 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt)
 
 /*
    PopAllocationExemption - test to see that all strings are deallocated, except
-                            string, e, since the last push.
-                            Then it pops to the previous allocation/deallocation
+                            string e since the last push.
+                            Post-condition: it pops to the previous allocation/deallocation
                             lists.
 
                             If halt is true then the application terminates
                             with an exit code of 1.
 */
 
-extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e)
+extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e)
 {
   DynamicStrings_String s;
-  DynamicStrings_frame f;
-  unsigned int b;
+  bool b;
 
   Init ();
   if (CheckOn)
@@ -2632,14 +2636,14 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
       if (frameHead == NULL)
         {
           stop ();
-          /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's")  */
-          M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65);
+          M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, (const char *) "PopAllocationExemption", 22, 174);
         }
       else
         {
+          /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's")  */
           if (frameHead->alloc != NULL)
             {
-              b = FALSE;
+              b = false;
               s = frameHead->alloc;
               while (s != NULL)
                 {
@@ -2649,7 +2653,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
                         {
                           writeString ((const char *) "the following strings have been lost", 36);
                           writeLn ();
-                          b = TRUE;
+                          b = true;
                         }
                       DumpStringInfo (s, 0);
                     }
@@ -2670,7 +2674,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
 
 extern "C" void _M2_DynamicStrings_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
 {
-  Initialized = FALSE;
+  Initialized = false;
   Init ();
 }
 
diff --git a/gcc/m2/pge-boot/GDynamicStrings.h b/gcc/m2/pge-boot/GDynamicStrings.h
index c602ebc74e0..d20d618ec9f 100644
--- a/gcc/m2/pge-boot/GDynamicStrings.h
+++ b/gcc/m2/pge-boot/GDynamicStrings.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -139,21 +140,21 @@ EXTERN DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dynami
    Equal - returns TRUE if String, a, and, b, are equal.
 */
 
-EXTERN unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
+EXTERN bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
 
 /*
    EqualCharStar - returns TRUE if contents of String, s, is
                    the same as the string, a.
 */
 
-EXTERN unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
+EXTERN bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
 
 /*
    EqualArray - returns TRUE if contents of String, s, is the
                 same as the string, a.
 */
 
-EXTERN unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
+EXTERN bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
 
 /*
    Mult - returns a new string which is n concatenations of String, s.
@@ -310,13 +311,13 @@ EXTERN void DynamicStrings_PushAllocation (void);
                    with an exit code of 1.
 */
 
-EXTERN void DynamicStrings_PopAllocation (unsigned int halt);
+EXTERN void DynamicStrings_PopAllocation (bool halt);
 
 /*
    PopAllocationExemption - test to see that all strings are
-                            deallocated, except string, e, since
+                            deallocated, except string e since
                             the last push.
-                            Then it pops to the previous
+                            Post-condition: it pops to the previous
                             allocation/deallocation lists.
 
                             If halt is true then the application
@@ -325,7 +326,7 @@ EXTERN void DynamicStrings_PopAllocation (unsigned int halt);
                             The string, e, is returned unmodified,
 */
 
-EXTERN DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e);
+EXTERN DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GEnvironment.h b/gcc/m2/pge-boot/GEnvironment.h
index 82501c41608..d0b44d19d9d 100644
--- a/gcc/m2/pge-boot/GEnvironment.h
+++ b/gcc/m2/pge-boot/GEnvironment.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -55,7 +56,7 @@ extern "C" {
                     the processes environment.
 */
 
-EXTERN unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
+EXTERN bool Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
 
 /*
    PutEnvironment - change or add an environment variable definition
@@ -64,7 +65,7 @@ EXTERN unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _
                     set or changed successfully.
 */
 
-EXTERN unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
+EXTERN bool Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GFIO.cc b/gcc/m2/pge-boot/GFIO.cc
index 848860781aa..34771b6277e 100644
--- a/gcc/m2/pge-boot/GFIO.cc
+++ b/gcc/m2/pge-boot/GFIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -98,7 +99,7 @@ struct FIO_NameInfo_r {
                       };
 
 struct FIO_buf_r {
-                   unsigned int valid;
+                   bool valid;
                    long int bufstart;
                    unsigned int position;
                    void *address;
@@ -114,7 +115,7 @@ struct FIO_fds_r {
                    FIO_NameInfo name;
                    FIO_FileStatus state;
                    FIO_FileUsage usage;
-                   unsigned int output;
+                   bool output;
                    FIO_Buffer buffer;
                    long int abspos;
                  };
@@ -126,17 +127,17 @@ static FIO_File Error;
    IsNoError - returns a TRUE if no error has occured on file, f.
 */
 
-extern "C" unsigned int FIO_IsNoError (FIO_File f);
+extern "C" bool FIO_IsNoError (FIO_File f);
 
 /*
    IsActive - returns TRUE if the file, f, is still active.
 */
 
-extern "C" unsigned int FIO_IsActive (FIO_File f);
-extern "C" unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high);
+extern "C" bool FIO_IsActive (FIO_File f);
+extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high);
 extern "C" FIO_File FIO_OpenToRead (const char *fname_, unsigned int _fname_high);
 extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_high);
-extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile);
 
 /*
    Close - close a file which has been previously opened using:
@@ -150,7 +151,7 @@ extern "C" void FIO_Close (FIO_File f);
    exists - returns TRUE if a file named, fname exists for reading.
 */
 
-extern "C" unsigned int FIO_exists (void * fname, unsigned int flength);
+extern "C" bool FIO_exists (void * fname, unsigned int flength);
 
 /*
    openToRead - attempts to open a file, fname, for reading and
@@ -179,7 +180,7 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength);
                    opened for writing or reading.
 */
 
-extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile);
 
 /*
    FlushBuffer - flush contents of file, f.
@@ -232,20 +233,20 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch);
    EOF - tests to see whether a file, f, has reached end of file.
 */
 
-extern "C" unsigned int FIO_EOF (FIO_File f);
+extern "C" bool FIO_EOF (FIO_File f);
 
 /*
    EOLN - tests to see whether a file, f, is upon a newline.
           It does NOT consume the newline.
 */
 
-extern "C" unsigned int FIO_EOLN (FIO_File f);
+extern "C" bool FIO_EOLN (FIO_File f);
 
 /*
    WasEOLN - tests to see whether a file, f, has just seen a newline.
 */
 
-extern "C" unsigned int FIO_WasEOLN (FIO_File f);
+extern "C" bool FIO_WasEOLN (FIO_File f);
 
 /*
    ReadChar - returns a character read from file f.
@@ -384,13 +385,13 @@ static void SetState (FIO_File f, FIO_FileStatus s);
    InitializeFile - initialize a file descriptor
 */
 
-static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength);
+static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, bool towrite, unsigned int buflength);
 
 /*
    ConnectToUnix - connects a FIO file to a UNIX file descriptor.
 */
 
-static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile);
+static void ConnectToUnix (FIO_File f, bool towrite, bool newfile);
 
 /*
    ReadFromBuffer - attempts to read, nBytes, from file, f.
@@ -459,7 +460,7 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c
                  opened for read/write.
 */
 
-static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite);
+static void CheckAccess (FIO_File f, FIO_FileUsage use, bool towrite);
 
 /*
    SetEndOfLine -
@@ -481,7 +482,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a);
    PreInitialize - preinitialize the file descriptor.
 */
 
-static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize);
+static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, bool towrite, int osfd, unsigned int bufsize);
 
 /*
    Init - initialize the modules, global variables.
@@ -580,7 +581,7 @@ static void SetState (FIO_File f, FIO_FileStatus s)
    InitializeFile - initialize a file descriptor
 */
 
-static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength)
+static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, bool towrite, unsigned int buflength)
 {
   FIO_PtrToChar p;
   FIO_FileDescriptor fd;
@@ -618,7 +619,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength,
         }
       else
         {
-          fd->buffer->valid = FALSE;
+          fd->buffer->valid = false;
           fd->buffer->bufstart = 0;
           fd->buffer->size = buflength;
           fd->buffer->position = 0;
@@ -658,7 +659,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength,
    ConnectToUnix - connects a FIO file to a UNIX file descriptor.
 */
 
-static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile)
+static void ConnectToUnix (FIO_File f, bool towrite, bool newfile)
 {
   FIO_FileDescriptor fd;
 
@@ -729,7 +730,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes)
                   (*p) = static_cast<unsigned char> ((*fd->buffer->contents).array[fd->buffer->position]);
                   fd->buffer->left -= 1;  /* remove consumed bytes  */
                   fd->buffer->position += 1;  /* move onwards n bytes  */
-                  nBytes = 0;
+                  nBytes = 0;  /* reduce the amount for future direct  */
                   /* read  */
                   return 1;
                 }
@@ -764,7 +765,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes)
               /* now disable the buffer as we read directly into, a.  */
               if (fd->buffer != NULL)
                 {
-                  fd->buffer->valid = FALSE;
+                  fd->buffer->valid = false;
                 }
             }
           else
@@ -781,7 +782,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes)
               /* indicate buffer is empty  */
               if (fd->buffer != NULL)
                 {
-                  fd->buffer->valid = FALSE;
+                  fd->buffer->valid = false;
                   fd->buffer->left = 0;
                   fd->buffer->position = 0;
                   if (fd->buffer->address != NULL)
@@ -816,7 +817,6 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
   typedef unsigned char *BufferedRead__T3;
 
   void * t;
-  int result;
   int total;
   int n;
   BufferedRead__T3 p;
@@ -867,7 +867,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
                       if (n >= 0)
                         {
                           /* avoid dangling else.  */
-                          fd->buffer->valid = TRUE;
+                          fd->buffer->valid = true;
                           fd->buffer->position = 0;
                           fd->buffer->left = n;
                           fd->buffer->filled = n;
@@ -882,7 +882,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
                         }
                       else
                         {
-                          fd->buffer->valid = FALSE;
+                          fd->buffer->valid = false;
                           fd->buffer->position = 0;
                           fd->buffer->left = 0;
                           fd->buffer->filled = 0;
@@ -1141,7 +1141,7 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c
                  opened for read/write.
 */
 
-static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite)
+static void CheckAccess (FIO_File f, FIO_FileUsage use, bool towrite)
 {
   FIO_FileDescriptor fd;
 
@@ -1215,7 +1215,7 @@ static void SetEndOfLine (FIO_File f, char ch)
 {
   FIO_FileDescriptor fd;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if (f != Error)
     {
       fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
@@ -1244,7 +1244,6 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a)
   typedef unsigned char *BufferedWrite__T5;
 
   void * t;
-  int result;
   int total;
   int n;
   BufferedWrite__T5 p;
@@ -1310,7 +1309,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a)
    PreInitialize - preinitialize the file descriptor.
 */
 
-static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize)
+static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, bool towrite, int osfd, unsigned int bufsize)
 {
   FIO_FileDescriptor fd;
   FIO_FileDescriptor fe;
@@ -1356,13 +1355,13 @@ static void Init (void)
 {
   FileInfo = Indexing_InitIndex (0);
   Error = 0;
-  PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, FALSE, -1, 0);
+  PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, false, -1, 0);
   FIO_StdIn = 1;
-  PreInitialize (FIO_StdIn, (const char *) "<stdin>", 7, FIO_successful, FIO_openedforread, FALSE, 0, MaxBufferLength);
+  PreInitialize (FIO_StdIn, (const char *) "<stdin>", 7, FIO_successful, FIO_openedforread, false, 0, MaxBufferLength);
   FIO_StdOut = 2;
-  PreInitialize (FIO_StdOut, (const char *) "<stdout>", 8, FIO_successful, FIO_openedforwrite, TRUE, 1, MaxBufferLength);
+  PreInitialize (FIO_StdOut, (const char *) "<stdout>", 8, FIO_successful, FIO_openedforwrite, true, 1, MaxBufferLength);
   FIO_StdErr = 3;
-  PreInitialize (FIO_StdErr, (const char *) "<stderr>", 8, FIO_successful, FIO_openedforwrite, TRUE, 2, MaxBufferLength);
+  PreInitialize (FIO_StdErr, (const char *) "<stderr>", 8, FIO_successful, FIO_openedforwrite, true, 2, MaxBufferLength);
   if (! (M2RTS_InstallTerminationProcedure ((PROC ) {(PROC_t) FIO_FlushOutErr})))
     {
       M2RTS_HALT (-1);
@@ -1375,13 +1374,13 @@ static void Init (void)
    IsNoError - returns a TRUE if no error has occured on file, f.
 */
 
-extern "C" unsigned int FIO_IsNoError (FIO_File f)
+extern "C" bool FIO_IsNoError (FIO_File f)
 {
   FIO_FileDescriptor fd;
 
   if (f == Error)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -1397,11 +1396,11 @@ extern "C" unsigned int FIO_IsNoError (FIO_File f)
    IsActive - returns TRUE if the file, f, is still active.
 */
 
-extern "C" unsigned int FIO_IsActive (FIO_File f)
+extern "C" bool FIO_IsActive (FIO_File f)
 {
   if (f == Error)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -1411,7 +1410,7 @@ extern "C" unsigned int FIO_IsActive (FIO_File f)
   __builtin_unreachable ();
 }
 
-extern "C" unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high)
+extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high)
 {
   char fname[_fname_high+1];
 
@@ -1450,7 +1449,7 @@ extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_hig
   __builtin_unreachable ();
 }
 
-extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile)
 {
   char fname[_fname_high+1];
 
@@ -1514,7 +1513,7 @@ extern "C" void FIO_Close (FIO_File f)
    exists - returns TRUE if a file named, fname exists for reading.
 */
 
-extern "C" unsigned int FIO_exists (void * fname, unsigned int flength)
+extern "C" bool FIO_exists (void * fname, unsigned int flength)
 {
   FIO_File f;
 
@@ -1522,12 +1521,12 @@ extern "C" unsigned int FIO_exists (void * fname, unsigned int flength)
   if (FIO_IsNoError (f))
     {
       FIO_Close (f);
-      return TRUE;
+      return true;
     }
   else
     {
       FIO_Close (f);
-      return FALSE;
+      return false;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -1552,8 +1551,8 @@ extern "C" FIO_File FIO_openToRead (void * fname, unsigned int flength)
     }
   else
     {
-      f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, FALSE, MaxBufferLength);
-      ConnectToUnix (f, FALSE, FALSE);
+      f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, false, MaxBufferLength);
+      ConnectToUnix (f, false, false);
     }
   return f;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -1579,8 +1578,8 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength)
     }
   else
     {
-      f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, TRUE, MaxBufferLength);
-      ConnectToUnix (f, TRUE, TRUE);
+      f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, true, MaxBufferLength);
+      ConnectToUnix (f, true, true);
     }
   return f;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -1597,7 +1596,7 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength)
                    opened for writing or reading.
 */
 
-extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile)
 {
   FIO_File f;
 
@@ -1666,7 +1665,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void *
 
   if (f != Error)
     {
-      CheckAccess (f, FIO_openedforread, FALSE);
+      CheckAccess (f, FIO_openedforread, false);
       n = ReadFromBuffer (f, dest, nBytes);
       if (n <= 0)
         {
@@ -1697,7 +1696,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void *
 
 extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high)
 {
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if ((BufferedRead (f, _a_high, a)) == ((int ) (_a_high)))
     {
       SetEndOfLine (f, static_cast<char> (a[_a_high]));
@@ -1718,7 +1717,7 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void *
   int total;
   FIO_FileDescriptor fd;
 
-  CheckAccess (f, FIO_openedforwrite, TRUE);
+  CheckAccess (f, FIO_openedforwrite, true);
   FIO_FlushBuffer (f);
   if (f != Error)
     {
@@ -1756,7 +1755,7 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void *
 
 extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high)
 {
-  CheckAccess (f, FIO_openedforwrite, TRUE);
+  CheckAccess (f, FIO_openedforwrite, true);
   if ((BufferedWrite (f, _a_high, a)) == ((int ) (_a_high)))
     {}  /* empty.  */
 }
@@ -1768,7 +1767,7 @@ extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high
 
 extern "C" void FIO_WriteChar (FIO_File f, char ch)
 {
-  CheckAccess (f, FIO_openedforwrite, TRUE);
+  CheckAccess (f, FIO_openedforwrite, true);
   if ((BufferedWrite (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
     {}  /* empty.  */
 }
@@ -1778,11 +1777,11 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch)
    EOF - tests to see whether a file, f, has reached end of file.
 */
 
-extern "C" unsigned int FIO_EOF (FIO_File f)
+extern "C" bool FIO_EOF (FIO_File f)
 {
   FIO_FileDescriptor fd;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if (f != Error)
     {
       fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
@@ -1791,7 +1790,7 @@ extern "C" unsigned int FIO_EOF (FIO_File f)
           return fd->state == FIO_endoffile;
         }
     }
-  return TRUE;
+  return true;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1802,12 +1801,12 @@ extern "C" unsigned int FIO_EOF (FIO_File f)
           It does NOT consume the newline.
 */
 
-extern "C" unsigned int FIO_EOLN (FIO_File f)
+extern "C" bool FIO_EOLN (FIO_File f)
 {
   char ch;
   FIO_FileDescriptor fd;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   /* 
       we will read a character and then push it back onto the input stream,
       having noted the file status, we also reset the status.
@@ -1828,7 +1827,7 @@ extern "C" unsigned int FIO_EOLN (FIO_File f)
             }
         }
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1838,14 +1837,14 @@ extern "C" unsigned int FIO_EOLN (FIO_File f)
    WasEOLN - tests to see whether a file, f, has just seen a newline.
 */
 
-extern "C" unsigned int FIO_WasEOLN (FIO_File f)
+extern "C" bool FIO_WasEOLN (FIO_File f)
 {
   FIO_FileDescriptor fd;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if (f == Error)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -1867,7 +1866,7 @@ extern "C" char FIO_ReadChar (FIO_File f)
 {
   char ch;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if ((BufferedRead (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
     {
       SetEndOfLine (f, ch);
@@ -1900,7 +1899,7 @@ extern "C" void FIO_UnReadChar (FIO_File f, char ch)
   void * a;
   void * b;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   if (f != Error)
     {
       fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
@@ -1990,7 +1989,7 @@ extern "C" void FIO_ReadString (FIO_File f, char *a, unsigned int _a_high)
   unsigned int i;
   char ch;
 
-  CheckAccess (f, FIO_openedforread, FALSE);
+  CheckAccess (f, FIO_openedforread, false);
   high = _a_high;
   i = 0;
   do {
@@ -2081,7 +2080,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos)
         {
           /* always force the lseek, until we are confident that abspos is always correct,
                basically it needs some hard testing before we should remove the OR TRUE.  */
-          if ((fd->abspos != pos) || TRUE)
+          if ((fd->abspos != pos) || true)
             {
               FIO_FlushBuffer (f);
               if (fd->buffer != NULL)
@@ -2109,7 +2108,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos)
                 }
               if (fd->buffer != NULL)
                 {
-                  fd->buffer->valid = FALSE;
+                  fd->buffer->valid = false;
                   fd->buffer->bufstart = fd->abspos;
                 }
             }
@@ -2159,7 +2158,7 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos)
             }
           if (fd->buffer != NULL)
             {
-              fd->buffer->valid = FALSE;
+              fd->buffer->valid = false;
               fd->buffer->bufstart = offset;
             }
         }
diff --git a/gcc/m2/pge-boot/GFIO.h b/gcc/m2/pge-boot/GFIO.h
index 9562283076e..a4a9e40c05b 100644
--- a/gcc/m2/pge-boot/GFIO.h
+++ b/gcc/m2/pge-boot/GFIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -58,19 +59,19 @@ EXTERN FIO_File FIO_StdErr;
    IsNoError - returns a TRUE if no error has occured on file, f.
 */
 
-EXTERN unsigned int FIO_IsNoError (FIO_File f);
+EXTERN bool FIO_IsNoError (FIO_File f);
 
 /*
    IsActive - returns TRUE if the file, f, is still active.
 */
 
-EXTERN unsigned int FIO_IsActive (FIO_File f);
+EXTERN bool FIO_IsActive (FIO_File f);
 
 /*
    Exists - returns TRUE if a file named, fname exists for reading.
 */
 
-EXTERN unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high);
+EXTERN bool FIO_Exists (const char *fname_, unsigned int _fname_high);
 
 /*
    OpenToRead - attempts to open a file, fname, for reading and
@@ -104,7 +105,7 @@ EXTERN FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_high);
                    and modify an existing file.
 */
 
-EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile);
 
 /*
    Close - close a file which has been previously opened using:
@@ -113,10 +114,10 @@ EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high,
 */
 
 EXTERN void FIO_Close (FIO_File f);
-EXTERN unsigned int FIO_exists (void * fname, unsigned int flength);
+EXTERN bool FIO_exists (void * fname, unsigned int flength);
 EXTERN FIO_File FIO_openToRead (void * fname, unsigned int flength);
 EXTERN FIO_File FIO_openToWrite (void * fname, unsigned int flength);
-EXTERN FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile);
 
 /*
    FlushBuffer - flush contents of the FIO file, f, to libc.
@@ -169,7 +170,7 @@ EXTERN void FIO_WriteChar (FIO_File f, char ch);
    EOF - tests to see whether a file, f, has reached end of file.
 */
 
-EXTERN unsigned int FIO_EOF (FIO_File f);
+EXTERN bool FIO_EOF (FIO_File f);
 
 /*
    EOLN - tests to see whether a file, f, is about to read a newline.
@@ -177,14 +178,14 @@ EXTERN unsigned int FIO_EOF (FIO_File f);
           and then immediately unreads the character.
 */
 
-EXTERN unsigned int FIO_EOLN (FIO_File f);
+EXTERN bool FIO_EOLN (FIO_File f);
 
 /*
    WasEOLN - tests to see whether a file, f, has just read a newline
              character.
 */
 
-EXTERN unsigned int FIO_WasEOLN (FIO_File f);
+EXTERN bool FIO_WasEOLN (FIO_File f);
 
 /*
    ReadChar - returns a character read from file, f.
diff --git a/gcc/m2/pge-boot/GFormatStrings.h b/gcc/m2/pge-boot/GFormatStrings.h
index 69137fa4bc8..0e90b554f9d 100644
--- a/gcc/m2/pge-boot/GFormatStrings.h
+++ b/gcc/m2/pge-boot/GFormatStrings.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GFpuIO.h b/gcc/m2/pge-boot/GFpuIO.h
index d1a0e736505..631f09b22bd 100644
--- a/gcc/m2/pge-boot/GFpuIO.h
+++ b/gcc/m2/pge-boot/GFpuIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GIO.cc b/gcc/m2/pge-boot/GIO.cc
index 1d670569c2a..4bc7e2cdcdc 100644
--- a/gcc/m2/pge-boot/GIO.cc
+++ b/gcc/m2/pge-boot/GIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -58,8 +59,8 @@ typedef struct IO_BasicFds_r IO_BasicFds;
 typedef struct IO__T1_a IO__T1;
 
 struct IO_BasicFds_r {
-                       unsigned int IsEof;
-                       unsigned int IsRaw;
+                       bool IsEof;
+                       bool IsRaw;
                      };
 
 struct IO__T1_a { IO_BasicFds array[MaxDefaultFd+1]; };
@@ -84,8 +85,8 @@ extern "C" void IO_Write (char ch);
 */
 
 extern "C" void IO_Error (char ch);
-extern "C" void IO_UnBufferedMode (int fd, unsigned int input);
-extern "C" void IO_BufferedMode (int fd, unsigned int input);
+extern "C" void IO_UnBufferedMode (int fd, bool input);
+extern "C" void IO_BufferedMode (int fd, bool input);
 
 /*
    EchoOn - turns on echoing for file descriptor, fd.  This
@@ -94,7 +95,7 @@ extern "C" void IO_BufferedMode (int fd, unsigned int input);
             which is attached to a particular piece of hardware.
 */
 
-extern "C" void IO_EchoOn (int fd, unsigned int input);
+extern "C" void IO_EchoOn (int fd, bool input);
 
 /*
    EchoOff - turns off echoing for file descriptor, fd.  This
@@ -103,13 +104,13 @@ extern "C" void IO_EchoOn (int fd, unsigned int input);
              which is attached to a particular piece of hardware.
 */
 
-extern "C" void IO_EchoOff (int fd, unsigned int input);
+extern "C" void IO_EchoOff (int fd, bool input);
 
 /*
    IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2.
 */
 
-static unsigned int IsDefaultFd (int fd);
+static bool IsDefaultFd (int fd);
 
 /*
    doWrite - performs the write of a single character, ch,
@@ -122,7 +123,7 @@ static void doWrite (int fd, FIO_File f, char ch);
    setFlag - sets or unsets the appropriate flag in, t.
 */
 
-static void setFlag (termios_TERMIOS t, termios_Flag f, unsigned int b);
+static void setFlag (termios_TERMIOS t, termios_Flag f, bool b);
 
 /*
    doraw - sets all the flags associated with making this
@@ -149,7 +150,7 @@ static void Init (void);
    IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2.
 */
 
-static unsigned int IsDefaultFd (int fd)
+static bool IsDefaultFd (int fd)
 {
   return (fd <= MaxDefaultFd) && (fd >= 0);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -184,7 +185,7 @@ static void doWrite (int fd, FIO_File f, char ch)
                 r = errno_geterrno ();
                 if ((r != errno_EAGAIN) && (r != errno_EINTR))
                   {
-                    fdState.array[fd].IsEof = TRUE;
+                    fdState.array[fd].IsEof = true;
                     return ;
                   }
               }
@@ -202,7 +203,7 @@ static void doWrite (int fd, FIO_File f, char ch)
    setFlag - sets or unsets the appropriate flag in, t.
 */
 
-static void setFlag (termios_TERMIOS t, termios_Flag f, unsigned int b)
+static void setFlag (termios_TERMIOS t, termios_Flag f, bool b)
 {
   if (termios_SetFlag (t, f, b))
     {}  /* empty.  */
@@ -225,22 +226,22 @@ static void doraw (termios_TERMIOS term)
     *           termios_p->c_cflag &= ~(CSIZE | PARENB);
     *           termios_p->c_cflag |= CS8;
   */
-  setFlag (term, termios_ignbrk, FALSE);
-  setFlag (term, termios_ibrkint, FALSE);
-  setFlag (term, termios_iparmrk, FALSE);
-  setFlag (term, termios_istrip, FALSE);
-  setFlag (term, termios_inlcr, FALSE);
-  setFlag (term, termios_igncr, FALSE);
-  setFlag (term, termios_icrnl, FALSE);
-  setFlag (term, termios_ixon, FALSE);
-  setFlag (term, termios_opost, FALSE);
-  setFlag (term, termios_lecho, FALSE);
-  setFlag (term, termios_lechonl, FALSE);
-  setFlag (term, termios_licanon, FALSE);
-  setFlag (term, termios_lisig, FALSE);
-  setFlag (term, termios_liexten, FALSE);
-  setFlag (term, termios_parenb, FALSE);
-  setFlag (term, termios_cs8, TRUE);
+  setFlag (term, termios_ignbrk, false);
+  setFlag (term, termios_ibrkint, false);
+  setFlag (term, termios_iparmrk, false);
+  setFlag (term, termios_istrip, false);
+  setFlag (term, termios_inlcr, false);
+  setFlag (term, termios_igncr, false);
+  setFlag (term, termios_icrnl, false);
+  setFlag (term, termios_ixon, false);
+  setFlag (term, termios_opost, false);
+  setFlag (term, termios_lecho, false);
+  setFlag (term, termios_lechonl, false);
+  setFlag (term, termios_licanon, false);
+  setFlag (term, termios_lisig, false);
+  setFlag (term, termios_liexten, false);
+  setFlag (term, termios_parenb, false);
+  setFlag (term, termios_cs8, true);
 }
 
 
@@ -262,20 +263,20 @@ static void dononraw (termios_TERMIOS term)
     *           termios_p->c_cflag &= ~(CSIZE | PARENB);
     *           termios_p->c_cflag |= CS8;
   */
-  setFlag (term, termios_ignbrk, TRUE);
-  setFlag (term, termios_ibrkint, TRUE);
-  setFlag (term, termios_iparmrk, TRUE);
-  setFlag (term, termios_istrip, TRUE);
-  setFlag (term, termios_inlcr, TRUE);
-  setFlag (term, termios_igncr, TRUE);
-  setFlag (term, termios_icrnl, TRUE);
-  setFlag (term, termios_ixon, TRUE);
-  setFlag (term, termios_opost, TRUE);
-  setFlag (term, termios_lecho, TRUE);
-  setFlag (term, termios_lechonl, TRUE);
-  setFlag (term, termios_licanon, TRUE);
-  setFlag (term, termios_lisig, TRUE);
-  setFlag (term, termios_liexten, TRUE);
+  setFlag (term, termios_ignbrk, true);
+  setFlag (term, termios_ibrkint, true);
+  setFlag (term, termios_iparmrk, true);
+  setFlag (term, termios_istrip, true);
+  setFlag (term, termios_inlcr, true);
+  setFlag (term, termios_igncr, true);
+  setFlag (term, termios_icrnl, true);
+  setFlag (term, termios_ixon, true);
+  setFlag (term, termios_opost, true);
+  setFlag (term, termios_lecho, true);
+  setFlag (term, termios_lechonl, true);
+  setFlag (term, termios_licanon, true);
+  setFlag (term, termios_lisig, true);
+  setFlag (term, termios_liexten, true);
 }
 
 
@@ -285,12 +286,12 @@ static void dononraw (termios_TERMIOS term)
 
 static void Init (void)
 {
-  fdState.array[0].IsEof = FALSE;
-  fdState.array[0].IsRaw = FALSE;
-  fdState.array[1].IsEof = FALSE;
-  fdState.array[1].IsRaw = FALSE;
-  fdState.array[2].IsEof = FALSE;
-  fdState.array[2].IsRaw = FALSE;
+  fdState.array[0].IsEof = false;
+  fdState.array[0].IsRaw = false;
+  fdState.array[1].IsEof = false;
+  fdState.array[1].IsRaw = false;
+  fdState.array[2].IsEof = false;
+  fdState.array[2].IsRaw = false;
 }
 
 
@@ -325,7 +326,7 @@ extern "C" void IO_Read (char *ch)
                 r = errno_geterrno ();
                 if (r != errno_EAGAIN)
                   {
-                    fdState.array[0].IsEof = TRUE;
+                    fdState.array[0].IsEof = true;
                     (*ch) = ASCII_eof;
                     return ;
                   }
@@ -361,14 +362,14 @@ extern "C" void IO_Error (char ch)
   doWrite (2, FIO_StdErr, ch);
 }
 
-extern "C" void IO_UnBufferedMode (int fd, unsigned int input)
+extern "C" void IO_UnBufferedMode (int fd, bool input)
 {
   termios_TERMIOS term;
   int result;
 
   if (IsDefaultFd (fd))
     {
-      fdState.array[fd].IsRaw = TRUE;
+      fdState.array[fd].IsRaw = true;
     }
   term = termios_InitTermios ();
   if ((termios_tcgetattr (fd, term)) == 0)
@@ -386,14 +387,14 @@ extern "C" void IO_UnBufferedMode (int fd, unsigned int input)
   term = termios_KillTermios (term);
 }
 
-extern "C" void IO_BufferedMode (int fd, unsigned int input)
+extern "C" void IO_BufferedMode (int fd, bool input)
 {
   termios_TERMIOS term;
   int r;
 
   if (IsDefaultFd (fd))
     {
-      fdState.array[fd].IsRaw = FALSE;
+      fdState.array[fd].IsRaw = false;
     }
   term = termios_InitTermios ();
   if ((termios_tcgetattr (fd, term)) == 0)
@@ -419,7 +420,7 @@ extern "C" void IO_BufferedMode (int fd, unsigned int input)
             which is attached to a particular piece of hardware.
 */
 
-extern "C" void IO_EchoOn (int fd, unsigned int input)
+extern "C" void IO_EchoOn (int fd, bool input)
 {
   termios_TERMIOS term;
   int result;
@@ -427,7 +428,7 @@ extern "C" void IO_EchoOn (int fd, unsigned int input)
   term = termios_InitTermios ();
   if ((termios_tcgetattr (fd, term)) == 0)
     {
-      setFlag (term, termios_lecho, TRUE);
+      setFlag (term, termios_lecho, true);
       if (input)
         {
           result = termios_tcsetattr (fd, termios_tcsflush (), term);
@@ -448,7 +449,7 @@ extern "C" void IO_EchoOn (int fd, unsigned int input)
              which is attached to a particular piece of hardware.
 */
 
-extern "C" void IO_EchoOff (int fd, unsigned int input)
+extern "C" void IO_EchoOff (int fd, bool input)
 {
   termios_TERMIOS term;
   int result;
@@ -456,7 +457,7 @@ extern "C" void IO_EchoOff (int fd, unsigned int input)
   term = termios_InitTermios ();
   if ((termios_tcgetattr (fd, term)) == 0)
     {
-      setFlag (term, termios_lecho, FALSE);
+      setFlag (term, termios_lecho, false);
       if (input)
         {
           result = termios_tcsetattr (fd, termios_tcsflush (), term);
diff --git a/gcc/m2/pge-boot/GIO.h b/gcc/m2/pge-boot/GIO.h
index c9775d270f6..6604ee15c78 100644
--- a/gcc/m2/pge-boot/GIO.h
+++ b/gcc/m2/pge-boot/GIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -55,13 +56,13 @@ EXTERN void IO_Error (char ch);
    UnBufferedMode - places file descriptor, fd, into an unbuffered mode.
 */
 
-EXTERN void IO_UnBufferedMode (int fd, unsigned int input);
+EXTERN void IO_UnBufferedMode (int fd, bool input);
 
 /*
    BufferedMode - places file descriptor, fd, into a buffered mode.
 */
 
-EXTERN void IO_BufferedMode (int fd, unsigned int input);
+EXTERN void IO_BufferedMode (int fd, bool input);
 
 /*
    EchoOn - turns on echoing for file descriptor, fd.  This
@@ -70,7 +71,7 @@ EXTERN void IO_BufferedMode (int fd, unsigned int input);
             which is attached to a particular piece of hardware.
 */
 
-EXTERN void IO_EchoOn (int fd, unsigned int input);
+EXTERN void IO_EchoOn (int fd, bool input);
 
 /*
    EchoOff - turns off echoing for file descriptor, fd.  This
@@ -79,7 +80,7 @@ EXTERN void IO_EchoOn (int fd, unsigned int input);
              which is attached to a particular piece of hardware.
 */
 
-EXTERN void IO_EchoOff (int fd, unsigned int input);
+EXTERN void IO_EchoOff (int fd, bool input);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GIndexing.cc b/gcc/m2/pge-boot/GIndexing.cc
index 630feb7c694..939921f5761 100644
--- a/gcc/m2/pge-boot/GIndexing.cc
+++ b/gcc/m2/pge-boot/GIndexing.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -75,7 +76,7 @@ struct Indexing__T2_r {
                         unsigned int Used;
                         unsigned int Low;
                         unsigned int High;
-                        unsigned int Debug;
+                        bool Debug;
                         unsigned int Map;
                       };
 
@@ -103,7 +104,7 @@ extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i);
               of the dynamic array.
 */
 
-extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n);
+extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n);
 
 /*
    HighIndice - returns the last legally accessible indice of this array.
@@ -133,7 +134,7 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
    IsIndiceInIndex - returns TRUE if, a, is in the index, i.
 */
 
-extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
+extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
 
 /*
    RemoveIndiceFromIndex - removes, a, from Index, i.
@@ -175,7 +176,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low)
   i->ArraySize = MinSize;
   Storage_ALLOCATE (&i->ArrayStart, MinSize);
   i->ArrayStart = libc_memset (i->ArrayStart, 0, static_cast<size_t> (i->ArraySize));
-  i->Debug = FALSE;
+  i->Debug = false;
   i->Used = 0;
   i->Map = (unsigned int) 0;
   return i;
@@ -204,7 +205,7 @@ extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index i)
 
 extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i)
 {
-  i->Debug = TRUE;
+  i->Debug = true;
   return i;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -216,7 +217,7 @@ extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i)
               of the dynamic array.
 */
 
-extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n)
+extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n)
 {
   if (i == NULL)
     {
@@ -368,7 +369,7 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n)
    IsIndiceInIndex - returns TRUE if, a, is in the index, i.
 */
 
-extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
+extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
 {
   unsigned int j;
   Indexing_PtrToByte b;
@@ -381,13 +382,13 @@ extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
       p = (Indexing_PtrToAddress) (b);
       if ((*p) == a)
         {
-          return TRUE;
+          return true;
         }
       /* we must not INC(p, ..) as p2c gets confused  */
       b += sizeof (void *);
       j += 1;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -400,7 +401,6 @@ extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
 extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a)
 {
   unsigned int j;
-  unsigned int k;
   Indexing_PtrToAddress p;
   Indexing_PtrToByte b;
 
diff --git a/gcc/m2/pge-boot/GIndexing.h b/gcc/m2/pge-boot/GIndexing.h
index 1bba5ed8e12..4a575ac45f5 100644
--- a/gcc/m2/pge-boot/GIndexing.h
+++ b/gcc/m2/pge-boot/GIndexing.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -82,7 +83,7 @@ EXTERN Indexing_Index Indexing_DebugIndex (Indexing_Index i);
               of the dynamic array.
 */
 
-EXTERN unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n);
+EXTERN bool Indexing_InBounds (Indexing_Index i, unsigned int n);
 
 /*
    HighIndice - returns the last legally accessible indice of this array.
@@ -112,7 +113,7 @@ EXTERN void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
    IsIndiceInIndex - returns TRUE if, a, is in the index, i.
 */
 
-EXTERN unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
+EXTERN bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
 
 /*
    RemoveIndiceFromIndex - removes, a, from Index, i.
diff --git a/gcc/m2/pge-boot/GLists.cc b/gcc/m2/pge-boot/GLists.cc
index 45f0ffcb3d3..eabb0f05114 100644
--- a/gcc/m2/pge-boot/GLists.cc
+++ b/gcc/m2/pge-boot/GLists.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -117,7 +118,7 @@ extern "C" void Lists_RemoveItemFromList (Lists_List l, unsigned int c);
    IsItemInList - returns true if a WORD, c, was found in list, l.
 */
 
-extern "C" unsigned int Lists_IsItemInList (Lists_List l, unsigned int c);
+extern "C" bool Lists_IsItemInList (Lists_List l, unsigned int c);
 
 /*
    ForeachItemInListDo - calls procedure, P, foreach item in list, l.
@@ -317,11 +318,11 @@ extern "C" void Lists_RemoveItemFromList (Lists_List l, unsigned int c)
 {
   Lists_List p;
   unsigned int i;
-  unsigned int Found;
+  bool Found;
 
   if (l != NULL)
     {
-      Found = FALSE;
+      Found = false;
       p = NULL;
       do {
         i = 1;
@@ -331,7 +332,7 @@ extern "C" void Lists_RemoveItemFromList (Lists_List l, unsigned int c)
           }
         if ((i <= l->NoOfElements) && (l->Elements.array[i-1] == c))
           {
-            Found = TRUE;
+            Found = true;
           }
         else
           {
@@ -351,7 +352,7 @@ extern "C" void Lists_RemoveItemFromList (Lists_List l, unsigned int c)
    IsItemInList - returns true if a WORD, c, was found in list, l.
 */
 
-extern "C" unsigned int Lists_IsItemInList (Lists_List l, unsigned int c)
+extern "C" bool Lists_IsItemInList (Lists_List l, unsigned int c)
 {
   unsigned int i;
 
@@ -361,7 +362,7 @@ extern "C" unsigned int Lists_IsItemInList (Lists_List l, unsigned int c)
       {
         if (l->Elements.array[i-1] == c)
           {
-            return TRUE;
+            return true;
           }
         else
           {
@@ -370,7 +371,7 @@ extern "C" unsigned int Lists_IsItemInList (Lists_List l, unsigned int c)
       }
     l = l->Next;
   } while (! (l == NULL));
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
diff --git a/gcc/m2/pge-boot/GLists.h b/gcc/m2/pge-boot/GLists.h
index 3b5e3ac76fb..5c7f6fd277d 100644
--- a/gcc/m2/pge-boot/GLists.h
+++ b/gcc/m2/pge-boot/GLists.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -106,7 +107,7 @@ EXTERN void Lists_RemoveItemFromList (Lists_List l, unsigned int c);
    IsItemInList - returns true if a WORD, c, was found in list, l.
 */
 
-EXTERN unsigned int Lists_IsItemInList (Lists_List l, unsigned int c);
+EXTERN bool Lists_IsItemInList (Lists_List l, unsigned int c);
 
 /*
    ForeachItemInListDo - calls procedure, P, foreach item in list, l.
diff --git a/gcc/m2/pge-boot/GM2Dependent.cc b/gcc/m2/pge-boot/GM2Dependent.cc
index 0e0e3eadcc3..abd0b7b3181 100644
--- a/gcc/m2/pge-boot/GM2Dependent.cc
+++ b/gcc/m2/pge-boot/GM2Dependent.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -53,7 +54,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define _M2Dependent_C
 
 #   include "Glibc.h"
-#   include "GM2LINK.h"
 #   include "GASCII.h"
 #   include "GSYSTEM.h"
 #   include "GStorage.h"
@@ -64,6 +64,8 @@ typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP;
 
 typedef struct M2Dependent_DependencyList_r M2Dependent_DependencyList;
 
+typedef char *M2Dependent_PtrToChar;
+
 typedef struct M2Dependent__T2_r M2Dependent__T2;
 
 typedef M2Dependent__T2 *M2Dependent_ModuleChain;
@@ -77,9 +79,9 @@ struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; };
 
 struct M2Dependent_DependencyList_r {
                                       PROC proc;
-                                      unsigned int forced;
-                                      unsigned int forc;
-                                      unsigned int appl;
+                                      bool forced;
+                                      bool forc;
+                                      bool appl;
                                       M2Dependent_DependencyState state;
                                     };
 
@@ -95,21 +97,22 @@ struct M2Dependent__T2_r {
                          };
 
 static M2Dependent__T3 Modules;
-static unsigned int Initialized;
-static unsigned int WarningTrace;
-static unsigned int ModuleTrace;
-static unsigned int HexTrace;
-static unsigned int DependencyTrace;
-static unsigned int PreTrace;
-static unsigned int PostTrace;
-static unsigned int ForceTrace;
+static bool DynamicInitialization;
+static bool Initialized;
+static bool WarningTrace;
+static bool ModuleTrace;
+static bool HexTrace;
+static bool DependencyTrace;
+static bool PreTrace;
+static bool PostTrace;
+static bool ForceTrace;
 
 /*
    ConstructModules - resolve dependencies and then call each
                       module constructor in turn.
 */
 
-extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 
 /*
    DeconstructModules - resolve dependencies and then call each
@@ -129,7 +132,7 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
 /*
    RequestDependant - used to specify that modulename is dependant upon
                       module dependantmodule.  It only takes effect
-                      if we are not using StaticInitialization.
+                      if we are using DynamicInitialization.
 */
 
 extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
@@ -157,7 +160,7 @@ static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain
    onChain - returns TRUE if mptr is on the Modules[state] list.
 */
 
-static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr);
+static bool onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr);
 
 /*
    max -
@@ -197,38 +200,38 @@ static void toCString (char *str, unsigned int _str_high);
             We cannot use Builtins.def during bootstrap.
 */
 
-static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b);
+static int strcmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b);
 
 /*
    strncmp - return 0 if both strings are equal.
              We cannot use Builtins.def during bootstrap.
 */
 
-static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n);
+static int strncmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b, unsigned int n);
 
 /*
    strlen - returns the length of string.
 */
 
-static int strlen_ (M2LINK_PtrToChar string);
+static int strlen_ (M2Dependent_PtrToChar string);
 
 /*
    traceprintf - wrap printf with a boolean flag.
 */
 
-static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_high);
+static void traceprintf (bool flag, const char *str_, unsigned int _str_high);
 
 /*
    traceprintf2 - wrap printf with a boolean flag.
 */
 
-static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg);
+static void traceprintf2 (bool flag, const char *str_, unsigned int _str_high, void * arg);
 
 /*
    traceprintf3 - wrap printf with a boolean flag.
 */
 
-static void traceprintf3 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2);
+static void traceprintf3 (bool flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2);
 
 /*
    moveTo - moves mptr to the new list determined by newstate.
@@ -268,7 +271,7 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de
    DumpModuleData -
 */
 
-static void DumpModuleData (unsigned int flag);
+static void DumpModuleData (bool flag);
 
 /*
    combine - dest := src + dest.  Places src at the front of list dest.
@@ -283,7 +286,7 @@ static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyStat
    tracemodule -
 */
 
-static void tracemodule (unsigned int flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen);
+static void tracemodule (bool flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen);
 
 /*
    ForceModule -
@@ -296,7 +299,7 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
                        the dynamic ordering with the preference.
 */
 
-static void ForceDependencies (void);
+static void ForceDependencies (void * overrideliborder);
 
 /*
    CheckApplication - check to see that the application is the last entry in the list.
@@ -315,7 +318,7 @@ static void warning3 (const char *format_, unsigned int _format_high, void * arg
    equal - return TRUE if C string cstr is equal to str.
 */
 
-static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high);
+static bool equal (void * cstr, const char *str_, unsigned int _str_high);
 
 /*
    SetupDebugFlags - By default assigns ModuleTrace, DependencyTrace,
@@ -362,8 +365,6 @@ static void CheckInitialized (void);
 static M2Dependent_ModuleChain CreateModule (void * name, void * libname, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies)
 {
   M2Dependent_ModuleChain mptr;
-  void * p0;
-  void * p1;
 
   Storage_ALLOCATE ((void **) &mptr, sizeof (M2Dependent__T2));
   mptr->name = name;
@@ -433,7 +434,7 @@ static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain
    onChain - returns TRUE if mptr is on the Modules[state] list.
 */
 
-static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr)
+static bool onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr)
 {
   M2Dependent_ModuleChain ptr;
 
@@ -443,12 +444,12 @@ static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_Modu
       do {
         if (ptr == mptr)
           {
-            return TRUE;
+            return true;
           }
         ptr = ptr->next;
       } while (! (ptr == Modules.array[state-M2Dependent_unregistered]));
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -505,7 +506,7 @@ static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state,
     {
       ptr = Modules.array[state-M2Dependent_unregistered];
       do {
-        if (((strncmp (reinterpret_cast<M2LINK_PtrToChar> (ptr->name), reinterpret_cast<M2LINK_PtrToChar> (name), max (namelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (ptr->name)))))) == 0) && ((strncmp (reinterpret_cast<M2LINK_PtrToChar> (ptr->libname), reinterpret_cast<M2LINK_PtrToChar> (libname), max (libnamelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (ptr->libname)))))) == 0))
+        if (((strncmp (reinterpret_cast<M2Dependent_PtrToChar> (ptr->name), reinterpret_cast<M2Dependent_PtrToChar> (name), max (namelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (ptr->name)))))) == 0) && ((strncmp (reinterpret_cast<M2Dependent_PtrToChar> (ptr->libname), reinterpret_cast<M2Dependent_PtrToChar> (libname), max (libnamelen, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (ptr->libname)))))) == 0))
           {
             return ptr;
           }
@@ -525,7 +526,7 @@ static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state,
 
 static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name, void * libname)
 {
-  return LookupModuleN (state, name, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (name))), libname, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2LINK_PtrToChar> (libname))));
+  return LookupModuleN (state, name, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (name))), libname, static_cast<unsigned int> (strlen_ (reinterpret_cast<M2Dependent_PtrToChar> (libname))));
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -569,7 +570,7 @@ static void toCString (char *str, unsigned int _str_high)
             We cannot use Builtins.def during bootstrap.
 */
 
-static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b)
+static int strcmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b)
 {
   if ((a != NULL) && (b != NULL))
     {
@@ -602,7 +603,7 @@ static int strcmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b)
              We cannot use Builtins.def during bootstrap.
 */
 
-static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n)
+static int strncmp (M2Dependent_PtrToChar a, M2Dependent_PtrToChar b, unsigned int n)
 {
   if (n == 0)
     {
@@ -639,7 +640,7 @@ static int strncmp (M2LINK_PtrToChar a, M2LINK_PtrToChar b, unsigned int n)
    strlen - returns the length of string.
 */
 
-static int strlen_ (M2LINK_PtrToChar string)
+static int strlen_ (M2Dependent_PtrToChar string)
 {
   int count;
 
@@ -666,7 +667,7 @@ static int strlen_ (M2LINK_PtrToChar string)
    traceprintf - wrap printf with a boolean flag.
 */
 
-static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_high)
+static void traceprintf (bool flag, const char *str_, unsigned int _str_high)
 {
   char str[_str_high+1];
 
@@ -685,7 +686,7 @@ static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_
    traceprintf2 - wrap printf with a boolean flag.
 */
 
-static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg)
+static void traceprintf2 (bool flag, const char *str_, unsigned int _str_high, void * arg)
 {
   char ch;
   char str[_str_high+1];
@@ -710,7 +711,7 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str
    traceprintf3 - wrap printf with a boolean flag.
 */
 
-static void traceprintf3 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2)
+static void traceprintf3 (bool flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2)
 {
   char ch;
   char str[_str_high+1];
@@ -910,10 +911,8 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de
    DumpModuleData -
 */
 
-static void DumpModuleData (unsigned int flag)
+static void DumpModuleData (bool flag)
 {
-  M2Dependent_ModuleChain mptr;
-
   if (flag)
     {
       DisplayModuleInfo (M2Dependent_unregistered, (const char *) "unregistered", 12);
@@ -948,7 +947,7 @@ static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyStat
    tracemodule -
 */
 
-static void tracemodule (unsigned int flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen)
+static void tracemodule (bool flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen)
 {
   typedef struct tracemodule__T4_a tracemodule__T4;
 
@@ -984,7 +983,7 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
   mptr = LookupModuleN (M2Dependent_ordered, modname, modlen, libname, liblen);
   if (mptr != NULL)
     {
-      mptr->dependency.forced = TRUE;
+      mptr->dependency.forced = true;
       moveTo (M2Dependent_user, mptr);
     }
 }
@@ -995,20 +994,20 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
                        the dynamic ordering with the preference.
 */
 
-static void ForceDependencies (void)
+static void ForceDependencies (void * overrideliborder)
 {
   unsigned int len;
   unsigned int modlen;
   unsigned int liblen;
-  M2LINK_PtrToChar modname;
-  M2LINK_PtrToChar libname;
-  M2LINK_PtrToChar pc;
-  M2LINK_PtrToChar start;
+  M2Dependent_PtrToChar modname;
+  M2Dependent_PtrToChar libname;
+  M2Dependent_PtrToChar pc;
+  M2Dependent_PtrToChar start;
 
-  if (M2LINK_ForcedModuleInitOrder != NULL)
+  if (overrideliborder != NULL)
     {
-      traceprintf2 (ForceTrace, (const char *) "user forcing order: %s\\n", 24, reinterpret_cast<void *> (M2LINK_ForcedModuleInitOrder));
-      pc = M2LINK_ForcedModuleInitOrder;
+      traceprintf2 (ForceTrace, (const char *) "user forcing order: %s\\n", 24, overrideliborder);
+      pc = static_cast<M2Dependent_PtrToChar> (overrideliborder);
       start = pc;
       len = 0;
       modname = NULL;
@@ -1118,14 +1117,14 @@ static void warning3 (const char *format_, unsigned int _format_high, void * arg
    equal - return TRUE if C string cstr is equal to str.
 */
 
-static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high)
+static bool equal (void * cstr, const char *str_, unsigned int _str_high)
 {
   char str[_str_high+1];
 
   /* make a local copy of each unbounded array.  */
   memcpy (str, str_, _str_high+1);
 
-  return (strncmp (reinterpret_cast<M2LINK_PtrToChar> (cstr), reinterpret_cast<M2LINK_PtrToChar> (&str), StrLib_StrLen ((const char *) str, _str_high))) == 0;
+  return (strncmp (reinterpret_cast<M2Dependent_PtrToChar> (cstr), reinterpret_cast<M2Dependent_PtrToChar> (&str), StrLib_StrLen ((const char *) str, _str_high))) == 0;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -1156,67 +1155,67 @@ static void SetupDebugFlags (void)
 
   SetupDebugFlags__T1 pc;
 
-  ModuleTrace = FALSE;
-  DependencyTrace = FALSE;
-  PostTrace = FALSE;
-  PreTrace = FALSE;
-  ForceTrace = FALSE;
-  HexTrace = FALSE;
-  WarningTrace = FALSE;
+  ModuleTrace = false;
+  DependencyTrace = false;
+  PostTrace = false;
+  PreTrace = false;
+  ForceTrace = false;
+  HexTrace = false;
+  WarningTrace = false;
   pc = static_cast<SetupDebugFlags__T1> (libc_getenv (const_cast<void*> (reinterpret_cast<const void*>("GCC_M2LINK_RTFLAG"))));
   while ((pc != NULL) && ((*pc) != ASCII_nul))
     {
       if (equal (reinterpret_cast<void *> (pc), (const char *) "all", 3))
         {
-          ModuleTrace = TRUE;
-          DependencyTrace = TRUE;
-          PreTrace = TRUE;
-          PostTrace = TRUE;
-          ForceTrace = TRUE;
-          HexTrace = TRUE;
-          WarningTrace = TRUE;
+          ModuleTrace = true;
+          DependencyTrace = true;
+          PreTrace = true;
+          PostTrace = true;
+          ForceTrace = true;
+          HexTrace = true;
+          WarningTrace = true;
           pc += 3;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "module", 6))
         {
           /* avoid dangling else.  */
-          ModuleTrace = TRUE;
+          ModuleTrace = true;
           pc += 6;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "warning", 7))
         {
           /* avoid dangling else.  */
-          WarningTrace = TRUE;
+          WarningTrace = true;
           pc += 7;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "hex", 3))
         {
           /* avoid dangling else.  */
-          HexTrace = TRUE;
+          HexTrace = true;
           pc += 3;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "dep", 3))
         {
           /* avoid dangling else.  */
-          DependencyTrace = TRUE;
+          DependencyTrace = true;
           pc += 3;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "pre", 3))
         {
           /* avoid dangling else.  */
-          PreTrace = TRUE;
+          PreTrace = true;
           pc += 3;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "post", 4))
         {
           /* avoid dangling else.  */
-          PostTrace = TRUE;
+          PostTrace = true;
           pc += 4;
         }
       else if (equal (reinterpret_cast<void *> (pc), (const char *) "force", 5))
         {
           /* avoid dangling else.  */
-          ForceTrace = TRUE;
+          ForceTrace = true;
           pc += 5;
         }
       else
@@ -1241,6 +1240,7 @@ static void Init (void)
     {
       Modules.array[state-M2Dependent_unregistered] = NULL;
     }
+  DynamicInitialization = false;
 }
 
 
@@ -1255,7 +1255,7 @@ static void CheckInitialized (void)
 {
   if (! Initialized)
     {
-      Initialized = TRUE;
+      Initialized = true;
       Init ();
     }
 }
@@ -1266,24 +1266,24 @@ static void CheckInitialized (void)
                       module constructor in turn.
 */
 
-extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp)
+extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp)
 {
   M2Dependent_ModuleChain mptr;
-  M2Dependent_ArgCVEnvP nulp;
 
   CheckInitialized ();
-  traceprintf3 (ModuleTrace, (const char *) "application module: %s [%s]\\n", 29, applicationmodule, libname);
+  DynamicInitialization = true;  /* This procedure is only called if we desire dynamic initialization.  */
+  traceprintf3 (ModuleTrace, (const char *) "application module: %s [%s]\\n", 29, applicationmodule, libname);  /* This procedure is only called if we desire dynamic initialization.  */
   mptr = LookupModule (M2Dependent_unordered, applicationmodule, libname);
   if (mptr != NULL)
     {
-      mptr->dependency.appl = TRUE;
+      mptr->dependency.appl = true;
     }
   traceprintf (PreTrace, (const char *) "Pre resolving dependents\\n", 26);
   DumpModuleData (PreTrace);
   ResolveDependencies (applicationmodule, libname);
   traceprintf (PreTrace, (const char *) "Post resolving dependents\\n", 27);
   DumpModuleData (PostTrace);
-  ForceDependencies ();
+  ForceDependencies (overrideliborder);
   traceprintf (ForceTrace, (const char *) "After user forcing ordering\\n", 29);
   DumpModuleData (ForceTrace);
   CheckApplication ();
@@ -1368,19 +1368,16 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
   M2Dependent_ModuleChain mptr;
 
   CheckInitialized ();
-  if (! M2LINK_StaticInitialization)
+  mptr = LookupModule (M2Dependent_unordered, modulename, libname);
+  if (mptr == NULL)
     {
-      mptr = LookupModule (M2Dependent_unordered, modulename, libname);
-      if (mptr == NULL)
-        {
-          traceprintf3 (ModuleTrace, (const char *) "module: %s [%s] registering", 27, modulename, libname);
-          moveTo (M2Dependent_unordered, CreateModule (modulename, libname, init, fini, dependencies));
-          traceprintf (ModuleTrace, (const char *) "\\n", 2);
-        }
-      else
-        {
-          warning3 ((const char *) "module: %s [%s] (ignoring duplicate registration)\\n", 51, modulename, libname);
-        }
+      traceprintf3 (ModuleTrace, (const char *) "module: %s [%s] registering", 27, modulename, libname);
+      moveTo (M2Dependent_unordered, CreateModule (modulename, libname, init, fini, dependencies));
+      traceprintf (ModuleTrace, (const char *) "\\n", 2);
+    }
+  else
+    {
+      warning3 ((const char *) "module: %s [%s] (ignoring duplicate registration)\\n", 51, modulename, libname);
     }
 }
 
@@ -1388,16 +1385,13 @@ extern "C" void M2Dependent_RegisterModule (void * modulename, void * libname, M
 /*
    RequestDependant - used to specify that modulename is dependant upon
                       module dependantmodule.  It only takes effect
-                      if we are not using StaticInitialization.
+                      if we are using DynamicInitialization.
 */
 
 extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname)
 {
   CheckInitialized ();
-  if (! M2LINK_StaticInitialization)
-    {
-      PerformRequestDependant (modulename, libname, dependantmodule, dependantlibname);
-    }
+  PerformRequestDependant (modulename, libname, dependantmodule, dependantlibname);
 }
 
 extern "C" void _M2_M2Dependent_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
diff --git a/gcc/m2/pge-boot/GM2Dependent.h b/gcc/m2/pge-boot/GM2Dependent.h
index c820ae14a8f..caa49e754c6 100644
--- a/gcc/m2/pge-boot/GM2Dependent.h
+++ b/gcc/m2/pge-boot/GM2Dependent.h
@@ -29,9 +29,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #if !defined (_M2Dependent_H)
 #   define _M2Dependent_H
 
+#include "config.h"
+#include "system.h"
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -51,7 +54,7 @@ typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP;
 typedef void (*M2Dependent_ArgCVEnvP_t) (int, void *, void *);
 struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; };
 
-EXTERN void M2Dependent_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+EXTERN void M2Dependent_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 EXTERN void M2Dependent_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
 
 /*
diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.cc b/gcc/m2/pge-boot/GM2EXCEPTION.cc
index cf19a4e18b7..d15493527cf 100644
--- a/gcc/m2/pge-boot/GM2EXCEPTION.cc
+++ b/gcc/m2/pge-boot/GM2EXCEPTION.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -42,7 +43,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 typedef enum {M2EXCEPTION_indexException, M2EXCEPTION_rangeException, M2EXCEPTION_caseSelectException, M2EXCEPTION_invalidLocation, M2EXCEPTION_functionException, M2EXCEPTION_wholeValueException, M2EXCEPTION_wholeDivException, M2EXCEPTION_realValueException, M2EXCEPTION_realDivException, M2EXCEPTION_complexValueException, M2EXCEPTION_complexDivException, M2EXCEPTION_protException, M2EXCEPTION_sysException, M2EXCEPTION_coException, M2EXCEPTION_exException} M2EXCEPTION_M2Exceptions;
 
 extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void);
-extern "C" unsigned int M2EXCEPTION_IsM2Exception (void);
+extern "C" bool M2EXCEPTION_IsM2Exception (void);
 
 extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void)
 {
@@ -66,7 +67,7 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void)
   __builtin_unreachable ();
 }
 
-extern "C" unsigned int M2EXCEPTION_IsM2Exception (void)
+extern "C" bool M2EXCEPTION_IsM2Exception (void)
 {
   RTExceptions_EHBlock e;
 
diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.h b/gcc/m2/pge-boot/GM2EXCEPTION.h
index 8dd781f6bb3..1ef236732bc 100644
--- a/gcc/m2/pge-boot/GM2EXCEPTION.h
+++ b/gcc/m2/pge-boot/GM2EXCEPTION.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -50,7 +51,7 @@ extern "C" {
 typedef enum {M2EXCEPTION_indexException, M2EXCEPTION_rangeException, M2EXCEPTION_caseSelectException, M2EXCEPTION_invalidLocation, M2EXCEPTION_functionException, M2EXCEPTION_wholeValueException, M2EXCEPTION_wholeDivException, M2EXCEPTION_realValueException, M2EXCEPTION_realDivException, M2EXCEPTION_complexValueException, M2EXCEPTION_complexDivException, M2EXCEPTION_protException, M2EXCEPTION_sysException, M2EXCEPTION_coException, M2EXCEPTION_exException} M2EXCEPTION_M2Exceptions;
 
 EXTERN M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void);
-EXTERN unsigned int M2EXCEPTION_IsM2Exception (void);
+EXTERN bool M2EXCEPTION_IsM2Exception (void);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GM2LINK.cc b/gcc/m2/pge-boot/GM2LINK.cc
deleted file mode 100644
index a934d6ada1c..00000000000
--- a/gcc/m2/pge-boot/GM2LINK.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-/* GM2LINK.c a handwritten module for mc.
-
-Copyright (C) 2022-2023 Free Software Foundation, Inc.
-Contributed by Gaius Mulley <gaiusmod2@gmail.com>.
-
-This file is part of GNU Modula-2.
-
-GNU Modula-2 is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU Modula-2 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Modula-2; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
-
-/* mc currently is built using a static scaffold.  */
-
-#include <cstddef>
-
-int M2LINK_StaticInitialization = 1;
-char *M2LINK_ForcedModuleInitOrder = NULL;
diff --git a/gcc/m2/pge-boot/GM2LINK.h b/gcc/m2/pge-boot/GM2LINK.h
deleted file mode 100644
index 890e3b3185d..00000000000
--- a/gcc/m2/pge-boot/GM2LINK.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* do not edit automatically generated by mc from M2LINK.  */
-/* M2LINK.def defines the linking mode used in Modula-2.
-
-Copyright (C) 2022-2023 Free Software Foundation, Inc.
-Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
-
-This file is part of GNU Modula-2.
-
-GNU Modula-2 is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU Modula-2 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-
-#if !defined (_M2LINK_H)
-#   define _M2LINK_H
-
-#include "config.h"
-#include "system.h"
-#   ifdef __cplusplus
-extern "C" {
-#   endif
-#   if !defined (PROC_D)
-#      define PROC_D
-       typedef void (*PROC_t) (void);
-       typedef struct { PROC_t proc; } PROC;
-#   endif
-
-
-#   if defined (_M2LINK_C)
-#      define EXTERN
-#   else
-#      define EXTERN extern
-#   endif
-
-typedef char *M2LINK_PtrToChar;
-
-EXTERN M2LINK_PtrToChar M2LINK_ForcedModuleInitOrder;
-EXTERN unsigned int M2LINK_StaticInitialization;
-#   ifdef __cplusplus
-}
-#   endif
-
-#   undef EXTERN
-#endif
diff --git a/gcc/m2/pge-boot/GM2RTS.cc b/gcc/m2/pge-boot/GM2RTS.cc
index d283f3f7f79..6b9d1f9cef1 100644
--- a/gcc/m2/pge-boot/GM2RTS.cc
+++ b/gcc/m2/pge-boot/GM2RTS.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -90,16 +91,16 @@ struct M2RTS__T1_r {
 static M2RTS_ProcedureList InitialProc;
 static M2RTS_ProcedureList TerminateProc;
 static int ExitValue;
-static unsigned int isHalting;
-static unsigned int CallExit;
-static unsigned int Initialized;
+static bool isHalting;
+static bool CallExit;
+static bool Initialized;
 
 /*
    ConstructModules - resolve dependencies and then call each
                       module constructor in turn.
 */
 
-extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 
 /*
    DeconstructModules - resolve dependencies and then call each
@@ -131,7 +132,7 @@ extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void
                                  procedure is installed.
 */
 
-extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+extern "C" bool M2RTS_InstallTerminationProcedure (PROC p);
 
 /*
    ExecuteInitialProcedures - executes the initial procedures installed by
@@ -146,7 +147,7 @@ extern "C" void M2RTS_ExecuteInitialProcedures (void);
                              main program module.
 */
 
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p);
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p);
 
 /*
    ExecuteTerminationProcedures - calls each installed termination procedure
@@ -183,7 +184,7 @@ extern "C" void M2RTS_HALT (int exitcode);
           to stderr and calls exit (1).
 */
 
-extern "C" void M2RTS_Halt (const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high, const char *description_, unsigned int _description_high);
+extern "C" void M2RTS_Halt (const char *description_, unsigned int _description_high, const char *filename_, unsigned int _filename_high, const char *function_, unsigned int _function_high, unsigned int line);
 
 /*
    HaltC - provides a more user friendly version of HALT, which takes
@@ -191,7 +192,7 @@ extern "C" void M2RTS_Halt (const char *filename_, unsigned int _filename_high,
            to stderr and calls exit (1).
 */
 
-extern "C" void M2RTS_HaltC (void * filename, unsigned int line, void * function, void * description);
+extern "C" void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line);
 
 /*
    ExitOnHalt - if HALT is executed then call exit with the exit code, e.
@@ -250,7 +251,7 @@ static void ExecuteReverse (M2RTS_ProcedureChain procptr);
                 defined by proclist.
 */
 
-static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc);
+static bool AppendProc (M2RTS_ProcedureList *proclist, PROC proc);
 
 /*
    ErrorString - writes a string to stderr.
@@ -313,7 +314,7 @@ static void ExecuteReverse (M2RTS_ProcedureChain procptr)
                 defined by proclist.
 */
 
-static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
+static bool AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
 {
   M2RTS_ProcedureChain pdes;
 
@@ -326,7 +327,7 @@ static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
       (*proclist).head = pdes;
     }
   (*proclist).tail = pdes;
-  return TRUE;
+  return true;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -410,8 +411,8 @@ static void Init (void)
   InitProcList (&InitialProc);
   InitProcList (&TerminateProc);
   ExitValue = 0;
-  isHalting = FALSE;
-  CallExit = FALSE;  /* default by calling abort  */
+  isHalting = false;
+  CallExit = false;  /* default by calling abort  */
 }
 
 
@@ -426,7 +427,7 @@ static void CheckInitialized (void)
 {
   if (! Initialized)
     {
-      Initialized = TRUE;
+      Initialized = true;
       Init ();
     }
 }
@@ -437,9 +438,9 @@ static void CheckInitialized (void)
                       module constructor in turn.
 */
 
-extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp)
+extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp)
 {
-  M2Dependent_ConstructModules (applicationmodule, libname, argc, argv, envp);
+  M2Dependent_ConstructModules (applicationmodule, libname, overrideliborder, argc, argv, envp);
 }
 
 
@@ -485,7 +486,7 @@ extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void
                                  procedure is installed.
 */
 
-extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p)
+extern "C" bool M2RTS_InstallTerminationProcedure (PROC p)
 {
   return AppendProc (&TerminateProc, p);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -510,7 +511,7 @@ extern "C" void M2RTS_ExecuteInitialProcedures (void)
                              main program module.
 */
 
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p)
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p)
 {
   return AppendProc (&InitialProc, p);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -557,7 +558,7 @@ extern "C" void M2RTS_HALT (int exitcode)
 {
   if (exitcode != -1)
     {
-      CallExit = TRUE;
+      CallExit = true;
       ExitValue = exitcode;
     }
   if (isHalting)
@@ -567,7 +568,7 @@ extern "C" void M2RTS_HALT (int exitcode)
     }
   else
     {
-      isHalting = TRUE;
+      isHalting = true;
       M2RTS_ExecuteTerminationProcedures ();
     }
   if (CallExit)
@@ -587,16 +588,16 @@ extern "C" void M2RTS_HALT (int exitcode)
           to stderr and calls exit (1).
 */
 
-extern "C" void M2RTS_Halt (const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high, const char *description_, unsigned int _description_high)
+extern "C" void M2RTS_Halt (const char *description_, unsigned int _description_high, const char *filename_, unsigned int _filename_high, const char *function_, unsigned int _function_high, unsigned int line)
 {
+  char description[_description_high+1];
   char filename[_filename_high+1];
   char function[_function_high+1];
-  char description[_description_high+1];
 
   /* make a local copy of each unbounded array.  */
+  memcpy (description, description_, _description_high+1);
   memcpy (filename, filename_, _filename_high+1);
   memcpy (function, function_, _function_high+1);
-  memcpy (description, description_, _description_high+1);
 
   M2RTS_ErrorMessage ((const char *) description, _description_high, (const char *) filename, _filename_high, line, (const char *) function, _function_high);
 }
@@ -608,7 +609,7 @@ extern "C" void M2RTS_Halt (const char *filename_, unsigned int _filename_high,
            to stderr and calls exit (1).
 */
 
-extern "C" void M2RTS_HaltC (void * filename, unsigned int line, void * function, void * description)
+extern "C" void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line)
 {
   ErrorMessageC (description, filename, line, function);
 }
@@ -621,7 +622,7 @@ extern "C" void M2RTS_HaltC (void * filename, unsigned int line, void * function
 extern "C" void M2RTS_ExitOnHalt (int e)
 {
   ExitValue = e;
-  CallExit = TRUE;
+  CallExit = true;
 }
 
 
diff --git a/gcc/m2/pge-boot/GM2RTS.h b/gcc/m2/pge-boot/GM2RTS.h
index 37cbb1a13d7..d9acb54dd6c 100644
--- a/gcc/m2/pge-boot/GM2RTS.h
+++ b/gcc/m2/pge-boot/GM2RTS.h
@@ -29,9 +29,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #if !defined (_M2RTS_H)
 #   define _M2RTS_H
 
+#include "config.h"
+#include "system.h"
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -51,7 +54,7 @@ typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP;
 typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *);
 struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; };
 
-EXTERN void M2RTS_ConstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
+EXTERN void M2RTS_ConstructModules (void * applicationmodule, void * libname, void * overrideliborder, int argc, void * argv, void * envp);
 EXTERN void M2RTS_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
 
 /*
@@ -77,7 +80,7 @@ EXTERN void M2RTS_RequestDependant (void * modulename, void * libname, void * de
                                  procedure is installed.
 */
 
-EXTERN unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+EXTERN bool M2RTS_InstallTerminationProcedure (PROC p);
 
 /*
    ExecuteInitialProcedures - executes the initial procedures installed
@@ -92,7 +95,7 @@ EXTERN void M2RTS_ExecuteInitialProcedures (void);
                              program module.
 */
 
-EXTERN unsigned int M2RTS_InstallInitialProcedure (PROC p);
+EXTERN bool M2RTS_InstallInitialProcedure (PROC p);
 
 /*
    ExecuteTerminationProcedures - calls each installed termination procedure
@@ -128,7 +131,7 @@ EXTERN void M2RTS_HALT (int exitcode) __attribute__ ((noreturn));
            to stderr and calls exit (1).
 */
 
-EXTERN void M2RTS_Halt (const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high, const char *description_, unsigned int _description_high) __attribute__ ((noreturn));
+EXTERN void M2RTS_Halt (const char *description_, unsigned int _description_high, const char *filename_, unsigned int _filename_high, const char *function_, unsigned int _function_high, unsigned int line) __attribute__ ((noreturn));
 
 /*
    HaltC - provides a more user friendly version of HALT, which takes
@@ -136,7 +139,7 @@ EXTERN void M2RTS_Halt (const char *filename_, unsigned int _filename_high, unsi
            to stderr and calls exit (1).
 */
 
-EXTERN void M2RTS_HaltC (void * filename, unsigned int line, void * function, void * description) __attribute__ ((noreturn));
+EXTERN void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line) __attribute__ ((noreturn));
 
 /*
    ExitOnHalt - if HALT is executed then call exit with the exit code, e.
diff --git a/gcc/m2/pge-boot/GNameKey.cc b/gcc/m2/pge-boot/GNameKey.cc
index ff8621f959d..5df940d8dd2 100644
--- a/gcc/m2/pge-boot/GNameKey.cc
+++ b/gcc/m2/pge-boot/GNameKey.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -116,7 +117,7 @@ extern "C" unsigned int NameKey_LengthKey (NameKey_Name Key);
            converting, a, into a String, for speed.
 */
 
-extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high);
+extern "C" bool NameKey_IsKey (const char *a_, unsigned int _a_high);
 
 /*
    KeyToCharStar - returns the C char * string equivalent for, key.
@@ -130,7 +131,7 @@ extern "C" void NameKey_WriteKey (NameKey_Name key);
                          This function deliberately inlines CAP for speed.
 */
 
-extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2);
+extern "C" bool NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2);
 
 /*
    KeyToCharStar - returns the C char * string equivalent for, key.
@@ -439,7 +440,7 @@ extern "C" unsigned int NameKey_LengthKey (NameKey_Name Key)
            converting, a, into a String, for speed.
 */
 
-extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high)
+extern "C" bool NameKey_IsKey (const char *a_, unsigned int _a_high)
 {
   NameKey_NameNode child;
   NameKey_PtrToChar p;
@@ -479,7 +480,7 @@ extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high)
                     /* avoid gcc warning by using compound statement even if not strictly necessary.  */
                     if ((*p) == ASCII_nul)
                       {
-                        return TRUE;
+                        return true;
                       }
                     else
                       {
@@ -492,7 +493,7 @@ extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high)
           }
       } while (! (child == NULL));
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -521,7 +522,7 @@ extern "C" void NameKey_WriteKey (NameKey_Name key)
                          This function deliberately inlines CAP for speed.
 */
 
-extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2)
+extern "C" bool NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2)
 {
   NameKey_PtrToChar pi;
   NameKey_PtrToChar pj;
@@ -530,7 +531,7 @@ extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_
 
   if (key1 == key2)
     {
-      return TRUE;
+      return true;
     }
   else
     {
@@ -550,7 +551,7 @@ extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_
           else
             {
               /* difference found  */
-              return FALSE;
+              return false;
             }
         }
       return c1 == c2;
diff --git a/gcc/m2/pge-boot/GNameKey.h b/gcc/m2/pge-boot/GNameKey.h
index 90472ecc58e..868a9b4d2fd 100644
--- a/gcc/m2/pge-boot/GNameKey.h
+++ b/gcc/m2/pge-boot/GNameKey.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -83,7 +84,7 @@ EXTERN unsigned int NameKey_LengthKey (NameKey_Name Key);
    IsKey - returns TRUE if string, a, is currently a key.
 */
 
-EXTERN unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high);
+EXTERN bool NameKey_IsKey (const char *a_, unsigned int _a_high);
 
 /*
    WriteKey - Display the symbol represented by Key.
@@ -96,7 +97,7 @@ EXTERN void NameKey_WriteKey (NameKey_Name key);
                          the same. It is case insensitive.
 */
 
-EXTERN unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2);
+EXTERN bool NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2);
 
 /*
    KeyToCharStar - returns the C char * string equivalent for, key.
diff --git a/gcc/m2/pge-boot/GNumberIO.cc b/gcc/m2/pge-boot/GNumberIO.cc
index 0e058df5d64..f560fa1b80a 100644
--- a/gcc/m2/pge-boot/GNumberIO.cc
+++ b/gcc/m2/pge-boot/GNumberIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -191,7 +192,7 @@ extern "C" void NumberIO_CardToStr (unsigned int x, unsigned int n, char *a, uns
 extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsigned int *x)
 {
   unsigned int i;
-  unsigned int ok;
+  bool ok;
   unsigned int higha;
   char a[_a_high+1];
 
@@ -201,7 +202,7 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
   StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
   higha = StrLib_StrLen ((const char *) a, _a_high);
   i = 0;
-  ok = TRUE;
+  ok = true;
   while (ok)
     {
       if (i < higha)
@@ -212,18 +213,18 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
             }
           else
             {
-              ok = FALSE;
+              ok = false;
             }
         }
       else
         {
-          ok = FALSE;
+          ok = false;
         }
     }
   (*x) = 0;
   if (i < higha)
     {
-      ok = TRUE;
+      ok = true;
       do {
         (*x) = (10*(*x))+( ((unsigned int) (a[i]))- ((unsigned int) ('0')));
         if (i < higha)
@@ -232,12 +233,12 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
             i += 1;
             if ((a[i] < '0') || (a[i] > '9'))
               {
-                ok = FALSE;
+                ok = false;
               }
           }
         else
           {
-            ok = FALSE;
+            ok = false;
           }
       } while (! (! ok));
     }
@@ -315,12 +316,12 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
   unsigned int c;
   unsigned int Higha;
   IntToStr__T9 buf;
-  unsigned int Negative;
+  bool Negative;
 
   if (x < 0)
     {
       /* avoid dangling else.  */
-      Negative = TRUE;
+      Negative = true;
       c = ((unsigned int ) (abs (x+1)))+1;
       if (n > 0)
         {
@@ -330,7 +331,7 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
   else
     {
       c = x;
-      Negative = FALSE;
+      Negative = false;
     }
   i = 0;
   do {
@@ -373,8 +374,8 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
 extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
 {
   unsigned int i;
-  unsigned int ok;
-  unsigned int Negative;
+  bool ok;
+  bool Negative;
   unsigned int higha;
   char a[_a_high+1];
 
@@ -384,8 +385,8 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
   StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
   higha = StrLib_StrLen ((const char *) a, _a_high);
   i = 0;
-  Negative = FALSE;
-  ok = TRUE;
+  Negative = false;
+  ok = true;
   while (ok)
     {
       if (i < higha)
@@ -403,18 +404,18 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
           else
             {
               /* avoid dangling else.  */
-              ok = FALSE;
+              ok = false;
             }
         }
       else
         {
-          ok = FALSE;
+          ok = false;
         }
     }
   (*x) = 0;
   if (i < higha)
     {
-      ok = TRUE;
+      ok = true;
       do {
         if (Negative)
           {
@@ -430,12 +431,12 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
             i += 1;
             if ((a[i] < '0') || (a[i] > '9'))
               {
-                ok = FALSE;
+                ok = false;
               }
           }
         else
           {
-            ok = FALSE;
+            ok = false;
           }
       } while (! (! ok));
     }
@@ -598,7 +599,7 @@ extern "C" void NumberIO_StrToBin (const char *a_, unsigned int _a_high, unsigne
 extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int *x)
 {
   unsigned int i;
-  unsigned int ok;
+  bool ok;
   unsigned int higha;
   char a[_a_high+1];
 
@@ -608,7 +609,7 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
   StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
   higha = StrLib_StrLen ((const char *) a, _a_high);
   i = 0;
-  ok = TRUE;
+  ok = true;
   while (ok)
     {
       if (i < higha)
@@ -619,18 +620,18 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
             }
           else
             {
-              ok = FALSE;
+              ok = false;
             }
         }
       else
         {
-          ok = FALSE;
+          ok = false;
         }
     }
   (*x) = 0;
   if (i < higha)
     {
-      ok = TRUE;
+      ok = true;
       do {
         (*x) = (2*(*x))+((int ) ( ((unsigned int) (a[i]))- ((unsigned int) ('0'))));
         if (i < higha)
@@ -639,12 +640,12 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
             i += 1;
             if ((a[i] < '0') || (a[i] > '1'))
               {
-                ok = FALSE;
+                ok = false;
               }
           }
         else
           {
-            ok = FALSE;
+            ok = false;
           }
       } while (! (! ok));
     }
@@ -653,7 +654,7 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
 extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int *x)
 {
   unsigned int i;
-  unsigned int ok;
+  bool ok;
   unsigned int higha;
   char a[_a_high+1];
 
@@ -663,14 +664,14 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
   StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
   higha = StrLib_StrLen ((const char *) a, _a_high);
   i = 0;
-  ok = TRUE;
+  ok = true;
   while (ok)
     {
       if (i < higha)
         {
           if (((a[i] >= '0') && (a[i] <= '9')) || ((a[i] >= 'A') && (a[i] <= 'F')))
             {
-              ok = FALSE;
+              ok = false;
             }
           else
             {
@@ -679,13 +680,13 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
         }
       else
         {
-          ok = FALSE;
+          ok = false;
         }
     }
   (*x) = 0;
   if (i < higha)
     {
-      ok = TRUE;
+      ok = true;
       do {
         if ((a[i] >= '0') && (a[i] <= '9'))
           {
@@ -702,12 +703,12 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
             i += 1;
             if (((a[i] < '0') || (a[i] > '9')) && ((a[i] < 'A') || (a[i] > 'F')))
               {
-                ok = FALSE;
+                ok = false;
               }
           }
         else
           {
-            ok = FALSE;
+            ok = false;
           }
       } while (! (! ok));
     }
@@ -716,7 +717,7 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
 extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int *x)
 {
   unsigned int i;
-  unsigned int ok;
+  bool ok;
   unsigned int higha;
   char a[_a_high+1];
 
@@ -726,7 +727,7 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
   StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
   higha = StrLib_StrLen ((const char *) a, _a_high);
   i = 0;
-  ok = TRUE;
+  ok = true;
   while (ok)
     {
       if (i < higha)
@@ -737,18 +738,18 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
             }
           else
             {
-              ok = FALSE;
+              ok = false;
             }
         }
       else
         {
-          ok = FALSE;
+          ok = false;
         }
     }
   (*x) = 0;
   if (i < higha)
     {
-      ok = TRUE;
+      ok = true;
       do {
         (*x) = (8*(*x))+((int ) ( ((unsigned int) (a[i]))- ((unsigned int) ('0'))));
         if (i < higha)
@@ -757,12 +758,12 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
             i += 1;
             if ((a[i] < '0') || (a[i] > '7'))
               {
-                ok = FALSE;
+                ok = false;
               }
           }
         else
           {
-            ok = FALSE;
+            ok = false;
           }
       } while (! (! ok));
     }
diff --git a/gcc/m2/pge-boot/GNumberIO.h b/gcc/m2/pge-boot/GNumberIO.h
index 1a5690e1c25..a18fb256e01 100644
--- a/gcc/m2/pge-boot/GNumberIO.h
+++ b/gcc/m2/pge-boot/GNumberIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GOutput.cc b/gcc/m2/pge-boot/GOutput.cc
index 22ec0e7b8cf..32618fe362a 100644
--- a/gcc/m2/pge-boot/GOutput.cc
+++ b/gcc/m2/pge-boot/GOutput.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -52,7 +53,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   include "GASCII.h"
 #   include "GDynamicStrings.h"
 
-static unsigned int stdout_;
+static bool stdout_;
 static FIO_File outputFile;
 static DynamicStrings_String buffer;
 
@@ -61,7 +62,7 @@ static DynamicStrings_String buffer;
           TRUE is returned if success, FALSE otherwise.
 */
 
-extern "C" unsigned int Output_Open (const char *filename_, unsigned int _filename_high);
+extern "C" bool Output_Open (const char *filename_, unsigned int _filename_high);
 
 /*
    Close - close the output file.
@@ -129,7 +130,7 @@ extern "C" DynamicStrings_String Output_EndBuffer (void);
           TRUE is returned if success, FALSE otherwise.
 */
 
-extern "C" unsigned int Output_Open (const char *filename_, unsigned int _filename_high)
+extern "C" bool Output_Open (const char *filename_, unsigned int _filename_high)
 {
   char filename[_filename_high+1];
 
@@ -139,13 +140,13 @@ extern "C" unsigned int Output_Open (const char *filename_, unsigned int _filena
   if ((StrLib_StrEqual ((const char *) filename, _filename_high, (const char *) "<stdout>", 8)) || (StrLib_StrEqual ((const char *) filename, _filename_high, (const char *) "-", 1)))
     {
       outputFile = FIO_StdOut;
-      stdout_ = TRUE;
-      return TRUE;
+      stdout_ = true;
+      return true;
     }
   else
     {
       outputFile = FIO_OpenToWrite ((const char *) filename, _filename_high);
-      stdout_ = FALSE;
+      stdout_ = false;
       return FIO_IsNoError (outputFile);
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -305,7 +306,7 @@ extern "C" DynamicStrings_String Output_EndBuffer (void)
 
 extern "C" void _M2_Output_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
 {
-  stdout_ = TRUE;
+  stdout_ = true;
   buffer = static_cast<DynamicStrings_String> (NULL);
   outputFile = FIO_StdOut;
 }
diff --git a/gcc/m2/pge-boot/GOutput.h b/gcc/m2/pge-boot/GOutput.h
index 59f14d029d6..3f59e5e83ec 100644
--- a/gcc/m2/pge-boot/GOutput.h
+++ b/gcc/m2/pge-boot/GOutput.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -50,7 +51,7 @@ extern "C" {
           TRUE is returned if success, FALSE otherwise.
 */
 
-EXTERN unsigned int Output_Open (const char *filename_, unsigned int _filename_high);
+EXTERN bool Output_Open (const char *filename_, unsigned int _filename_high);
 
 /*
    Close - close the output file.
diff --git a/gcc/m2/pge-boot/GPushBackInput.cc b/gcc/m2/pge-boot/GPushBackInput.cc
index 3165ce12be4..faf04ed3ad7 100644
--- a/gcc/m2/pge-boot/GPushBackInput.cc
+++ b/gcc/m2/pge-boot/GPushBackInput.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -69,7 +70,7 @@ static unsigned int ExitStatus;
 static unsigned int Column;
 static unsigned int StackPtr;
 static unsigned int LineNo;
-static unsigned int Debugging;
+static bool Debugging;
 
 /*
    Open - opens a file for reading.
@@ -142,7 +143,7 @@ extern "C" unsigned int PushBackInput_GetExitStatus (void);
    SetDebug - sets the debug flag on or off.
 */
 
-extern "C" void PushBackInput_SetDebug (unsigned int d);
+extern "C" void PushBackInput_SetDebug (bool d);
 
 /*
    GetColumnPosition - returns the column position of the current character.
@@ -275,7 +276,7 @@ extern "C" char PushBackInput_PutCh (char ch)
     }
   else
     {
-      Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, 150, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54);
+      Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutCh", 5, 151);
     }
   return ch;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -301,7 +302,7 @@ extern "C" void PushBackInput_PutString (const char *a_, unsigned int _a_high)
       l -= 1;
       if ((PushBackInput_PutCh (a[l])) != a[l])
         {
-          Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54);
+          Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutString", 9, 132);
         }
     }
 }
@@ -322,7 +323,7 @@ extern "C" void PushBackInput_PutStr (DynamicStrings_String s)
       i -= 1;
       if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast<int> (i)))) != (DynamicStrings_char (s, static_cast<int> (i))))
         {
-          Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54);
+          Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutStr", 6, 113);
         }
     }
 }
@@ -442,7 +443,7 @@ extern "C" unsigned int PushBackInput_GetExitStatus (void)
    SetDebug - sets the debug flag on or off.
 */
 
-extern "C" void PushBackInput_SetDebug (unsigned int d)
+extern "C" void PushBackInput_SetDebug (bool d)
 {
   Debugging = d;
 }
@@ -480,7 +481,7 @@ extern "C" unsigned int PushBackInput_GetCurrentLine (void)
 
 extern "C" void _M2_PushBackInput_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
 {
-  PushBackInput_SetDebug (FALSE);
+  PushBackInput_SetDebug (false);
   Init ();
 }
 
diff --git a/gcc/m2/pge-boot/GPushBackInput.h b/gcc/m2/pge-boot/GPushBackInput.h
index ce7cc8e5137..09a65f516eb 100644
--- a/gcc/m2/pge-boot/GPushBackInput.h
+++ b/gcc/m2/pge-boot/GPushBackInput.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -121,7 +122,7 @@ EXTERN unsigned int PushBackInput_GetExitStatus (void);
    SetDebug - sets the debug flag on or off.
 */
 
-EXTERN void PushBackInput_SetDebug (unsigned int d);
+EXTERN void PushBackInput_SetDebug (bool d);
 
 /*
    GetColumnPosition - returns the column position of the current character.
diff --git a/gcc/m2/pge-boot/GRTExceptions.cc b/gcc/m2/pge-boot/GRTExceptions.cc
index 5c2eccc2eac..b1baafbd568 100644
--- a/gcc/m2/pge-boot/GRTExceptions.cc
+++ b/gcc/m2/pge-boot/GRTExceptions.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -95,7 +96,7 @@ struct RTExceptions__T3_r {
                             RTExceptions_Handler stack;
                           };
 
-static unsigned int inException;
+static bool inException;
 static RTExceptions_Handler freeHandler;
 static RTExceptions_EHBlock freeEHB;
 static RTExceptions_EHBlock currentEHB;
@@ -188,7 +189,7 @@ extern "C" void RTExceptions_BaseExceptionsThrow (void);
                         in the exception state.
 */
 
-extern "C" unsigned int RTExceptions_IsInExceptionState (void);
+extern "C" bool RTExceptions_IsInExceptionState (void);
 
 /*
    SetExceptionState - returns the current exception state and
@@ -196,7 +197,7 @@ extern "C" unsigned int RTExceptions_IsInExceptionState (void);
                        to.
 */
 
-extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to);
+extern "C" bool RTExceptions_SetExceptionState (bool to);
 
 /*
    SwitchExceptionState - assigns, from, with the current exception
@@ -204,7 +205,7 @@ extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to);
                           to, to.
 */
 
-extern "C" void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to);
+extern "C" void RTExceptions_SwitchExceptionState (bool *from, bool to);
 
 /*
    GetBaseExceptionBlock - returns the initial language exception block
@@ -724,7 +725,7 @@ static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h)
 
 static void indexf (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 613, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
 }
 
 
@@ -734,7 +735,7 @@ static void indexf (void * a)
 
 static void range (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 625, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
 }
 
 
@@ -744,7 +745,7 @@ static void range (void * a)
 
 static void casef (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 637, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
 }
 
 
@@ -754,7 +755,7 @@ static void casef (void * a)
 
 static void invalidloc (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 649, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
 }
 
 
@@ -764,7 +765,7 @@ static void invalidloc (void * a)
 
 static void function (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 661, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... ")));  /* --fixme-- what has happened ?  */
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... ")));  /* --fixme-- what has happened ?  */
 }
 
 
@@ -774,7 +775,7 @@ static void function (void * a)
 
 static void wholevalue (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 673, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
 }
 
 
@@ -784,7 +785,7 @@ static void wholevalue (void * a)
 
 static void wholediv (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 685, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
 }
 
 
@@ -794,7 +795,7 @@ static void wholediv (void * a)
 
 static void realvalue (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 697, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
 }
 
 
@@ -804,7 +805,7 @@ static void realvalue (void * a)
 
 static void realdiv (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 709, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
 }
 
 
@@ -814,7 +815,7 @@ static void realdiv (void * a)
 
 static void complexvalue (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 721, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
 }
 
 
@@ -824,7 +825,7 @@ static void complexvalue (void * a)
 
 static void complexdiv (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 733, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
 }
 
 
@@ -834,7 +835,7 @@ static void complexdiv (void * a)
 
 static void protection (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 745, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
 }
 
 
@@ -844,7 +845,7 @@ static void protection (void * a)
 
 static void systemf (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 757, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
 }
 
 
@@ -854,7 +855,7 @@ static void systemf (void * a)
 
 static void coroutine (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 769, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
 }
 
 
@@ -864,7 +865,7 @@ static void coroutine (void * a)
 
 static void exception (void * a)
 {
-  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 781, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
+  RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
 }
 
 
@@ -874,7 +875,7 @@ static void exception (void * a)
 
 static void Init (void)
 {
-  inException = FALSE;
+  inException = false;
   freeHandler = NULL;
   freeEHB = NULL;
   currentEHB = RTExceptions_InitExceptionBlock ();
@@ -1077,7 +1078,6 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n
 extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int number)
 {
   RTExceptions_Handler h;
-  RTExceptions_Handler i;
 
   h = findHandler (e, number);
   if (h != NULL)
@@ -1135,7 +1135,7 @@ extern "C" void RTExceptions_BaseExceptionsThrow (void)
                         in the exception state.
 */
 
-extern "C" unsigned int RTExceptions_IsInExceptionState (void)
+extern "C" bool RTExceptions_IsInExceptionState (void)
 {
   return inException;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -1149,9 +1149,9 @@ extern "C" unsigned int RTExceptions_IsInExceptionState (void)
                        to.
 */
 
-extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to)
+extern "C" bool RTExceptions_SetExceptionState (bool to)
 {
-  unsigned int old;
+  bool old;
 
   old = inException;
   inException = to;
@@ -1167,7 +1167,7 @@ extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to)
                           to, to.
 */
 
-extern "C" void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to)
+extern "C" void RTExceptions_SwitchExceptionState (bool *from, bool to)
 {
   (*from) = inException;
   inException = to;
@@ -1183,7 +1183,7 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void)
 {
   if (currentEHB == NULL)
     {
-      M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod", 53, 599, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39);
+      M2RTS_Halt ((const char *) "currentEHB has not been initialized yet", 39, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod", 53, (const char *) "GetBaseExceptionBlock", 21, 600);
     }
   else
     {
diff --git a/gcc/m2/pge-boot/GRTExceptions.h b/gcc/m2/pge-boot/GRTExceptions.h
index 9f36bdd9eea..c48f7bbde03 100644
--- a/gcc/m2/pge-boot/GRTExceptions.h
+++ b/gcc/m2/pge-boot/GRTExceptions.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -65,7 +66,7 @@ struct RTExceptions_ProcedureHandler_p { RTExceptions_ProcedureHandler_t proc; }
            and message in the EHBlock for later use.
 */
 
-EXTERN void RTExceptions_Raise (unsigned int number, void * file, unsigned int line, unsigned int column, void * function, void * message);
+EXTERN void RTExceptions_Raise (unsigned int number, void * file, unsigned int line, unsigned int column, void * function, void * message) __attribute__ ((noreturn));
 
 /*
    SetExceptionBlock - sets, source, as the active EHB.
@@ -146,7 +147,7 @@ EXTERN void RTExceptions_BaseExceptionsThrow (void);
                         in the exception state.
 */
 
-EXTERN unsigned int RTExceptions_IsInExceptionState (void);
+EXTERN bool RTExceptions_IsInExceptionState (void);
 
 /*
    SetExceptionState - returns the current exception state and
@@ -154,7 +155,7 @@ EXTERN unsigned int RTExceptions_IsInExceptionState (void);
                        to.
 */
 
-EXTERN unsigned int RTExceptions_SetExceptionState (unsigned int to);
+EXTERN bool RTExceptions_SetExceptionState (bool to);
 
 /*
    SwitchExceptionState - assigns, from, with the current exception
@@ -162,7 +163,7 @@ EXTERN unsigned int RTExceptions_SetExceptionState (unsigned int to);
                           to, to.
 */
 
-EXTERN void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to);
+EXTERN void RTExceptions_SwitchExceptionState (bool *from, bool to);
 
 /*
    GetBaseExceptionBlock - returns the initial language exception block
diff --git a/gcc/m2/pge-boot/GSArgs.h b/gcc/m2/pge-boot/GSArgs.h
index 631aaa79200..087238acf11 100644
--- a/gcc/m2/pge-boot/GSArgs.h
+++ b/gcc/m2/pge-boot/GSArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ extern "C" {
             new string, otherwise s is set to NIL.
 */
 
-EXTERN unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
+EXTERN bool SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
 
 /*
    Narg - returns the number of arguments available from
diff --git a/gcc/m2/pge-boot/GSEnvironment.h b/gcc/m2/pge-boot/GSEnvironment.h
index 13f14d67bef..df8d5cd5ccd 100644
--- a/gcc/m2/pge-boot/GSEnvironment.h
+++ b/gcc/m2/pge-boot/GSEnvironment.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ extern "C" {
                     the processes environment.
 */
 
-EXTERN unsigned int SEnvironment_GetEnvironment (DynamicStrings_String Env, DynamicStrings_String *dest);
+EXTERN bool SEnvironment_GetEnvironment (DynamicStrings_String Env, DynamicStrings_String *dest);
 
 /*
    PutEnvironment - change or add an environment variable definition EnvDef.
@@ -64,7 +65,7 @@ EXTERN unsigned int SEnvironment_GetEnvironment (DynamicStrings_String Env, Dyna
                     set or changed successfully.
 */
 
-EXTERN unsigned int SEnvironment_PutEnvironment (DynamicStrings_String EnvDef);
+EXTERN bool SEnvironment_PutEnvironment (DynamicStrings_String EnvDef);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GSFIO.cc b/gcc/m2/pge-boot/GSFIO.cc
index 4ecfec8e9d2..9bd827a90fb 100644
--- a/gcc/m2/pge-boot/GSFIO.cc
+++ b/gcc/m2/pge-boot/GSFIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -48,7 +49,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    Exists - returns TRUE if a file named, fname exists for reading.
 */
 
-extern "C" unsigned int SFIO_Exists (DynamicStrings_String fname);
+extern "C" bool SFIO_Exists (DynamicStrings_String fname);
 
 /*
    OpenToRead - attempts to open a file, fname, for reading and
@@ -80,7 +81,7 @@ extern "C" FIO_File SFIO_OpenToWrite (DynamicStrings_String fname);
                    and modify an existing file.
 */
 
-extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile);
 
 /*
    WriteS - writes a string, s, to, file. It returns the String, s.
@@ -102,7 +103,7 @@ extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file);
    Exists - returns TRUE if a file named, fname exists for reading.
 */
 
-extern "C" unsigned int SFIO_Exists (DynamicStrings_String fname)
+extern "C" bool SFIO_Exists (DynamicStrings_String fname)
 {
   return FIO_exists (DynamicStrings_string (fname), DynamicStrings_Length (fname));
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -152,7 +153,7 @@ extern "C" FIO_File SFIO_OpenToWrite (DynamicStrings_String fname)
                    and modify an existing file.
 */
 
-extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile)
 {
   return FIO_openForRandom (DynamicStrings_string (fname), DynamicStrings_Length (fname), towrite, newfile);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -188,7 +189,6 @@ extern "C" DynamicStrings_String SFIO_WriteS (FIO_File file, DynamicStrings_Stri
 extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file)
 {
   DynamicStrings_String s;
-  unsigned int c;
 
   s = DynamicStrings_InitString ((const char *) "", 0);
   while (((! (FIO_EOLN (file))) && (! (FIO_EOF (file)))) && (FIO_IsNoError (file)))
diff --git a/gcc/m2/pge-boot/GSFIO.h b/gcc/m2/pge-boot/GSFIO.h
index 02bfa650130..982016e7fab 100644
--- a/gcc/m2/pge-boot/GSFIO.h
+++ b/gcc/m2/pge-boot/GSFIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -54,7 +55,7 @@ extern "C" {
    Exists - returns TRUE if a file named, fname exists for reading.
 */
 
-EXTERN unsigned int SFIO_Exists (DynamicStrings_String fname);
+EXTERN bool SFIO_Exists (DynamicStrings_String fname);
 
 /*
    OpenToRead - attempts to open a file, fname, for reading and
@@ -86,7 +87,7 @@ EXTERN FIO_File SFIO_OpenToWrite (DynamicStrings_String fname);
                    and modify an existing file.
 */
 
-EXTERN FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile);
 
 /*
    WriteS - writes a string, s, to, file. It returns the String, s.
diff --git a/gcc/m2/pge-boot/GSYSTEM.h b/gcc/m2/pge-boot/GSYSTEM.h
index 4460451fac6..d355ab70d40 100644
--- a/gcc/m2/pge-boot/GSYSTEM.h
+++ b/gcc/m2/pge-boot/GSYSTEM.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GScan.h b/gcc/m2/pge-boot/GScan.h
index d6070a88e96..be4adc05434 100644
--- a/gcc/m2/pge-boot/GScan.h
+++ b/gcc/m2/pge-boot/GScan.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -51,7 +52,7 @@ extern "C" {
 /*
  OpenSource - opens a source file for reading.                  */
 
-EXTERN unsigned int Scan_OpenSource (const char *a_, unsigned int _a_high);
+EXTERN bool Scan_OpenSource (const char *a_, unsigned int _a_high);
 
 /*
  CloseSource - closes the current source file from reading.     */
@@ -84,7 +85,7 @@ EXTERN void Scan_TerminateOnError (void);
                     are allowed.
 */
 
-EXTERN void Scan_DefineComments (const char *Start_, unsigned int _Start_high, const char *End_, unsigned int _End_high, unsigned int eoln);
+EXTERN void Scan_DefineComments (const char *Start_, unsigned int _Start_high, const char *End_, unsigned int _End_high, bool eoln);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GStdIO.cc b/gcc/m2/pge-boot/GStdIO.cc
index d918673c9ac..4dc01ef2a43 100644
--- a/gcc/m2/pge-boot/GStdIO.cc
+++ b/gcc/m2/pge-boot/GStdIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GStdIO.h b/gcc/m2/pge-boot/GStdIO.h
index d1f48e0c918..e235a531b6a 100644
--- a/gcc/m2/pge-boot/GStdIO.h
+++ b/gcc/m2/pge-boot/GStdIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GStorage.cc b/gcc/m2/pge-boot/GStorage.cc
index d3b8776d525..3b82748cfbe 100644
--- a/gcc/m2/pge-boot/GStorage.cc
+++ b/gcc/m2/pge-boot/GStorage.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -39,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size);
 extern "C" void Storage_DEALLOCATE (void * *a, unsigned int Size);
 extern "C" void Storage_REALLOCATE (void * *a, unsigned int Size);
-extern "C" unsigned int Storage_Available (unsigned int Size);
+extern "C" bool Storage_Available (unsigned int Size);
 
 extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size)
 {
@@ -56,7 +57,7 @@ extern "C" void Storage_REALLOCATE (void * *a, unsigned int Size)
   SysStorage_REALLOCATE (a, Size);
 }
 
-extern "C" unsigned int Storage_Available (unsigned int Size)
+extern "C" bool Storage_Available (unsigned int Size)
 {
   return SysStorage_Available (Size);
   /* static analysis guarentees a RETURN statement will be used before here.  */
diff --git a/gcc/m2/pge-boot/GStorage.h b/gcc/m2/pge-boot/GStorage.h
index e6075f807da..d7cd15ea7b0 100644
--- a/gcc/m2/pge-boot/GStorage.h
+++ b/gcc/m2/pge-boot/GStorage.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -77,7 +78,7 @@ EXTERN void Storage_REALLOCATE (void * *a, unsigned int Size);
    Available - returns TRUE if, Size, bytes can be allocated.
 */
 
-EXTERN unsigned int Storage_Available (unsigned int Size);
+EXTERN bool Storage_Available (unsigned int Size);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/GStrCase.cc b/gcc/m2/pge-boot/GStrCase.cc
index 0e6b5bee012..0c8fd3d15e7 100644
--- a/gcc/m2/pge-boot/GStrCase.cc
+++ b/gcc/m2/pge-boot/GStrCase.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GStrCase.h b/gcc/m2/pge-boot/GStrCase.h
index dbcf1bd0657..2a3f4105f32 100644
--- a/gcc/m2/pge-boot/GStrCase.h
+++ b/gcc/m2/pge-boot/GStrCase.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GStrIO.cc b/gcc/m2/pge-boot/GStrIO.cc
index b8c42ac162a..a6d603a5a54 100644
--- a/gcc/m2/pge-boot/GStrIO.cc
+++ b/gcc/m2/pge-boot/GStrIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -44,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   include "GStdIO.h"
 #   include "Glibc.h"
 
-static unsigned int IsATTY;
+static bool IsATTY;
 
 /*
    WriteLn - writes a carriage return and a newline
@@ -85,7 +86,7 @@ static void Echo (char ch);
    AlphaNum- returns true if character, ch, is an alphanumeric character.
 */
 
-static unsigned int AlphaNum (char ch);
+static bool AlphaNum (char ch);
 
 
 /*
@@ -119,7 +120,7 @@ static void Echo (char ch)
    AlphaNum- returns true if character, ch, is an alphanumeric character.
 */
 
-static unsigned int AlphaNum (char ch)
+static bool AlphaNum (char ch)
 {
   return (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))) || ((ch >= '0') && (ch <= '9'));
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -269,7 +270,7 @@ extern "C" void StrIO_WriteString (const char *a_, unsigned int _a_high)
 extern "C" void _M2_StrIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
 {
   /* IsATTY := isatty()  */
-  IsATTY = FALSE;
+  IsATTY = false;
 }
 
 extern "C" void _M2_StrIO_fini (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
diff --git a/gcc/m2/pge-boot/GStrIO.h b/gcc/m2/pge-boot/GStrIO.h
index 94d49ae079d..7883172a12a 100644
--- a/gcc/m2/pge-boot/GStrIO.h
+++ b/gcc/m2/pge-boot/GStrIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GStrLib.cc b/gcc/m2/pge-boot/GStrLib.cc
index d5ae7249d89..39cafb100a4 100644
--- a/gcc/m2/pge-boot/GStrLib.cc
+++ b/gcc/m2/pge-boot/GStrLib.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -58,8 +59,8 @@ extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const ch
              string, b.
 */
 
-extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
-extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
 extern "C" unsigned int StrLib_StrLen (const char *a_, unsigned int _a_high);
 
 /*
@@ -74,7 +75,7 @@ extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *
    IsSubString - returns true if b is a subcomponent of a.
 */
 
-extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
 
 /*
    StrRemoveWhitePrefix - copies string, into string, b, excluding any white
@@ -87,14 +88,14 @@ extern "C" void StrLib_StrRemoveWhitePrefix (const char *a_, unsigned int _a_hig
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
 
 
 /*
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
 {
   return (ch == ' ') || (ch == ASCII_tab);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -142,7 +143,7 @@ extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const ch
              string, b.
 */
 
-extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
 {
   unsigned int Higha;
   unsigned int Highb;
@@ -161,12 +162,12 @@ extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, co
     {
       if (a[i] < b[i])
         {
-          return TRUE;
+          return true;
         }
       else if (a[i] > b[i])
         {
           /* avoid dangling else.  */
-          return FALSE;
+          return false;
         }
       /* must be equal, move on to next character  */
       i += 1;
@@ -176,7 +177,7 @@ extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, co
   __builtin_unreachable ();
 }
 
-extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
 {
   unsigned int i;
   unsigned int higha;
@@ -195,7 +196,7 @@ extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, c
     {
       if (a[i] != b[i])
         {
-          return FALSE;
+          return false;
         }
       i += 1;
     }
@@ -260,7 +261,7 @@ extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *
    IsSubString - returns true if b is a subcomponent of a.
 */
 
-extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
 {
   unsigned int i;
   unsigned int j;
@@ -287,7 +288,7 @@ extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high
             }
           if (j == LengthB)
             {
-              return TRUE;
+              return true;
             }
           else
             {
@@ -295,7 +296,7 @@ extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high
             }
         }
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
diff --git a/gcc/m2/pge-boot/GStrLib.h b/gcc/m2/pge-boot/GStrLib.h
index b23c1f9b2f9..de3250b0b6c 100644
--- a/gcc/m2/pge-boot/GStrLib.h
+++ b/gcc/m2/pge-boot/GStrLib.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -59,13 +60,13 @@ EXTERN void StrLib_StrConCat (const char *a_, unsigned int _a_high, const char *
              string, b.
 */
 
-EXTERN unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
 
 /*
    StrEqual - performs a = b on two strings.
 */
 
-EXTERN unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
 
 /*
    StrLen - returns the length of string, a.
@@ -85,7 +86,7 @@ EXTERN void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *dest
    IsSubString - returns true if b is a subcomponent of a.
 */
 
-EXTERN unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
 
 /*
    StrRemoveWhitePrefix - copies string, into string, b, excluding any white
diff --git a/gcc/m2/pge-boot/GStringConvert.h b/gcc/m2/pge-boot/GStringConvert.h
index fc320fa051b..d3826fa4ca5 100644
--- a/gcc/m2/pge-boot/GStringConvert.h
+++ b/gcc/m2/pge-boot/GStringConvert.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -61,7 +62,7 @@ extern "C" {
                      abcdef are used, and if FALSE then ABCDEF are used.
 */
 
-EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
 
 /*
    CardinalToString - converts CARDINAL, c, into a String. The field
@@ -74,7 +75,7 @@ EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int
                       abcdef are used, and if FALSE then ABCDEF are used.
 */
 
-EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
 
 /*
    StringToInteger - converts a string, s, of, base, into an INTEGER.
@@ -84,7 +85,7 @@ EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, uns
                      The parameter found is set TRUE if a number was found.
 */
 
-EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, bool *found);
 
 /*
    StringToCardinal - converts a string, s, of, base, into a CARDINAL.
@@ -94,7 +95,7 @@ EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int
                       The parameter found is set TRUE if a number was found.
 */
 
-EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, bool *found);
 
 /*
    LongIntegerToString - converts LONGINT, i, into a String. The field with
@@ -108,7 +109,7 @@ EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, uns
                          abcdef are used, and if FALSE then ABCDEF are used.
 */
 
-EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
 
 /*
    StringToLongInteger - converts a string, s, of, base, into an LONGINT.
@@ -118,7 +119,7 @@ EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsi
                          The parameter found is set TRUE if a number was found.
 */
 
-EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, bool *found);
 
 /*
    LongCardinalToString - converts LONGCARD, c, into a String. The field
@@ -131,7 +132,7 @@ EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsi
                           abcdef are used, and if FALSE then ABCDEF are used.
 */
 
-EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
 
 /*
    StringToLongCardinal - converts a string, s, of, base, into a LONGCARD.
@@ -141,7 +142,7 @@ EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned i
                           The parameter found is set TRUE if a number was found.
 */
 
-EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, bool *found);
 
 /*
    ShortCardinalToString - converts SHORTCARD, c, into a String. The field
@@ -154,7 +155,7 @@ EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_Stri
                            abcdef are used, and if FALSE then ABCDEF are used.
 */
 
-EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
 
 /*
    StringToShortCardinal - converts a string, s, of, base, into a SHORTCARD.
@@ -164,7 +165,7 @@ EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned
                            The parameter found is set TRUE if a number was found.
 */
 
-EXTERN short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, bool *found);
 
 /*
    stoi - decimal string to INTEGER
@@ -176,7 +177,7 @@ EXTERN int StringConvert_stoi (DynamicStrings_String s);
    itos - integer to decimal string.
 */
 
-EXTERN DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, unsigned int sign);
+EXTERN DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, bool sign);
 
 /*
    ctos - cardinal to decimal string.
@@ -231,7 +232,7 @@ EXTERN unsigned int StringConvert_bstoc (DynamicStrings_String s);
                       if a legal number is seen.
 */
 
-EXTERN long double StringConvert_StringToLongreal (DynamicStrings_String s, unsigned int *found);
+EXTERN long double StringConvert_StringToLongreal (DynamicStrings_String s, bool *found);
 
 /*
    LongrealToString - converts a LONGREAL number, Real, which has,
diff --git a/gcc/m2/pge-boot/GSymbolKey.cc b/gcc/m2/pge-boot/GSymbolKey.cc
index 699b70a5c62..14c644e2024 100644
--- a/gcc/m2/pge-boot/GSymbolKey.cc
+++ b/gcc/m2/pge-boot/GSymbolKey.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -55,7 +56,7 @@ typedef struct SymbolKey_Node_r SymbolKey_Node;
 
 typedef SymbolKey_Node *SymbolKey_SymbolTree;
 
-typedef unsigned int (*SymbolKey_IsSymbol_t) (unsigned int);
+typedef bool (*SymbolKey_IsSymbol_t) (unsigned int);
 struct SymbolKey_IsSymbol_p { SymbolKey_IsSymbol_t proc; };
 
 typedef void (*SymbolKey_PerformOperation_t) (unsigned int);
@@ -96,7 +97,7 @@ extern "C" void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe
    IsEmptyTree - returns true if SymbolTree, t, is empty.
 */
 
-extern "C" unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
+extern "C" bool SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
 
 /*
    DoesTreeContainAny - returns true if SymbolTree, t, contains any
@@ -106,7 +107,7 @@ extern "C" unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
                         Left, hence we need two procedures.
 */
 
-extern "C" unsigned int SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
+extern "C" bool SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
 
 /*
    ForeachNodeDo - for each node in SymbolTree, t, a procedure, P,
@@ -121,7 +122,7 @@ extern "C" void SymbolKey_ForeachNodeDo (SymbolKey_SymbolTree t, SymbolKey_Perfo
    ContainsSymKey - return TRUE if tree, t, contains an entry for, NameKey.
 */
 
-extern "C" unsigned int SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey);
+extern "C" bool SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey);
 
 /*
    NoOfNodes - returns the number of nodes in the tree t.
@@ -149,7 +150,7 @@ static void FindNodeParentInTree (SymbolKey_SymbolTree t, NameKey_Name n, Symbol
                   therefore we must skip over it.
 */
 
-static unsigned int SearchForAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
+static bool SearchForAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
 
 /*
    SearchAndDo - searches all the nodes in SymbolTree, t, and
@@ -183,7 +184,7 @@ static void FindNodeParentInTree (SymbolKey_SymbolTree t, NameKey_Name n, Symbol
   (*parent) = t;
   if (t == NULL)
     {
-      Debug_Halt ((const char *) "parameter t should never be NIL", 31, 240, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54);
+      Debug_Halt ((const char *) "parameter t should never be NIL", 31, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "FindNodeParentInTree", 20, 241);
     }
   Assertion_Assert (t->Right == NULL);
   (*child) = t->Left;
@@ -212,11 +213,11 @@ static void FindNodeParentInTree (SymbolKey_SymbolTree t, NameKey_Name n, Symbol
                   therefore we must skip over it.
 */
 
-static unsigned int SearchForAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P)
+static bool SearchForAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P)
 {
   if (t == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -392,7 +393,7 @@ extern "C" void SymbolKey_PutSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe
     }
   else
     {
-      Debug_Halt ((const char *) "symbol already stored", 21, 156, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54);
+      Debug_Halt ((const char *) "symbol already stored", 21, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "PutSymKey", 9, 156);
     }
 }
 
@@ -459,7 +460,7 @@ extern "C" void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe
     }
   else
     {
-      Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 223, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54);
+      Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "DelSymKey", 9, 223);
     }
 }
 
@@ -468,7 +469,7 @@ extern "C" void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe
    IsEmptyTree - returns true if SymbolTree, t, is empty.
 */
 
-extern "C" unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t)
+extern "C" bool SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t)
 {
   return t->Left == NULL;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -484,7 +485,7 @@ extern "C" unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t)
                         Left, hence we need two procedures.
 */
 
-extern "C" unsigned int SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P)
+extern "C" bool SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P)
 {
   return SearchForAny (t->Left, P);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -509,7 +510,7 @@ extern "C" void SymbolKey_ForeachNodeDo (SymbolKey_SymbolTree t, SymbolKey_Perfo
    ContainsSymKey - return TRUE if tree, t, contains an entry for, NameKey.
 */
 
-extern "C" unsigned int SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey)
+extern "C" bool SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey)
 {
   SymbolKey_SymbolTree father;
   SymbolKey_SymbolTree child;
diff --git a/gcc/m2/pge-boot/GSymbolKey.h b/gcc/m2/pge-boot/GSymbolKey.h
index c5d419fcb04..03940b1c2b5 100644
--- a/gcc/m2/pge-boot/GSymbolKey.h
+++ b/gcc/m2/pge-boot/GSymbolKey.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -54,7 +55,7 @@ typedef struct SymbolKey_IsSymbol_p SymbolKey_IsSymbol;
 
 typedef struct SymbolKey_PerformOperation_p SymbolKey_PerformOperation;
 
-typedef unsigned int (*SymbolKey_IsSymbol_t) (unsigned int);
+typedef bool (*SymbolKey_IsSymbol_t) (unsigned int);
 struct SymbolKey_IsSymbol_p { SymbolKey_IsSymbol_t proc; };
 
 typedef void (*SymbolKey_PerformOperation_t) (unsigned int);
@@ -97,7 +98,7 @@ EXTERN void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey);
    IsEmptyTree - returns true if SymbolTree, t, is empty.
 */
 
-EXTERN unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
+EXTERN bool SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
 
 /*
    DoesTreeContainAny - returns true if SymbolTree, t, contains any
@@ -105,7 +106,7 @@ EXTERN unsigned int SymbolKey_IsEmptyTree (SymbolKey_SymbolTree t);
                         P, is called with a symbol as its parameter.
 */
 
-EXTERN unsigned int SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
+EXTERN bool SymbolKey_DoesTreeContainAny (SymbolKey_SymbolTree t, SymbolKey_IsSymbol P);
 
 /*
    ForeachNodeDo - for each node in SymbolTree, t, a procedure, P,
@@ -119,7 +120,7 @@ EXTERN void SymbolKey_ForeachNodeDo (SymbolKey_SymbolTree t, SymbolKey_PerformOp
    ContainsSymKey - return TRUE if tree, t, contains an entry for, NameKey.
 */
 
-EXTERN unsigned int SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey);
+EXTERN bool SymbolKey_ContainsSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKey);
 
 /*
    NoOfNodes - returns the number of nodes in the tree t.
diff --git a/gcc/m2/pge-boot/GSysExceptions.h b/gcc/m2/pge-boot/GSysExceptions.h
index bcc0a41c0b6..1dcb55d1159 100644
--- a/gcc/m2/pge-boot/GSysExceptions.h
+++ b/gcc/m2/pge-boot/GSysExceptions.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GSysStorage.cc b/gcc/m2/pge-boot/GSysStorage.cc
index d9cd60bd9fc..80ea0a38d9e 100644
--- a/gcc/m2/pge-boot/GSysStorage.cc
+++ b/gcc/m2/pge-boot/GSysStorage.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -52,12 +53,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   include "GDebug.h"
 #   include "GSYSTEM.h"
 
-#   define enableDeallocation TRUE
-#   define enableZero FALSE
-#   define enableTrace FALSE
+#   define enableDeallocation true
+#   define enableZero true
+#   define enableTrace false
 static unsigned int callno;
-static unsigned int zero;
-static unsigned int trace;
+static bool zero;
+static bool trace;
 extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size);
 extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size);
 
@@ -79,7 +80,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size);
                 is resized accordingly.
 */
 
-extern "C" unsigned int SysStorage_Available (unsigned int size);
+extern "C" bool SysStorage_Available (unsigned int size);
 
 /*
    Init - initializes the heap.  This does nothing on a GNU/Linux system.
@@ -93,7 +94,7 @@ extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size)
   (*a) = libc_malloc (static_cast<size_t> (size));
   if ((*a) == NULL)
     {
-      Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51);
+      Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "ALLOCATE", 8, 51);
     }
   if (enableTrace && trace)
     {
@@ -118,7 +119,7 @@ extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size)
         }
       if ((libc_memset ((*a), 0, static_cast<size_t> (size))) != (*a))
         {
-          Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51);
+          Debug_Halt ((const char *) "memset should have returned the first parameter", 47, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "DEALLOCATE", 10, 78);
         }
     }
   if (enableDeallocation)
@@ -163,7 +164,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size)
       (*a) = libc_realloc ((*a), static_cast<size_t> (size));
       if ((*a) == NULL)
         {
-          Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51);
+          Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "REALLOCATE", 10, 122);
         }
       if (enableTrace && trace)
         {
@@ -182,7 +183,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size)
                 is resized accordingly.
 */
 
-extern "C" unsigned int SysStorage_Available (unsigned int size)
+extern "C" bool SysStorage_Available (unsigned int size)
 {
   void * a;
 
@@ -198,7 +199,7 @@ extern "C" unsigned int SysStorage_Available (unsigned int size)
         {
           libc_printf ((const char *) "   no\\n", 7, size);
         }
-      return FALSE;
+      return false;
     }
   else
     {
@@ -207,7 +208,7 @@ extern "C" unsigned int SysStorage_Available (unsigned int size)
           libc_printf ((const char *) "   yes\\n", 8, size);
         }
       libc_free (a);
-      return TRUE;
+      return true;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -232,7 +233,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut
     }
   else
     {
-      trace = FALSE;
+      trace = false;
     }
   if (enableZero)
     {
@@ -240,7 +241,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut
     }
   else
     {
-      zero = FALSE;
+      zero = false;
     }
 }
 
diff --git a/gcc/m2/pge-boot/GSysStorage.h b/gcc/m2/pge-boot/GSysStorage.h
index 10b89b3313a..df8bf89b26e 100644
--- a/gcc/m2/pge-boot/GSysStorage.h
+++ b/gcc/m2/pge-boot/GSysStorage.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -77,7 +78,7 @@ EXTERN void SysStorage_REALLOCATE (void * *a, unsigned int size);
    Available - returns TRUE if, size, bytes can be allocated.
 */
 
-EXTERN unsigned int SysStorage_Available (unsigned int size);
+EXTERN bool SysStorage_Available (unsigned int size);
 
 /*
    Init - initializes the heap.
diff --git a/gcc/m2/pge-boot/GTimeString.h b/gcc/m2/pge-boot/GTimeString.h
index a5b2618bf55..061e111d4ff 100644
--- a/gcc/m2/pge-boot/GTimeString.h
+++ b/gcc/m2/pge-boot/GTimeString.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/GUnixArgs.h b/gcc/m2/pge-boot/GUnixArgs.h
index 9a1283480d9..8c56ead1510 100644
--- a/gcc/m2/pge-boot/GUnixArgs.h
+++ b/gcc/m2/pge-boot/GUnixArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/Gbnflex.cc b/gcc/m2/pge-boot/Gbnflex.cc
index 7f78b5d250b..b5a54b9cc74 100644
--- a/gcc/m2/pge-boot/Gbnflex.cc
+++ b/gcc/m2/pge-boot/Gbnflex.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -56,8 +57,8 @@ static FIO_File f;
 static SymbolKey_SymbolTree ReservedWords;
 static NameKey_Name CurrentToken;
 static bnflex_TokenType CurrentType;
-static unsigned int Debugging;
-static unsigned int InQuote;
+static bool Debugging;
+static bool InQuote;
 static char QuoteChar;
 
 /*
@@ -65,7 +66,7 @@ static char QuoteChar;
                 The success of the operation is returned.
 */
 
-extern "C" unsigned int bnflex_OpenSource (const char *a_, unsigned int _a_high);
+extern "C" bool bnflex_OpenSource (const char *a_, unsigned int _a_high);
 
 /*
    CloseSource - Closes the current open file.
@@ -91,14 +92,14 @@ extern "C" char bnflex_PutChar (char ch);
            and true is returned, otherwise false is returned.
 */
 
-extern "C" unsigned int bnflex_SymIs (bnflex_TokenType t);
+extern "C" bool bnflex_SymIs (bnflex_TokenType t);
 
 /*
    IsSym - returns the result of the comparison between the current token
            type and t.
 */
 
-extern "C" unsigned int bnflex_IsSym (bnflex_TokenType t);
+extern "C" bool bnflex_IsSym (bnflex_TokenType t);
 
 /*
    GetCurrentTokenType - returns the type of current token.
@@ -140,7 +141,7 @@ extern "C" void bnflex_AdvanceToken (void);
    IsReserved - returns TRUE if the name is a reserved word.
 */
 
-extern "C" unsigned int bnflex_IsReserved (NameKey_Name name);
+extern "C" bool bnflex_IsReserved (NameKey_Name name);
 
 /*
    PushBackToken - pushes a token back onto input.
@@ -152,7 +153,7 @@ extern "C" void bnflex_PushBackToken (NameKey_Name t);
    SetDebugging - sets the debugging flag.
 */
 
-extern "C" void bnflex_SetDebugging (unsigned int flag);
+extern "C" void bnflex_SetDebugging (bool flag);
 
 /*
    EatChar - consumes the next character in the input.
@@ -164,7 +165,7 @@ static void EatChar (void);
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
 
 /*
    SkipComments - consumes comments.
@@ -200,7 +201,7 @@ static void EatChar (void)
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
 {
   return ((ch == ' ') || (ch == ASCII_tab)) || (ch == ASCII_lf);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -257,7 +258,7 @@ static void Init (void)
   Init__T1 a;
 
   SymbolKey_InitTree (&ReservedWords);
-  Debugging = FALSE;
+  Debugging = false;
   a.array[0] = ASCII_nul;
   SymbolKey_PutSymKey (ReservedWords, NameKey_MakeKey ((const char *) &a.array[0], 1), ((unsigned int) (bnflex_eoftok)));
   SymbolKey_PutSymKey (ReservedWords, NameKey_MakeKey ((const char *) "%", 1), ((unsigned int) (bnflex_codetok)));
@@ -291,7 +292,7 @@ static void Init (void)
   SymbolKey_PutSymKey (ReservedWords, NameKey_MakeKey ((const char *) "FNB", 3), ((unsigned int) (bnflex_FNBtok)));
   CurrentToken = NameKey_NulName;
   CurrentType = bnflex_identtok;
-  InQuote = FALSE;
+  InQuote = false;
 }
 
 
@@ -300,7 +301,7 @@ static void Init (void)
                 The success of the operation is returned.
 */
 
-extern "C" unsigned int bnflex_OpenSource (const char *a_, unsigned int _a_high)
+extern "C" bool bnflex_OpenSource (const char *a_, unsigned int _a_high)
 {
   char a[_a_high+1];
 
@@ -354,16 +355,16 @@ extern "C" char bnflex_PutChar (char ch)
            and true is returned, otherwise false is returned.
 */
 
-extern "C" unsigned int bnflex_SymIs (bnflex_TokenType t)
+extern "C" bool bnflex_SymIs (bnflex_TokenType t)
 {
   if (CurrentType == t)
     {
       bnflex_AdvanceToken ();
-      return TRUE;
+      return true;
     }
   else
     {
-      return FALSE;
+      return false;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -375,7 +376,7 @@ extern "C" unsigned int bnflex_SymIs (bnflex_TokenType t)
            type and t.
 */
 
-extern "C" unsigned int bnflex_IsSym (bnflex_TokenType t)
+extern "C" bool bnflex_IsSym (bnflex_TokenType t)
 {
   return t == CurrentType;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -470,7 +471,7 @@ extern "C" void bnflex_AdvanceToken (void)
           if ((bnflex_PutChar (bnflex_GetChar ())) == QuoteChar)
             {
               a.array[i] = bnflex_GetChar ();
-              InQuote = FALSE;
+              InQuote = false;
               i += 1;
               a.array[i] = ASCII_nul;
               CurrentToken = NameKey_MakeKey ((const char *) &a.array[0], MaxNameLength);
@@ -486,7 +487,7 @@ extern "C" void bnflex_AdvanceToken (void)
                 {
                   PushBackInput_WarnError ((const char *) "missing ' at the end of a literal", 33);
                 }
-              InQuote = FALSE;  /* to avoid a contineous list of the same error message  */
+              InQuote = false;  /* to avoid a contineous list of the same error message  */
             }
         }
       else
@@ -512,7 +513,7 @@ extern "C" void bnflex_AdvanceToken (void)
                 {
                   PushBackInput_WarnError ((const char *) "missing ' at the end of a literal", 33);
                 }
-              InQuote = FALSE;  /* to avoid a contineous list of the same error message  */
+              InQuote = false;  /* to avoid a contineous list of the same error message  */
             }
         }
     }
@@ -524,7 +525,7 @@ extern "C" void bnflex_AdvanceToken (void)
           a.array[i] = bnflex_GetChar ();
           QuoteChar = a.array[i];
           i += 1;
-          InQuote = TRUE;
+          InQuote = true;
           a.array[i] = ASCII_nul;
           CurrentToken = NameKey_MakeKey ((const char *) &a.array[0], MaxNameLength);
           CurrentType = (bnflex_TokenType) (SymbolKey_GetSymKey (ReservedWords, CurrentToken));
@@ -559,7 +560,7 @@ extern "C" void bnflex_AdvanceToken (void)
    IsReserved - returns TRUE if the name is a reserved word.
 */
 
-extern "C" unsigned int bnflex_IsReserved (NameKey_Name name)
+extern "C" bool bnflex_IsReserved (NameKey_Name name)
 {
   return (SymbolKey_GetSymKey (ReservedWords, name)) != 0;
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -587,7 +588,7 @@ extern "C" void bnflex_PushBackToken (NameKey_Name t)
    SetDebugging - sets the debugging flag.
 */
 
-extern "C" void bnflex_SetDebugging (unsigned int flag)
+extern "C" void bnflex_SetDebugging (bool flag)
 {
   Debugging = flag;
 }
diff --git a/gcc/m2/pge-boot/Gbnflex.h b/gcc/m2/pge-boot/Gbnflex.h
index a9a88154323..8753ac7fa0d 100644
--- a/gcc/m2/pge-boot/Gbnflex.h
+++ b/gcc/m2/pge-boot/Gbnflex.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -51,7 +52,7 @@ typedef enum {bnflex_identtok, bnflex_literaltok, bnflex_codetok, bnflex_lbecome
                 The success of the operation is returned.
 */
 
-EXTERN unsigned int bnflex_OpenSource (const char *a_, unsigned int _a_high);
+EXTERN bool bnflex_OpenSource (const char *a_, unsigned int _a_high);
 
 /*
    CloseSource - Closes the current open file.
@@ -77,14 +78,14 @@ EXTERN char bnflex_PutChar (char ch);
            and true is returned, otherwise false is returned.
 */
 
-EXTERN unsigned int bnflex_SymIs (bnflex_TokenType t);
+EXTERN bool bnflex_SymIs (bnflex_TokenType t);
 
 /*
    IsSym - returns the result of the comparison between the current token
            type and t.
 */
 
-EXTERN unsigned int bnflex_IsSym (bnflex_TokenType t);
+EXTERN bool bnflex_IsSym (bnflex_TokenType t);
 
 /*
    GetCurrentTokenType - returns the type of current token.
@@ -126,7 +127,7 @@ EXTERN void bnflex_AdvanceToken (void);
    IsReserved - returns TRUE if the name is a reserved word.
 */
 
-EXTERN unsigned int bnflex_IsReserved (NameKey_Name name);
+EXTERN bool bnflex_IsReserved (NameKey_Name name);
 
 /*
    PushBackToken - pushes a token back onto input.
@@ -138,7 +139,7 @@ EXTERN void bnflex_PushBackToken (NameKey_Name t);
    SetDebugging - sets the debugging flag.
 */
 
-EXTERN void bnflex_SetDebugging (unsigned int flag);
+EXTERN void bnflex_SetDebugging (bool flag);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/Gdtoa.h b/gcc/m2/pge-boot/Gdtoa.h
index aaab69b4454..67a3c569983 100644
--- a/gcc/m2/pge-boot/Gdtoa.h
+++ b/gcc/m2/pge-boot/Gdtoa.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ typedef enum {dtoa_maxsignificant, dtoa_decimaldigits} dtoa_Mode;
             error to TRUE if the number is too large.
 */
 
-EXTERN double dtoa_strtod (void * s, unsigned int *error);
+EXTERN double dtoa_strtod (void * s, bool *error);
 
 /*
    dtoa - converts a REAL, d, into a string.  The address of the
@@ -67,7 +68,7 @@ EXTERN double dtoa_strtod (void * s, unsigned int *error);
           sign       does the string have a sign?
 */
 
-EXTERN void * dtoa_dtoa (double d, dtoa_Mode mode, int ndigits, int *decpt, unsigned int *sign);
+EXTERN void * dtoa_dtoa (double d, dtoa_Mode mode, int ndigits, int *decpt, bool *sign);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/Gerrno.h b/gcc/m2/pge-boot/Gerrno.h
index 916027c4925..ae23c3ed930 100644
--- a/gcc/m2/pge-boot/Gerrno.h
+++ b/gcc/m2/pge-boot/Gerrno.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/Gldtoa.h b/gcc/m2/pge-boot/Gldtoa.h
index 94f5389b39a..a03fce9c83b 100644
--- a/gcc/m2/pge-boot/Gldtoa.h
+++ b/gcc/m2/pge-boot/Gldtoa.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ typedef enum {ldtoa_maxsignificant, ldtoa_decimaldigits} ldtoa_Mode;
              error to TRUE if the number is too large or badly formed.
 */
 
-EXTERN long double ldtoa_strtold (void * s, unsigned int *error);
+EXTERN long double ldtoa_strtold (void * s, bool *error);
 
 /*
    ldtoa - converts a LONGREAL, d, into a string.  The address of the
@@ -67,7 +68,7 @@ EXTERN long double ldtoa_strtold (void * s, unsigned int *error);
            sign       does the string have a sign?
 */
 
-EXTERN void * ldtoa_ldtoa (long double d, ldtoa_Mode mode, int ndigits, int *decpt, unsigned int *sign);
+EXTERN void * ldtoa_ldtoa (long double d, ldtoa_Mode mode, int ndigits, int *decpt, bool *sign);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/Glibc.h b/gcc/m2/pge-boot/Glibc.h
index f4e769187d3..24cf2ae3a8d 100644
--- a/gcc/m2/pge-boot/Glibc.h
+++ b/gcc/m2/pge-boot/Glibc.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -305,7 +306,7 @@ EXTERN void * libc_memset (void * s, int c, size_t size);
 
 EXTERN void * libc_memmove (void * dest, void * src, size_t size);
 EXTERN int libc_printf (const char *format_, unsigned int _format_high, ...);
-EXTERN int libc_snprintf (void *dest, size_t length, const char *format_, unsigned int _format_high, ...);
+EXTERN int libc_snprintf (void * dest, size_t size, const char *format_, unsigned int _format_high, ...);
 
 /*
    setenv - sets environment variable, name, to value.
diff --git a/gcc/m2/pge-boot/Glibm.h b/gcc/m2/pge-boot/Glibm.h
index 26bdaceacb4..a7262e8b86a 100644
--- a/gcc/m2/pge-boot/Glibm.h
+++ b/gcc/m2/pge-boot/Glibm.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
diff --git a/gcc/m2/pge-boot/Gpge.cc b/gcc/m2/pge-boot/Gpge.cc
index e889236b948..90ca7472b51 100644
--- a/gcc/m2/pge-boot/Gpge.cc
+++ b/gcc/m2/pge-boot/Gpge.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -65,7 +66,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #   define MaxCodeHunkLength 8192
 #   define MaxFileName 8192
 #   define MaxString 8192
-#   define DefaultRecovery TRUE
+#   define DefaultRecovery true
 #   define MaxElementsInSet 32
 #   define BaseRightLimit 75
 #   define BaseRightMargin 50
@@ -146,7 +147,7 @@ struct pge__T2_r {
                    pge_ProductionDesc next;
                    pge_StatementDesc statement;
                    pge_SetDesc first;
-                   unsigned int firstsolved;
+                   bool firstsolved;
                    pge_FollowDesc followinfo;
                    unsigned int line;
                    NameKey_Name description;
@@ -180,7 +181,7 @@ struct pge__T5_r {
                  };
 
 struct pge__T6_r {
-                   unsigned int calcfollow;
+                   bool calcfollow;
                    pge_SetDesc follow;
                    pge_TraverseResult reachend;
                    pge_TraverseResult epsilon;
@@ -210,16 +211,16 @@ struct pge__T9_r {
                  };
 
 static unsigned int LastLineNo;
-static unsigned int Finished;
-static unsigned int SuppressFileLineTag;
-static unsigned int KeywordFormatting;
-static unsigned int PrettyPrint;
-static unsigned int EmitCode;
-static unsigned int Texinfo;
-static unsigned int Sphinx;
-static unsigned int FreeDocLicense;
-static unsigned int Debugging;
-static unsigned int WasNoError;
+static bool Finished;
+static bool SuppressFileLineTag;
+static bool KeywordFormatting;
+static bool PrettyPrint;
+static bool EmitCode;
+static bool Texinfo;
+static bool Sphinx;
+static bool FreeDocLicense;
+static bool Debugging;
+static bool WasNoError;
 static unsigned int LinePrologue;
 static unsigned int LineEpilogue;
 static unsigned int LineDeclaration;
@@ -248,13 +249,13 @@ static NameKey_Name ErrorProcArray;
 static NameKey_Name ErrorProcString;
 static pge__T11 ArgName;
 static pge__T11 FileName;
-static unsigned int OnLineStart;
-static unsigned int BeginningOfLine;
+static bool OnLineStart;
+static bool BeginningOfLine;
 static unsigned int Indent;
-static unsigned int EmittedVar;
-static unsigned int ErrorRecovery;
+static bool EmittedVar;
+static bool ErrorRecovery;
 static unsigned int LargestValue;
-static unsigned int InitialElement;
+static bool InitialElement;
 static unsigned int ParametersUsed;
 
 /*
@@ -305,7 +306,7 @@ static pge_FollowDesc NewFollow (void);
                    providing condition is TRUE.
 */
 
-static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value);
+static void AssignEpsilon (bool condition, pge_FollowDesc f, pge_TraverseResult value);
 
 /*
    GetEpsilon - returns the value of epsilon
@@ -317,7 +318,7 @@ static pge_TraverseResult GetEpsilon (pge_FollowDesc f);
    AssignReachEnd - assigns the reachend value providing that, condition, is TRUE.
 */
 
-static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value);
+static void AssignReachEnd (bool condition, pge_FollowDesc f, pge_TraverseResult value);
 
 /*
    GetReachEnd - returns the value of reachend
@@ -419,21 +420,21 @@ static void WriteIndent (unsigned int n);
    CheckWrite -
 */
 
-static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    WriteStringIndent - writes a string but it will try and remove upto indent spaces
                        if they exist.
 */
 
-static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    WriteCodeHunkListIndent - writes the CodeHunk list in the correct order
                              but it removes up to indent spaces if they exist.
 */
 
-static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    Add - adds a character to a code hunk and creates another code hunk if necessary.
@@ -1108,13 +1109,13 @@ static void CodeThenDo (pge_m2condition m);
    CodeElseEnd - builds an ELSE END statement using string, end.
 */
 
-static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt);
+static void CodeElseEnd (const char *end_, unsigned int _end_high, bool consumed, pge_FactorDesc f, bool inopt);
 
 /*
    CodeEnd - codes a "END" depending upon, m.
 */
 
-static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt);
+static void CodeEnd (pge_m2condition m, pge_TermDesc t, bool consumed, pge_FactorDesc f, bool inopt);
 
 /*
    EmitNonVarCode - writes out, code, providing it is not a variable declaration.
@@ -1138,19 +1139,19 @@ static void FlushCode (pge_FactorDesc *codeStack);
    CodeFactor -
 */
 
-static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeTerm -
 */
 
-static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeTerm (pge_TermDesc t, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeExpression -
 */
 
-static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeStatement -
@@ -1226,7 +1227,7 @@ static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc c
                 and FALSE in the first.
 */
 
-static unsigned int OptExpSeen (pge_FactorDesc f);
+static bool OptExpSeen (pge_FactorDesc f);
 
 /*
    RecoverTerm -
@@ -1262,20 +1263,20 @@ static void EmitUsed (unsigned int wordno);
    EmitStopParameters - generate the stop set.
 */
 
-static void EmitStopParameters (unsigned int FormalParameters);
+static void EmitStopParameters (bool FormalParameters);
 
 /*
    IsBetween - returns TRUE if the value of the token, string, is
                in the range: low..high
 */
 
-static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned int high);
+static bool IsBetween (NameKey_Name string, unsigned int low, unsigned int high);
 
 /*
    IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high.
 */
 
-static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high);
+static bool IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high);
 
 /*
    EmitSet - emits the tokens in the set, to, which have values low..high
@@ -1328,13 +1329,13 @@ static void RecoverProduction (pge_ProductionDesc p);
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
 
 /*
    FindStr - returns TRUE if, str, was seen inside the code hunk
 */
 
-static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high);
+static bool FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high);
 
 /*
    WriteUpto -
@@ -1383,14 +1384,14 @@ static void VarProduction (pge_ProductionDesc p);
    In - returns TRUE if token, s, is already in the set, to.
 */
 
-static unsigned int In (pge_SetDesc to, NameKey_Name s);
+static bool In (pge_SetDesc to, NameKey_Name s);
 
 /*
    IntersectionIsNil - given two set lists, s1, s2, return TRUE if the
                        s1 * s2 = {}
 */
 
-static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2);
+static bool IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2);
 
 /*
    AddSet - adds a first symbol to a production.
@@ -1553,31 +1554,31 @@ static void CalcReachEndProduction (pge_ProductionDesc p);
    EmptyFactor -
 */
 
-static unsigned int EmptyFactor (pge_FactorDesc f);
+static bool EmptyFactor (pge_FactorDesc f);
 
 /*
    EmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int EmptyTerm (pge_TermDesc t);
+static bool EmptyTerm (pge_TermDesc t);
 
 /*
    EmptyExpression -
 */
 
-static unsigned int EmptyExpression (pge_ExpressionDesc e);
+static bool EmptyExpression (pge_ExpressionDesc e);
 
 /*
    EmptyStatement - returns TRUE if statement, s, is empty.
 */
 
-static unsigned int EmptyStatement (pge_StatementDesc s);
+static bool EmptyStatement (pge_StatementDesc s);
 
 /*
    EmptyProduction - returns if production, p, maybe empty.
 */
 
-static unsigned int EmptyProduction (pge_ProductionDesc p);
+static bool EmptyProduction (pge_ProductionDesc p);
 
 /*
    EmitFDLNotice -
@@ -1643,67 +1644,67 @@ static void DisposeSetDesc (pge_SetDesc *s);
    OptionalFactor -
 */
 
-static unsigned int OptionalFactor (pge_FactorDesc f);
+static bool OptionalFactor (pge_FactorDesc f);
 
 /*
    OptionalTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int OptionalTerm (pge_TermDesc t);
+static bool OptionalTerm (pge_TermDesc t);
 
 /*
    OptionalExpression -
 */
 
-static unsigned int OptionalExpression (pge_ExpressionDesc e);
+static bool OptionalExpression (pge_ExpressionDesc e);
 
 /*
    OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int OptionalStatement (pge_StatementDesc s);
+static bool OptionalStatement (pge_StatementDesc s);
 
 /*
    OptionalProduction -
 */
 
-static unsigned int OptionalProduction (pge_ProductionDesc p);
+static bool OptionalProduction (pge_ProductionDesc p);
 
 /*
    CheckFirstFollow -
 */
 
-static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after);
+static bool CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after);
 
 /*
    ConstrainedEmptyFactor -
 */
 
-static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f);
+static bool ConstrainedEmptyFactor (pge_FactorDesc f);
 
 /*
    ConstrainedEmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int ConstrainedEmptyTerm (pge_TermDesc t);
+static bool ConstrainedEmptyTerm (pge_TermDesc t);
 
 /*
    ConstrainedEmptyExpression -
 */
 
-static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e);
+static bool ConstrainedEmptyExpression (pge_ExpressionDesc e);
 
 /*
    ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s);
+static bool ConstrainedEmptyStatement (pge_StatementDesc s);
 
 /*
    ConstrainedEmptyProduction - returns TRUE if a problem exists with, p.
 */
 
-static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p);
+static bool ConstrainedEmptyProduction (pge_ProductionDesc p);
 
 /*
    TestForLALR1 -
@@ -1795,7 +1796,7 @@ static pge_FollowDesc NewFollow (void);
                    providing condition is TRUE.
 */
 
-static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value);
+static void AssignEpsilon (bool condition, pge_FollowDesc f, pge_TraverseResult value);
 
 /*
    GetEpsilon - returns the value of epsilon
@@ -1807,7 +1808,7 @@ static pge_TraverseResult GetEpsilon (pge_FollowDesc f);
    AssignReachEnd - assigns the reachend value providing that, condition, is TRUE.
 */
 
-static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value);
+static void AssignReachEnd (bool condition, pge_FollowDesc f, pge_TraverseResult value);
 
 /*
    GetReachEnd - returns the value of reachend
@@ -1909,21 +1910,21 @@ static void WriteIndent (unsigned int n);
    CheckWrite -
 */
 
-static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    WriteStringIndent - writes a string but it will try and remove upto indent spaces
                        if they exist.
 */
 
-static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    WriteCodeHunkListIndent - writes the CodeHunk list in the correct order
                              but it removes up to indent spaces if they exist.
 */
 
-static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext);
+static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext);
 
 /*
    Add - adds a character to a code hunk and creates another code hunk if necessary.
@@ -2598,13 +2599,13 @@ static void CodeThenDo (pge_m2condition m);
    CodeElseEnd - builds an ELSE END statement using string, end.
 */
 
-static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt);
+static void CodeElseEnd (const char *end_, unsigned int _end_high, bool consumed, pge_FactorDesc f, bool inopt);
 
 /*
    CodeEnd - codes a "END" depending upon, m.
 */
 
-static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt);
+static void CodeEnd (pge_m2condition m, pge_TermDesc t, bool consumed, pge_FactorDesc f, bool inopt);
 
 /*
    EmitNonVarCode - writes out, code, providing it is not a variable declaration.
@@ -2628,19 +2629,19 @@ static void FlushCode (pge_FactorDesc *codeStack);
    CodeFactor -
 */
 
-static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeTerm -
 */
 
-static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeTerm (pge_TermDesc t, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeExpression -
 */
 
-static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack);
+static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack);
 
 /*
    CodeStatement -
@@ -2716,7 +2717,7 @@ static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc c
                 and FALSE in the first.
 */
 
-static unsigned int OptExpSeen (pge_FactorDesc f);
+static bool OptExpSeen (pge_FactorDesc f);
 
 /*
    RecoverTerm -
@@ -2752,20 +2753,20 @@ static void EmitUsed (unsigned int wordno);
    EmitStopParameters - generate the stop set.
 */
 
-static void EmitStopParameters (unsigned int FormalParameters);
+static void EmitStopParameters (bool FormalParameters);
 
 /*
    IsBetween - returns TRUE if the value of the token, string, is
                in the range: low..high
 */
 
-static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned int high);
+static bool IsBetween (NameKey_Name string, unsigned int low, unsigned int high);
 
 /*
    IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high.
 */
 
-static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high);
+static bool IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high);
 
 /*
    EmitSet - emits the tokens in the set, to, which have values low..high
@@ -2818,13 +2819,13 @@ static void RecoverProduction (pge_ProductionDesc p);
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
 
 /*
    FindStr - returns TRUE if, str, was seen inside the code hunk
 */
 
-static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high);
+static bool FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high);
 
 /*
    WriteUpto -
@@ -2873,14 +2874,14 @@ static void VarProduction (pge_ProductionDesc p);
    In - returns TRUE if token, s, is already in the set, to.
 */
 
-static unsigned int In (pge_SetDesc to, NameKey_Name s);
+static bool In (pge_SetDesc to, NameKey_Name s);
 
 /*
    IntersectionIsNil - given two set lists, s1, s2, return TRUE if the
                        s1 * s2 = {}
 */
 
-static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2);
+static bool IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2);
 
 /*
    AddSet - adds a first symbol to a production.
@@ -3043,31 +3044,31 @@ static void CalcReachEndProduction (pge_ProductionDesc p);
    EmptyFactor -
 */
 
-static unsigned int EmptyFactor (pge_FactorDesc f);
+static bool EmptyFactor (pge_FactorDesc f);
 
 /*
    EmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int EmptyTerm (pge_TermDesc t);
+static bool EmptyTerm (pge_TermDesc t);
 
 /*
    EmptyExpression -
 */
 
-static unsigned int EmptyExpression (pge_ExpressionDesc e);
+static bool EmptyExpression (pge_ExpressionDesc e);
 
 /*
    EmptyStatement - returns TRUE if statement, s, is empty.
 */
 
-static unsigned int EmptyStatement (pge_StatementDesc s);
+static bool EmptyStatement (pge_StatementDesc s);
 
 /*
    EmptyProduction - returns if production, p, maybe empty.
 */
 
-static unsigned int EmptyProduction (pge_ProductionDesc p);
+static bool EmptyProduction (pge_ProductionDesc p);
 
 /*
    EmitFDLNotice -
@@ -3133,67 +3134,67 @@ static void DisposeSetDesc (pge_SetDesc *s);
    OptionalFactor -
 */
 
-static unsigned int OptionalFactor (pge_FactorDesc f);
+static bool OptionalFactor (pge_FactorDesc f);
 
 /*
    OptionalTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int OptionalTerm (pge_TermDesc t);
+static bool OptionalTerm (pge_TermDesc t);
 
 /*
    OptionalExpression -
 */
 
-static unsigned int OptionalExpression (pge_ExpressionDesc e);
+static bool OptionalExpression (pge_ExpressionDesc e);
 
 /*
    OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int OptionalStatement (pge_StatementDesc s);
+static bool OptionalStatement (pge_StatementDesc s);
 
 /*
    OptionalProduction -
 */
 
-static unsigned int OptionalProduction (pge_ProductionDesc p);
+static bool OptionalProduction (pge_ProductionDesc p);
 
 /*
    CheckFirstFollow -
 */
 
-static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after);
+static bool CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after);
 
 /*
    ConstrainedEmptyFactor -
 */
 
-static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f);
+static bool ConstrainedEmptyFactor (pge_FactorDesc f);
 
 /*
    ConstrainedEmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int ConstrainedEmptyTerm (pge_TermDesc t);
+static bool ConstrainedEmptyTerm (pge_TermDesc t);
 
 /*
    ConstrainedEmptyExpression -
 */
 
-static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e);
+static bool ConstrainedEmptyExpression (pge_ExpressionDesc e);
 
 /*
    ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s);
+static bool ConstrainedEmptyStatement (pge_StatementDesc s);
 
 /*
    ConstrainedEmptyProduction - returns TRUE if a problem exists with, p.
 */
 
-static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p);
+static bool ConstrainedEmptyProduction (pge_ProductionDesc p);
 
 /*
    TestForLALR1 -
@@ -3773,12 +3774,12 @@ static pge_FollowDesc NewFollow (void)
                    providing condition is TRUE.
 */
 
-static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value)
+static void AssignEpsilon (bool condition, pge_FollowDesc f, pge_TraverseResult value)
 {
   if ((condition && (value != pge_unknown)) && (f->epsilon == pge_unknown))
     {
       f->epsilon = value;
-      Finished = FALSE;
+      Finished = false;
     }
 }
 
@@ -3791,7 +3792,7 @@ static pge_TraverseResult GetEpsilon (pge_FollowDesc f)
 {
   if (f == NULL)
     {
-      Debug_Halt ((const char *) "why is the follow info NIL?", 27, 596, (const char *) "m2/gm2-auto/pge.mod", 19);
+      Debug_Halt ((const char *) "why is the follow info NIL?", 27, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "GetEpsilon", 10, 597);
     }
   else
     {
@@ -3806,14 +3807,14 @@ static pge_TraverseResult GetEpsilon (pge_FollowDesc f)
    AssignReachEnd - assigns the reachend value providing that, condition, is TRUE.
 */
 
-static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value)
+static void AssignReachEnd (bool condition, pge_FollowDesc f, pge_TraverseResult value)
 {
   if (condition)
     {
       if ((f->reachend == pge_unknown) && (value != pge_unknown))
         {
           f->reachend = value;
-          Finished = FALSE;
+          Finished = false;
         }
     }
 }
@@ -3827,7 +3828,7 @@ static pge_TraverseResult GetReachEnd (pge_FollowDesc f)
 {
   if (f == NULL)
     {
-      Debug_Halt ((const char *) "why is the follow info NIL?", 27, 630, (const char *) "m2/gm2-auto/pge.mod", 19);
+      Debug_Halt ((const char *) "why is the follow info NIL?", 27, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "GetReachEnd", 11, 632);
     }
   else
     {
@@ -3846,10 +3847,10 @@ static void AssignFollow (pge_FollowDesc f, pge_SetDesc s)
 {
   if (f->calcfollow)
     {
-      Debug_Halt ((const char *) "why are we reassigning this follow set?", 39, 646, (const char *) "m2/gm2-auto/pge.mod", 19);
+      Debug_Halt ((const char *) "why are we reassigning this follow set?", 39, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "AssignFollow", 12, 649);
     }
   f->follow = s;
-  f->calcfollow = TRUE;
+  f->calcfollow = true;
 }
 
 
@@ -3861,7 +3862,7 @@ static pge_SetDesc GetFollow (pge_FollowDesc f)
 {
   if (f == NULL)
     {
-      Debug_Halt ((const char *) "why is the follow info NIL?", 27, 662, (const char *) "m2/gm2-auto/pge.mod", 19);
+      Debug_Halt ((const char *) "why is the follow info NIL?", 27, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "GetFollow", 9, 666);
     }
   else
     {
@@ -3871,7 +3872,7 @@ static pge_SetDesc GetFollow (pge_FollowDesc f)
         }
       else
         {
-          Debug_Halt ((const char *) "not calculated the follow set yet..", 35, 669, (const char *) "m2/gm2-auto/pge.mod", 19);
+          Debug_Halt ((const char *) "not calculated the follow set yet..", 35, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "GetFollow", 9, 674);
         }
     }
   ReturnException ("m2/gm2-auto/pge.mod", 1, 7);
@@ -3900,7 +3901,7 @@ static pge_ProductionDesc NewProduction (void)
   p->next = NULL;
   p->statement = NULL;
   p->first = NULL;
-  p->firstsolved = FALSE;
+  p->firstsolved = false;
   p->followinfo = NewFollow ();
   p->line = PushBackInput_GetCurrentLine ();
   p->description = NameKey_NulName;
@@ -4109,7 +4110,7 @@ static void WriteCodeHunkList (pge_CodeHunk l)
 {
   if (l != NULL)
     {
-      OnLineStart = FALSE;
+      OnLineStart = false;
       /* recursion  */
       WriteCodeHunkList (l->next);
       Output_WriteString ((const char *) &l->codetext.array[0], MaxCodeHunkLength);
@@ -4128,7 +4129,7 @@ static void WriteIndent (unsigned int n)
       Output_Write (' ');
       n -= 1;
     }
-  OnLineStart = FALSE;
+  OnLineStart = false;
 }
 
 
@@ -4136,13 +4137,13 @@ static void WriteIndent (unsigned int n)
    CheckWrite -
 */
 
-static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, unsigned int *seentext)
+static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, bool *seentext)
 {
   if (ch == ASCII_lf)
     {
       NewLine (left);
       (*curpos) = 0;
-      (*seentext) = FALSE;
+      (*seentext) = false;
     }
   else
     {
@@ -4157,7 +4158,7 @@ static void CheckWrite (char ch, unsigned int *curpos, unsigned int left, unsign
                        if they exist.
 */
 
-static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext)
+static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext)
 {
   unsigned int l;
   unsigned int i;
@@ -4187,7 +4188,7 @@ static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned in
                 {
                   WriteIndent ((*curpos)-indent);
                 }
-              (*seentext) = TRUE;
+              (*seentext) = true;
               CheckWrite (a[i], curpos, left, seentext);
             }
         }
@@ -4201,7 +4202,7 @@ static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned in
                              but it removes up to indent spaces if they exist.
 */
 
-static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext)
+static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, bool *seentext)
 {
   if (l != NULL)
     {
@@ -4307,7 +4308,7 @@ static void SyntaxError (pge_SetOfStop stop)
       StrIO_WriteString ((const char *) " ***", 4);
       StrIO_WriteLn ();
     }
-  WasNoError = FALSE;
+  WasNoError = false;
 }
 
 
@@ -4366,7 +4367,7 @@ static void Modula2Code (pge_SetOfStop stop)
 {
   pge_CodeHunk p;
   unsigned int i;
-  unsigned int quote;
+  bool quote;
   unsigned int line;
   unsigned int position;
 
@@ -4606,13 +4607,13 @@ static void Special (pge_SetOfStop stopset)
   Ident (stopset|(pge_SetOfStop) ((1 << (bnflex_firsttok-bnflex_identtok))));
   p = NewProduction ();
   p->statement = NewStatement ();
-  p->statement->followinfo->calcfollow = TRUE;
+  p->statement->followinfo->calcfollow = true;
   p->statement->followinfo->epsilon = pge_false;
   p->statement->followinfo->reachend = pge_false;
   p->statement->ident = CurrentIdent;
   p->statement->expr = NULL;
-  p->firstsolved = TRUE;
-  p->followinfo->calcfollow = TRUE;
+  p->firstsolved = true;
+  p->followinfo->calcfollow = true;
   p->followinfo->epsilon = pge_false;
   p->followinfo->reachend = pge_false;
   First (stopset|(pge_SetOfStop) ((1 << (bnflex_followtok-bnflex_identtok))));
@@ -5336,7 +5337,7 @@ static void BackPatchIdent (pge_IdentDesc i)
       if (i->definition == NULL)
         {
           WarnError1 ((const char *) "unable to find production %s", 28, i->name);
-          WasNoError = FALSE;
+          WasNoError = false;
         }
     }
 }
@@ -5484,7 +5485,7 @@ static void ForeachRuleDo (pge_DoProcedure p)
 static void WhileNotCompleteDo (pge_DoProcedure p)
 {
   do {
-    Finished = TRUE;
+    Finished = true;
     ForeachRuleDo (p);
   } while (! (Finished));
 }
@@ -5497,7 +5498,7 @@ static void WhileNotCompleteDo (pge_DoProcedure p)
 static void NewLine (unsigned int Left)
 {
   Output_WriteLn ();
-  BeginningOfLine = TRUE;
+  BeginningOfLine = true;
   Indent = 0;
   while (Indent < Left)
     {
@@ -5633,7 +5634,7 @@ static void WriteKeyTexinfo (NameKey_Name s)
 static void PrettyCommentFactor (pge_FactorDesc f, unsigned int Left)
 {
   unsigned int curpos;
-  unsigned int seentext;
+  bool seentext;
 
   while (f != NULL)
     {
@@ -5686,7 +5687,7 @@ static void PrettyCommentFactor (pge_FactorDesc f, unsigned int Left)
               {
                 NewLine (Left);
                 Output_WriteString ((const char *) "% ", 2);
-                seentext = FALSE;
+                seentext = false;
                 curpos = 0;
                 WriteCodeHunkListIndent (f->code->code, f->code->indent, &curpos, Left+2, &seentext);
                 Output_WriteString ((const char *) " %", 2);
@@ -5852,7 +5853,7 @@ static void PrettyCommentProduction (pge_ProductionDesc p)
 
   if (p != NULL)
     {
-      BeginningOfLine = TRUE;
+      BeginningOfLine = true;
       Indent = 0;
       Output_WriteString ((const char *) "(*", 2);
       NewLine (3);
@@ -5905,7 +5906,7 @@ static void PrettyPrintProduction (pge_ProductionDesc p)
 
   if (p != NULL)
     {
-      BeginningOfLine = TRUE;
+      BeginningOfLine = true;
       Indent = 0;
       if (Texinfo)
         {
@@ -5973,7 +5974,7 @@ static void EmitFileLineTag (unsigned int line)
       Output_WriteString ((const char *) &FileName.array[0], MaxFileName);
       Output_Write ('"');
       Output_WriteLn ();
-      OnLineStart = TRUE;
+      OnLineStart = true;
     }
 }
 
@@ -6026,7 +6027,7 @@ static void CodeCondition (pge_m2condition m)
 
 
       default:
-        Debug_Halt ((const char *) "unrecognised m2condition", 24, 2680, (const char *) "m2/gm2-auto/pge.mod", 19);
+        Debug_Halt ((const char *) "unrecognised m2condition", 24, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "CodeCondition", 13, 2686);
         break;
     }
 }
@@ -6058,10 +6059,10 @@ static void CodeThenDo (pge_m2condition m)
 
 
       default:
-        Debug_Halt ((const char *) "unrecognised m2condition", 24, 2705, (const char *) "m2/gm2-auto/pge.mod", 19);
+        Debug_Halt ((const char *) "unrecognised m2condition", 24, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "CodeThenDo", 10, 2712);
         break;
     }
-  OnLineStart = TRUE;
+  OnLineStart = true;
 }
 
 
@@ -6069,7 +6070,7 @@ static void CodeThenDo (pge_m2condition m)
    CodeElseEnd - builds an ELSE END statement using string, end.
 */
 
-static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt)
+static void CodeElseEnd (const char *end_, unsigned int _end_high, bool consumed, pge_FactorDesc f, bool inopt)
 {
   char end[_end_high+1];
 
@@ -6077,7 +6078,7 @@ static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int
   memcpy (end, end_, _end_high+1);
 
   Output_WriteLn ();
-  OnLineStart = TRUE;
+  OnLineStart = true;
   EmitFileLineTag (f->line);
   if (! inopt)
     {
@@ -6137,7 +6138,7 @@ static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int
     }
   IndentString ((const char *) end, _end_high);
   Output_WriteLn ();
-  OnLineStart = TRUE;
+  OnLineStart = true;
 }
 
 
@@ -6145,11 +6146,11 @@ static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int
    CodeEnd - codes a "END" depending upon, m.
 */
 
-static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt)
+static void CodeEnd (pge_m2condition m, pge_TermDesc t, bool consumed, pge_FactorDesc f, bool inopt)
 {
   Indent -= 3;
   Output_WriteLn ();
-  OnLineStart = TRUE;
+  OnLineStart = true;
   switch (m)
     {
       case pge_m2none:
@@ -6179,10 +6180,10 @@ static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, p
 
 
       default:
-        Debug_Halt ((const char *) "unrecognised m2condition", 24, 2788, (const char *) "m2/gm2-auto/pge.mod", 19);
+        Debug_Halt ((const char *) "unrecognised m2condition", 24, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "CodeEnd", 7, 2796);
         break;
     }
-  OnLineStart = FALSE;
+  OnLineStart = false;
 }
 
 
@@ -6194,19 +6195,19 @@ static void EmitNonVarCode (pge_CodeDesc code, unsigned int curpos, unsigned int
 {
   unsigned int i;
   pge_CodeHunk t;
-  unsigned int seentext;
+  bool seentext;
 
   t = code->code;
   if ((! (FindStr (&t, &i, (const char *) "VAR", 3))) && EmitCode)
     {
-      seentext = FALSE;
+      seentext = false;
       curpos = 0;
       EmitFileLineTag (code->line);
       IndentString ((const char *) "", 0);
       WriteCodeHunkListIndent (code->code, code->indent, &curpos, left, &seentext);
       Output_WriteString ((const char *) " ;", 2);
       Output_WriteLn ();
-      OnLineStart = TRUE;
+      OnLineStart = true;
     }
 }
 
@@ -6249,7 +6250,7 @@ static void FlushCode (pge_FactorDesc *codeStack)
     {
       NewLine (Indent);
       Output_WriteString ((const char *) "(* begin flushing code *)", 25);
-      OnLineStart = FALSE;
+      OnLineStart = false;
       while ((*codeStack) != NULL)
         {
           NewLine (Indent);
@@ -6260,12 +6261,12 @@ static void FlushCode (pge_FactorDesc *codeStack)
             {
               Output_WriteString ((const char *) " (* again flushing code *)", 26);
               Output_WriteLn ();
-              OnLineStart = TRUE;
+              OnLineStart = true;
             }
         }
       NewLine (Indent);
       Output_WriteString ((const char *) "(* end flushing code *)", 23);
-      OnLineStart = FALSE;
+      OnLineStart = false;
     }
 }
 
@@ -6274,7 +6275,7 @@ static void FlushCode (pge_FactorDesc *codeStack)
    CodeFactor -
 */
 
-static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack)
+static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack)
 {
   if (f == NULL)
     {
@@ -6283,7 +6284,7 @@ static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge
         {
           Output_WriteLn ();
           IndentString ((const char *) "RETURN( TRUE )", 14);
-          OnLineStart = FALSE;
+          OnLineStart = false;
         }
     }
   else
@@ -6298,7 +6299,7 @@ static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge
             Output_WriteString ((const char *) "()", 2);
             CodeThenDo (n);
             Indent += 3;
-            CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, TRUE, NULL);
+            CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, true, NULL);
             CodeEnd (n, t, consumed, f, inopt);
             break;
 
@@ -6311,7 +6312,7 @@ static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge
             Output_Write (')');
             CodeThenDo (n);
             Indent += 3;
-            CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, TRUE, NULL);
+            CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, true, NULL);
             CodeEnd (n, t, consumed, f, inopt);
             break;
 
@@ -6324,19 +6325,19 @@ static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge
                     *  the test above makes sure that we don't emit a RETURN( TRUE )
                     *  after a subexpression. Remember sub expressions are not conditional
   */
-                CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, TRUE, NULL);
+                CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, true, NULL);
               }
             break;
 
           case pge_opt:
             FlushCode (&codeStack);
-            CodeExpression (f->expr, pge_m2if, TRUE, inwhile, FALSE, NULL);
+            CodeExpression (f->expr, pge_m2if, true, inwhile, false, NULL);
             CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, consumed, NULL);
             break;
 
           case pge_mult:
             FlushCode (&codeStack);
-            CodeExpression (f->expr, pge_m2while, FALSE, TRUE, consumed, NULL);
+            CodeExpression (f->expr, pge_m2while, false, true, consumed, NULL);
             CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, consumed, NULL);
             break;
 
@@ -6361,7 +6362,7 @@ static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge
    CodeTerm -
 */
 
-static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack)
+static void CodeTerm (pge_TermDesc t, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack)
 {
   pge_m2condition l;
 
@@ -6374,13 +6375,13 @@ static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, uns
           m = pge_m2if;
           IndentString ((const char *) "ELSE", 4);
           Output_WriteLn ();
-          OnLineStart = TRUE;
+          OnLineStart = true;
           Indent += 3;
           CodeFactor (t->factor, t->next, pge_m2none, pge_m2none, inopt, inwhile, consumed, codeStack);
           Indent -= 3;
           IndentString ((const char *) "END ;", 5);
           Output_WriteLn ();
-          OnLineStart = TRUE;
+          OnLineStart = true;
         }
       else
         {
@@ -6400,7 +6401,7 @@ static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, uns
    CodeExpression -
 */
 
-static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack)
+static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, bool inopt, bool inwhile, bool consumed, pge_FactorDesc codeStack)
 {
   if (e != NULL)
     {
@@ -6419,7 +6420,7 @@ static void CodeStatement (pge_StatementDesc s, pge_m2condition m)
   if (s != NULL)
     {
       EmitFileLineTag (s->line);
-      CodeExpression (s->expr, m, FALSE, FALSE, FALSE, NULL);
+      CodeExpression (s->expr, m, false, false, false, NULL);
     }
 }
 
@@ -6432,7 +6433,7 @@ static void CodeProduction (pge_ProductionDesc p)
 {
   if ((p != NULL) && (! p->firstsolved || ((p->statement != NULL) && (p->statement->expr != NULL))))
     {
-      BeginningOfLine = TRUE;
+      BeginningOfLine = true;
       Indent = 0;
       Output_WriteLn ();
       EmitFileLineTag (p->line);
@@ -6441,11 +6442,11 @@ static void CodeProduction (pge_ProductionDesc p)
       Output_WriteString ((const char *) " () : BOOLEAN ;", 15);
       VarProduction (p);
       Output_WriteLn ();
-      OnLineStart = TRUE;
+      OnLineStart = true;
       EmitFileLineTag (p->line);
       IndentString ((const char *) "BEGIN", 5);
       StrIO_WriteLn ();
-      OnLineStart = FALSE;
+      OnLineStart = false;
       EmitFileLineTag (p->line);
       Indent = 3;
       CodeStatement (p->statement, pge_m2none);
@@ -6487,7 +6488,7 @@ static void RecoverCondition (pge_m2condition m)
 
 
       default:
-        Debug_Halt ((const char *) "unrecognised m2condition", 24, 3045, (const char *) "m2/gm2-auto/pge.mod", 19);
+        Debug_Halt ((const char *) "unrecognised m2condition", 24, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "RecoverCondition", 16, 3054);
         break;
     }
 }
@@ -6519,7 +6520,7 @@ static unsigned int ConditionIndent (pge_m2condition m)
 
 
       default:
-        Debug_Halt ((const char *) "unrecognised m2condition", 24, 3064, (const char *) "m2/gm2-auto/pge.mod", 19);
+        Debug_Halt ((const char *) "unrecognised m2condition", 24, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "ConditionIndent", 15, 3074);
         break;
     }
   ReturnException ("m2/gm2-auto/pge.mod", 1, 7);
@@ -6566,13 +6567,13 @@ static unsigned int NumberOfElements (pge_SetDesc to, unsigned int low, unsigned
 
           case pge_idel:
             PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "unknown enuneration element", 27);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       to = to->next;
@@ -6681,7 +6682,7 @@ static void EmitIsInSubSet (pge_SetDesc to, unsigned int low, unsigned int high)
 static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m)
 {
   unsigned int i;
-  unsigned int first;
+  bool first;
 
   if ((NumberOfElements (to, static_cast<unsigned int> (0), static_cast<unsigned int> (0))) == 1)
     {
@@ -6703,7 +6704,7 @@ static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m)
       else
         {
           i = 0;
-          first = TRUE;
+          first = true;
           do {
             if (! (IsEmptySet (to, i*MaxElementsInSet, ((i+1)*MaxElementsInSet)-1)))
               {
@@ -6714,7 +6715,7 @@ static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m)
                     Indent -= ConditionIndent (m);
                   }
                 EmitIsInSubSet (to, i*MaxElementsInSet, ((i+1)*MaxElementsInSet)-1);
-                first = FALSE;
+                first = false;
               }
             i += 1;
           } while (! ((i*MaxElementsInSet) > LargestValue));
@@ -6907,11 +6908,11 @@ static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc c
                 and FALSE in the first.
 */
 
-static unsigned int OptExpSeen (pge_FactorDesc f)
+static bool OptExpSeen (pge_FactorDesc f)
 {
   if (f == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -6919,11 +6920,11 @@ static unsigned int OptExpSeen (pge_FactorDesc f)
         {
           case pge_id:
           case pge_lit:
-            return FALSE;
+            return false;
             break;
 
           case pge_sub:
-            return FALSE;  /* is this correct?  */
+            return false;  /* is this correct?  */
             break;
 
           case pge_opt:
@@ -6932,7 +6933,7 @@ static unsigned int OptExpSeen (pge_FactorDesc f)
             break;
 
           case pge_m2:
-            return TRUE;
+            return true;
             break;
 
 
@@ -6941,7 +6942,7 @@ static unsigned int OptExpSeen (pge_FactorDesc f)
         }
     }
   PushBackInput_WarnError ((const char *) "all cases were not handled", 26);
-  WasNoError = FALSE;
+  WasNoError = false;
   ReturnException ("m2/gm2-auto/pge.mod", 1, 7);
   __builtin_unreachable ();
 }
@@ -6953,14 +6954,14 @@ static unsigned int OptExpSeen (pge_FactorDesc f)
 
 static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition old)
 {
-  unsigned int LastWasM2Only;
-  unsigned int alternative;
+  bool LastWasM2Only;
+  bool alternative;
   pge_SetDesc to;
 
   LastWasM2Only = (t->factor->type == pge_m2) && (t->factor->next == NULL);  /* does the factor only contain inline code?  */
   to = NULL;
   CalcFirstTerm (t, NULL, &to);
-  alternative = FALSE;
+  alternative = false;
   if (t->next != NULL)
     {
       new_ = pge_m2if;
@@ -6976,7 +6977,7 @@ static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition o
           Output_WriteLn ();
           Indent += 3;
           RecoverFactor (t->factor, pge_m2none, NULL);
-          alternative = FALSE;
+          alternative = false;
         }
       else
         {
@@ -6985,7 +6986,7 @@ static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition o
       if (t->next != NULL)
         {
           new_ = pge_m2elsif;
-          alternative = TRUE;
+          alternative = true;
         }
       t = t->next;
     }
@@ -7080,7 +7081,7 @@ static void EmitUsed (unsigned int wordno)
    EmitStopParameters - generate the stop set.
 */
 
-static void EmitStopParameters (unsigned int FormalParameters)
+static void EmitStopParameters (bool FormalParameters)
 {
   unsigned int i;
 
@@ -7136,7 +7137,7 @@ static void EmitStopParameters (unsigned int FormalParameters)
                in the range: low..high
 */
 
-static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned int high)
+static bool IsBetween (NameKey_Name string, unsigned int low, unsigned int high)
 {
   return ((SymbolKey_GetSymKey (Values, string)) >= low) && ((SymbolKey_GetSymKey (Values, string)) <= high);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -7148,7 +7149,7 @@ static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned i
    IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high.
 */
 
-static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high)
+static bool IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high)
 {
   while (to != NULL)
     {
@@ -7157,31 +7158,31 @@ static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int h
           case pge_tokel:
             if (IsBetween (to->string, low, high))
               {
-                return FALSE;
+                return false;
               }
             break;
 
           case pge_litel:
             if (IsBetween (SymbolKey_GetSymKey (Aliases, to->string), low, high))
               {
-                return FALSE;
+                return false;
               }
             break;
 
           case pge_idel:
             PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "unknown enuneration element", 27);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       to = to->next;
     }
-  return TRUE;
+  return true;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -7193,9 +7194,9 @@ static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int h
 
 static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high)
 {
-  unsigned int first;
+  bool first;
 
-  first = TRUE;
+  first = true;
   while (to != NULL)
     {
       switch (to->type)
@@ -7208,7 +7209,7 @@ static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high)
                     Output_WriteString ((const char *) ", ", 2);
                   }
                 Output_WriteKey (to->string);
-                first = FALSE;
+                first = false;
               }
             break;
 
@@ -7220,19 +7221,19 @@ static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high)
                     Output_WriteString ((const char *) ", ", 2);
                   }
                 Output_WriteKey (SymbolKey_GetSymKey (Aliases, to->string));
-                first = FALSE;
+                first = false;
               }
             break;
 
           case pge_idel:
             PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "unknown enuneration element", 27);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       to = to->next;
@@ -7275,13 +7276,13 @@ static void EmitSetName (pge_SetDesc to, unsigned int low, unsigned int high)
 
           case pge_idel:
             PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "unknown enuneration element", 27);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       to = to->next;
@@ -7427,10 +7428,10 @@ static void RecoverProduction (pge_ProductionDesc p)
 
   if ((p != NULL) && (! p->firstsolved || ((p->statement != NULL) && (p->statement->expr != NULL))))
     {
-      BeginningOfLine = TRUE;
+      BeginningOfLine = true;
       Indent = 0;
       Output_WriteLn ();
-      OnLineStart = FALSE;
+      OnLineStart = false;
       EmitFileLineTag (p->line);
       IndentString ((const char *) "PROCEDURE ", 10);
       Output_WriteKey (GetDefinitionName (p));
@@ -7440,12 +7441,12 @@ static void RecoverProduction (pge_ProductionDesc p)
       Output_WriteString ((const char *) ") ;", 3);
       VarProduction (p);
       Output_WriteLn ();
-      OnLineStart = FALSE;
+      OnLineStart = false;
       EmitFileLineTag (p->line);
       Indent = 0;
       IndentString ((const char *) "BEGIN", 5);
       Output_WriteLn ();
-      OnLineStart = FALSE;
+      OnLineStart = false;
       EmitFileLineTag (p->line);
       Indent = 3;
       RecoverStatement (p->statement, pge_m2none);
@@ -7457,7 +7458,7 @@ static void RecoverProduction (pge_ProductionDesc p)
       Output_WriteLn ();
       Output_WriteLn ();
       s = Output_EndBuffer ();
-      EmitStopParameters (TRUE);
+      EmitStopParameters (true);
       Output_KillWriteS (s);
     }
 }
@@ -7467,7 +7468,7 @@ static void RecoverProduction (pge_ProductionDesc p)
    IsWhite - returns TRUE if, ch, is a space or a tab.
 */
 
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
 {
   return ((ch == ' ') || (ch == ASCII_tab)) || (ch == ASCII_lf);
   /* static analysis guarentees a RETURN statement will be used before here.  */
@@ -7479,7 +7480,7 @@ static unsigned int IsWhite (char ch)
    FindStr - returns TRUE if, str, was seen inside the code hunk
 */
 
-static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high)
+static bool FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high)
 {
   unsigned int j;
   unsigned int k;
@@ -7582,7 +7583,7 @@ static void CheckForVar (pge_CodeHunk code)
           IndentString ((const char *) "VAR", 3);
           Indent += 3;
           Output_WriteLn ();
-          EmittedVar = TRUE;
+          EmittedVar = true;
         }
       WriteUpto (code, t, i);
     }
@@ -7670,7 +7671,7 @@ static void VarStatement (pge_StatementDesc s)
 
 static void VarProduction (pge_ProductionDesc p)
 {
-  EmittedVar = FALSE;
+  EmittedVar = false;
   if (p != NULL)
     {
       VarStatement (p->statement);
@@ -7682,7 +7683,7 @@ static void VarProduction (pge_ProductionDesc p)
    In - returns TRUE if token, s, is already in the set, to.
 */
 
-static unsigned int In (pge_SetDesc to, NameKey_Name s)
+static bool In (pge_SetDesc to, NameKey_Name s)
 {
   while (to != NULL)
     {
@@ -7691,7 +7692,7 @@ static unsigned int In (pge_SetDesc to, NameKey_Name s)
           case pge_idel:
             if (s == to->ident->name)
               {
-                return TRUE;
+                return true;
               }
             break;
 
@@ -7699,19 +7700,19 @@ static unsigned int In (pge_SetDesc to, NameKey_Name s)
           case pge_litel:
             if (s == to->string)
               {
-                return TRUE;
+                return true;
               }
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "internal error CASE type not known", 34);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       to = to->next;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -7722,7 +7723,7 @@ static unsigned int In (pge_SetDesc to, NameKey_Name s)
                        s1 * s2 = {}
 */
 
-static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2)
+static bool IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2)
 {
   while (s1 != NULL)
     {
@@ -7731,7 +7732,7 @@ static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2)
           case pge_idel:
             if (In (s2, s1->ident->name))
               {
-                return FALSE;
+                return false;
               }
             break;
 
@@ -7739,19 +7740,19 @@ static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2)
           case pge_litel:
             if (In (s2, s1->string))
               {
-                return FALSE;
+                return false;
               }
             break;
 
 
           default:
             PushBackInput_WarnError ((const char *) "internal error CASE type not known", 34);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
         }
       s1 = s1->next;
     }
-  return TRUE;
+  return true;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -7772,7 +7773,7 @@ static void AddSet (pge_SetDesc *to, NameKey_Name s)
       d->string = s;
       d->next = (*to);
       (*to) = d;
-      Finished = FALSE;
+      Finished = false;
     }
 }
 
@@ -7797,12 +7798,12 @@ static void OrSet (pge_SetDesc *to, pge_SetDesc from)
 
           case pge_idel:
             PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40);
-            WasNoError = FALSE;
+            WasNoError = false;
             break;
 
 
           default:
-            Debug_Halt ((const char *) "unknown element in enumeration type", 35, 4122, (const char *) "m2/gm2-auto/pge.mod", 19);
+            Debug_Halt ((const char *) "unknown element in enumeration type", 35, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "OrSet", 5, 4133);
             break;
         }
       from = from->next;
@@ -7838,7 +7839,7 @@ static void CalcFirstFactor (pge_FactorDesc f, pge_ProductionDesc from, pge_SetD
             if ((SymbolKey_GetSymKey (Aliases, f->string)) == SymbolKey_NulKey)
               {
                 WarnError1 ((const char *) "unknown token for '%s'", 22, f->string);
-                WasNoError = FALSE;
+                WasNoError = false;
               }
             else
               {
@@ -7997,7 +7998,7 @@ static void WorkOutFollowFactor (pge_FactorDesc f, pge_SetDesc *followset, pge_S
         {
           PushBackInput_WarnError ((const char *) "internal error: epsilon unknown", 31);
           PrettyCommentFactor (f, 3);
-          WasNoError = FALSE;
+          WasNoError = false;
         }
       foundepsilon = GetEpsilon (f->followinfo);
       canreachend = GetReachEnd (f->followinfo);  /* only goes from FALSE -> TRUE  */
@@ -8183,7 +8184,7 @@ static void CalcEpsilonFactor (pge_FactorDesc f)
             break;
 
           case pge_lit:
-            AssignEpsilon (TRUE, f->followinfo, pge_false);
+            AssignEpsilon (true, f->followinfo, pge_false);
             break;
 
           case pge_sub:
@@ -8192,13 +8193,13 @@ static void CalcEpsilonFactor (pge_FactorDesc f)
             break;
 
           case pge_m2:
-            AssignEpsilon (TRUE, f->followinfo, pge_true);
+            AssignEpsilon (true, f->followinfo, pge_true);
             break;
 
           case pge_opt:
           case pge_mult:
             CalcEpsilonExpression (f->expr);
-            AssignEpsilon (TRUE, f->followinfo, pge_true);
+            AssignEpsilon (true, f->followinfo, pge_true);
             break;
 
 
@@ -8225,11 +8226,11 @@ static void CalcEpsilonTerm (pge_TermDesc t)
               switch (GetReachEnd (t->factor->followinfo))
                 {
                   case pge_true:
-                    AssignEpsilon (TRUE, t->followinfo, pge_true);
+                    AssignEpsilon (true, t->followinfo, pge_true);
                     break;
 
                   case pge_false:
-                    AssignEpsilon (TRUE, t->followinfo, pge_false);
+                    AssignEpsilon (true, t->followinfo, pge_false);
                     break;
 
                   case pge_unknown:
@@ -8550,7 +8551,7 @@ static void CalcReachEndProduction (pge_ProductionDesc p)
    EmptyFactor -
 */
 
-static unsigned int EmptyFactor (pge_FactorDesc f)
+static bool EmptyFactor (pge_FactorDesc f)
 {
   while (f != NULL)
     {
@@ -8559,24 +8560,24 @@ static unsigned int EmptyFactor (pge_FactorDesc f)
           case pge_id:
             if (! (EmptyProduction (f->ident->definition)))
               {
-                return FALSE;
+                return false;
               }
             break;
 
           case pge_lit:
-            return FALSE;
+            return false;
             break;
 
           case pge_sub:
             if (! (EmptyExpression (f->expr)))
               {
-                return FALSE;
+                return false;
               }
             break;
 
           case pge_opt:
           case pge_mult:
-            return TRUE;
+            return true;
             break;
 
           case pge_m2:
@@ -8588,7 +8589,7 @@ static unsigned int EmptyFactor (pge_FactorDesc f)
         }
       f = f->next;
     }
-  return TRUE;
+  return true;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -8598,20 +8599,20 @@ static unsigned int EmptyFactor (pge_FactorDesc f)
    EmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int EmptyTerm (pge_TermDesc t)
+static bool EmptyTerm (pge_TermDesc t)
 {
   while (t != NULL)
     {
       if (EmptyFactor (t->factor))
         {
-          return TRUE;
+          return true;
         }
       else
         {
           t = t->next;
         }
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -8621,11 +8622,11 @@ static unsigned int EmptyTerm (pge_TermDesc t)
    EmptyExpression -
 */
 
-static unsigned int EmptyExpression (pge_ExpressionDesc e)
+static bool EmptyExpression (pge_ExpressionDesc e)
 {
   if (e == NULL)
     {
-      return TRUE;
+      return true;
     }
   else
     {
@@ -8640,11 +8641,11 @@ static unsigned int EmptyExpression (pge_ExpressionDesc e)
    EmptyStatement - returns TRUE if statement, s, is empty.
 */
 
-static unsigned int EmptyStatement (pge_StatementDesc s)
+static bool EmptyStatement (pge_StatementDesc s)
 {
   if (s == NULL)
     {
-      return TRUE;
+      return true;
     }
   else
     {
@@ -8659,18 +8660,18 @@ static unsigned int EmptyStatement (pge_StatementDesc s)
    EmptyProduction - returns if production, p, maybe empty.
 */
 
-static unsigned int EmptyProduction (pge_ProductionDesc p)
+static bool EmptyProduction (pge_ProductionDesc p)
 {
   if (p == NULL)
     {
       PushBackInput_WarnError ((const char *) "unknown production", 18);
-      return TRUE;
+      return true;
     }
   else if (p->firstsolved && (p->first != NULL))
     {
       /* avoid dangling else.  */
       /* predefined but first set to something - thus not empty  */
-      return FALSE;
+      return false;
     }
   else
     {
@@ -8726,7 +8727,7 @@ static void DescribeElement (unsigned int name)
 
   if (InitialElement)
     {
-      InitialElement = FALSE;
+      InitialElement = false;
     }
   else
     {
@@ -8954,7 +8955,7 @@ static void EmitDescribeStop (void)
   Output_WriteLn ();
   Output_WriteLn ();
   s = Output_EndBuffer ();
-  EmitStopParameters (TRUE);
+  EmitStopParameters (true);
   Output_KillWriteS (s);
 }
 
@@ -8996,7 +8997,7 @@ static void EmitDescribeError (void)
   WriteGetTokenType ();
   Output_WriteString ((const char *) " OF", 3);
   NewLine (3);
-  InitialElement = TRUE;
+  InitialElement = true;
   SymbolKey_ForeachNodeDo (Aliases, (SymbolKey_PerformOperation) {(SymbolKey_PerformOperation_t) DescribeElement});
   Output_WriteLn ();
   Indent = 3;
@@ -9136,7 +9137,7 @@ static void DisposeSetDesc (pge_SetDesc *s)
    OptionalFactor -
 */
 
-static unsigned int OptionalFactor (pge_FactorDesc f)
+static bool OptionalFactor (pge_FactorDesc f)
 {
   while (f != NULL)
     {
@@ -9153,7 +9154,7 @@ static unsigned int OptionalFactor (pge_FactorDesc f)
           case pge_mult:
             if (OptionalExpression (f->expr))
               {
-                return TRUE;
+                return true;
               }
             break;
 
@@ -9166,7 +9167,7 @@ static unsigned int OptionalFactor (pge_FactorDesc f)
         }
       f = f->next;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -9176,7 +9177,7 @@ static unsigned int OptionalFactor (pge_FactorDesc f)
    OptionalTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int OptionalTerm (pge_TermDesc t)
+static bool OptionalTerm (pge_TermDesc t)
 {
   pge_TermDesc u;
   pge_TermDesc v;
@@ -9188,7 +9189,7 @@ static unsigned int OptionalTerm (pge_TermDesc t)
     {
       if (OptionalFactor (u->factor))
         {
-          return TRUE;
+          return true;
         }
       v = t;
       tou = NULL;
@@ -9213,7 +9214,7 @@ static unsigned int OptionalTerm (pge_TermDesc t)
                   StrIO_WriteLn ();
                   DisposeSetDesc (&tou);
                   DisposeSetDesc (&tov);
-                  return TRUE;
+                  return true;
                 }
             }
           v = v->next;
@@ -9221,7 +9222,7 @@ static unsigned int OptionalTerm (pge_TermDesc t)
       DisposeSetDesc (&tou);
       u = u->next;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -9231,11 +9232,11 @@ static unsigned int OptionalTerm (pge_TermDesc t)
    OptionalExpression -
 */
 
-static unsigned int OptionalExpression (pge_ExpressionDesc e)
+static bool OptionalExpression (pge_ExpressionDesc e)
 {
   if (e == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9250,11 +9251,11 @@ static unsigned int OptionalExpression (pge_ExpressionDesc e)
    OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int OptionalStatement (pge_StatementDesc s)
+static bool OptionalStatement (pge_StatementDesc s)
 {
   if (s == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9269,11 +9270,11 @@ static unsigned int OptionalStatement (pge_StatementDesc s)
    OptionalProduction -
 */
 
-static unsigned int OptionalProduction (pge_ProductionDesc p)
+static bool OptionalProduction (pge_ProductionDesc p)
 {
   if (p == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9288,7 +9289,7 @@ static unsigned int OptionalProduction (pge_ProductionDesc p)
    CheckFirstFollow -
 */
 
-static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after)
+static bool CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after)
 {
   pge_SetDesc first;
   pge_SetDesc follow;
@@ -9301,7 +9302,7 @@ static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after)
     {
       DisposeSetDesc (&first);
       DisposeSetDesc (&follow);
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9315,7 +9316,7 @@ static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after)
       NewLine (3);
       DisposeSetDesc (&first);
       DisposeSetDesc (&follow);
-      return TRUE;
+      return true;
     }
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
@@ -9326,7 +9327,7 @@ static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after)
    ConstrainedEmptyFactor -
 */
 
-static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f)
+static bool ConstrainedEmptyFactor (pge_FactorDesc f)
 {
   while (f != NULL)
     {
@@ -9343,7 +9344,7 @@ static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f)
           case pge_mult:
             if (ConstrainedEmptyExpression (f->expr))
               {
-                return TRUE;
+                return true;
               }
             break;
 
@@ -9356,11 +9357,11 @@ static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f)
         }
       if (((f->type != pge_m2) && (EmptyFactor (f))) && (CheckFirstFollow (f, f->next)))
         {
-          return TRUE;
+          return true;
         }
       f = f->next;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -9370,7 +9371,7 @@ static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f)
    ConstrainedEmptyTerm - returns TRUE if the term maybe empty.
 */
 
-static unsigned int ConstrainedEmptyTerm (pge_TermDesc t)
+static bool ConstrainedEmptyTerm (pge_TermDesc t)
 {
   pge_SetDesc first;
   pge_SetDesc follow;
@@ -9379,16 +9380,16 @@ static unsigned int ConstrainedEmptyTerm (pge_TermDesc t)
     {
       if (ConstrainedEmptyFactor (t->factor))
         {
-          return TRUE;
+          return true;
         }
       else if (((t->factor->type != pge_m2) && (EmptyFactor (t->factor))) && (CheckFirstFollow (t->factor, t->factor->next)))
         {
           /* avoid dangling else.  */
-          return TRUE;
+          return true;
         }
       t = t->next;
     }
-  return FALSE;
+  return false;
   /* static analysis guarentees a RETURN statement will be used before here.  */
   __builtin_unreachable ();
 }
@@ -9398,11 +9399,11 @@ static unsigned int ConstrainedEmptyTerm (pge_TermDesc t)
    ConstrainedEmptyExpression -
 */
 
-static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e)
+static bool ConstrainedEmptyExpression (pge_ExpressionDesc e)
 {
   if (e == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9417,11 +9418,11 @@ static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e)
    ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity.
 */
 
-static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s)
+static bool ConstrainedEmptyStatement (pge_StatementDesc s)
 {
   if (s == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9436,11 +9437,11 @@ static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s)
    ConstrainedEmptyProduction - returns TRUE if a problem exists with, p.
 */
 
-static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p)
+static bool ConstrainedEmptyProduction (pge_ProductionDesc p)
 {
   if (p == NULL)
     {
-      return FALSE;
+      return false;
     }
   else
     {
@@ -9460,7 +9461,7 @@ static void TestForLALR1 (pge_ProductionDesc p)
   if (OptionalProduction (p))
     {
       WarnError1 ((const char *) "production %s has two optional sentances using | which both have the same start symbols", 87, p->statement->ident->name);
-      WasNoError = FALSE;
+      WasNoError = false;
       PrettyCommentProduction (p);
     }
 }
@@ -9487,7 +9488,7 @@ static void CheckComplete (pge_ProductionDesc p)
     {
       PrettyCommentProduction (p);
       WarnError1 ((const char *) "cannot determine epsilon, probably a left recursive rule in %s and associated rules (hint rewrite using ebnf and eliminate left recursion)", 138, p->statement->ident->name);
-      WasNoError = FALSE;
+      WasNoError = false;
     }
 }
 
@@ -9573,10 +9574,10 @@ static void ParseArgs (void)
   unsigned int n;
   unsigned int i;
 
-  ErrorRecovery = TRUE;  /* DefaultRecovery ;  */
-  Debugging = FALSE;  /* DefaultRecovery ;  */
-  PrettyPrint = FALSE;
-  KeywordFormatting = FALSE;
+  ErrorRecovery = true;  /* DefaultRecovery ;  */
+  Debugging = false;  /* DefaultRecovery ;  */
+  PrettyPrint = false;
+  KeywordFormatting = false;
   i = 1;
   n = Args_Narg ();
   while (i < n)
@@ -9586,28 +9587,28 @@ static void ParseArgs (void)
           /* avoid gcc warning by using compound statement even if not strictly necessary.  */
           if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-e", 2))
             {
-              ErrorRecovery = FALSE;
+              ErrorRecovery = false;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-d", 2))
             {
               /* avoid dangling else.  */
-              Debugging = TRUE;
-              bnflex_SetDebugging (TRUE);
+              Debugging = true;
+              bnflex_SetDebugging (true);
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-c", 2))
             {
               /* avoid dangling else.  */
-              EmitCode = FALSE;
+              EmitCode = false;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-k", 2))
             {
               /* avoid dangling else.  */
-              KeywordFormatting = TRUE;
+              KeywordFormatting = true;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-l", 2))
             {
               /* avoid dangling else.  */
-              SuppressFileLineTag = TRUE;
+              SuppressFileLineTag = true;
             }
           else if ((StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-h", 2)) || (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "--help", 6)))
             {
@@ -9617,22 +9618,22 @@ static void ParseArgs (void)
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-p", 2))
             {
               /* avoid dangling else.  */
-              PrettyPrint = TRUE;
+              PrettyPrint = true;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-t", 2))
             {
               /* avoid dangling else.  */
-              Texinfo = TRUE;
+              Texinfo = true;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-x", 2))
             {
               /* avoid dangling else.  */
-              Sphinx = TRUE;
+              Sphinx = true;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-f", 2))
             {
               /* avoid dangling else.  */
-              FreeDocLicense = TRUE;
+              FreeDocLicense = true;
             }
           else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-o", 2))
             {
@@ -9681,11 +9682,11 @@ static void ParseArgs (void)
 
 static void Init (void)
 {
-  WasNoError = TRUE;
-  Texinfo = FALSE;
-  Sphinx = FALSE;
-  FreeDocLicense = FALSE;
-  EmitCode = TRUE;
+  WasNoError = true;
+  Texinfo = false;
+  Sphinx = false;
+  FreeDocLicense = false;
+  EmitCode = true;
   LargestValue = 0;
   HeadProduction = NULL;
   CurrentProduction = NULL;
@@ -9701,7 +9702,7 @@ static void Init (void)
   ErrorProcString = NameKey_MakeKey ((const char *) "ErrorS", 6);
   TokenTypeProc = NameKey_MakeKey ((const char *) "GetCurrentTokenType()", 21);
   SymIsProc = NameKey_MakeKey ((const char *) "SymIs", 5);
-  OnLineStart = TRUE;
+  OnLineStart = true;
   ParseArgs ();
   Main (static_cast<pge_SetOfStop> ((unsigned int) ((1 << (bnflex_eoftok)))));  /* this line will be manipulated by sed in buildpg  */
   if (WasNoError)  /* this line will be manipulated by sed in buildpg  */
@@ -9726,9 +9727,9 @@ static void Init (void)
               Output_WriteString ((const char *) &FileName.array[0], MaxFileName);
               Output_WriteString ((const char *) " *)", 3);
               Output_WriteLn ();
-              OnLineStart = FALSE;
+              OnLineStart = false;
               EmitFileLineTag (LinePrologue);
-              BeginningOfLine = TRUE;
+              BeginningOfLine = true;
               WriteCodeHunkList (CodePrologue);
               EmitSupport ();
               EmitFileLineTag (LineDeclaration);
diff --git a/gcc/m2/pge-boot/Gtermios.h b/gcc/m2/pge-boot/Gtermios.h
index 5610db0db7e..6d9a40d3d4c 100644
--- a/gcc/m2/pge-boot/Gtermios.h
+++ b/gcc/m2/pge-boot/Gtermios.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);
@@ -177,28 +178,28 @@ EXTERN int termios_tcflowoffo (int fd);
              if, t, supports, f.
 */
 
-EXTERN unsigned int termios_GetFlag (termios_TERMIOS t, termios_Flag f, unsigned int *b);
+EXTERN bool termios_GetFlag (termios_TERMIOS t, termios_Flag f, bool *b);
 
 /*
    SetFlag - sets a flag value in, t, to, b, and returns TRUE if
              this flag value is supported.
 */
 
-EXTERN unsigned int termios_SetFlag (termios_TERMIOS t, termios_Flag f, unsigned int b);
+EXTERN bool termios_SetFlag (termios_TERMIOS t, termios_Flag f, bool b);
 
 /*
    GetChar - sets a CHAR, ch, value from, t, and returns TRUE if
              this value is supported.
 */
 
-EXTERN unsigned int termios_GetChar (termios_TERMIOS t, termios_ControlChar c, char *ch);
+EXTERN bool termios_GetChar (termios_TERMIOS t, termios_ControlChar c, char *ch);
 
 /*
    SetChar - sets a CHAR value in, t, and returns TRUE if, c,
              is supported.
 */
 
-EXTERN unsigned int termios_SetChar (termios_TERMIOS t, termios_ControlChar c, char ch);
+EXTERN bool termios_SetChar (termios_TERMIOS t, termios_ControlChar c, char ch);
 #   ifdef __cplusplus
 }
 #   endif
diff --git a/gcc/m2/pge-boot/Gwrapc.h b/gcc/m2/pge-boot/Gwrapc.h
index 2e34838dcc4..27a716fac29 100644
--- a/gcc/m2/pge-boot/Gwrapc.h
+++ b/gcc/m2/pge-boot/Gwrapc.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #   ifdef __cplusplus
 extern "C" {
 #   endif
+#include <stdbool.h>
 #   if !defined (PROC_D)
 #      define PROC_D
        typedef void (*PROC_t) (void);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-28 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 11:56 [gcc r13-7620] PR modula2/109675 implementation of writeAddress is non portable Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).