From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id 005603858CDB; Tue, 28 Feb 2023 15:36:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 005603858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677598564; bh=2ZI9XxQ4jnXLZg+B60mRNIu36D0bhCaCNcmV2sByOF8=; h=From:To:Subject:Date:From; b=K7IloT65453lkrHOVwNABpycZM8uImWvG6e6SXRzuP+sGtasDCgnLIp5nd24aMX5H v5scjm1WIejwLurkR4awy56NNrlGwNg6hdb9EHBrf+WLa7AgE0LkHiVdjIm0czuLZg SbDkVTR+UmSyczQxufI26e8bX9HHeZACbcCCtR4U= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6378] Fix build warnings noreturn M2RTS and fix calls to RegisterModule [PR108956] X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/master X-Git-Oldrev: d918c3a221434521f90cc9b63d5d87f5129e9231 X-Git-Newrev: 62ed1066196c81ab1fad13b2cc5ebbfe887138f9 Message-Id: <20230228153604.005603858CDB@sourceware.org> Date: Tue, 28 Feb 2023 15:36:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:62ed1066196c81ab1fad13b2cc5ebbfe887138f9 commit r13-6378-g62ed1066196c81ab1fad13b2cc5ebbfe887138f9 Author: Gaius Mulley Date: Tue Feb 28 15:35:12 2023 +0000 Fix build warnings noreturn M2RTS and fix calls to RegisterModule [PR108956] mc needs a fix to optionally suppress the generation of the noreturn attribute when building M2RTS. All the hand built C++ modules calling RegisterModule must supply the library name. These changes require the boot strap tools mc and pge to be rebuilt. gcc/m2/ChangeLog: PR modula2/108956 * Make-lang.in (m2/gm2-libs-boot/M2RTS.o): New specific rule to add the --suppress-noreturn option. * Make-maintainer.in (m2/gm2-ppg-boot/$(SRC_PREFIX)M2RTS.o): New specific rule to add the --suppress-noreturn option. (m2/gm2-pg-boot/$(SRC_PREFIX)M2RTS.o): New specific rule to add the --suppress-noreturn option. (m2/gm2-pg-boot/$(SRC_PREFIX)%.o): Add missing $(srcdir). (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o): New specific rule to add the --suppress-noreturn option. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Add missing $(srcdir). * gm2-libs-ch/UnixArgs.cc (LIBNAME): New define. (_M2_UnixArgs_ctor): Add LIBNAME parameter to RegisterModule. * gm2-libs-ch/dtoa.cc (LIBNAME): New define. (_M2_dtoa_ctor): Add LIBNAME parameter to RegisterModule. * gm2-libs-ch/ldtoa.cc (LIBNAME): New define. (_M2_ldtoa_ctor): Add LIBNAME parameter to RegisterModule. * pge-boot/m2rts.h (M2RTS_RegisterModule): Add libname parameter. * gm2-libs-ch/m2rts.h (M2RTS_RegisterModule): Add libname parameter. * mc-boot-ch/GUnixArgs.cc (_M2_UnixArgs_ctor): Remove. * pge-boot/GUnixArgs.cc (LIBNAME): New define. (_M2_UnixArgs_ctor): Add LIBNAME parameter to RegisterModule. * gm2-libs/RTint.def (AttachVector): Rename parameter. * mc-boot/GDynamicStrings.c: Rebuilt. * mc-boot/GFIO.c: Rebuilt. * mc-boot/GIndexing.c: Rebuilt. * mc-boot/GM2EXCEPTION.c: Rebuilt. * mc-boot/GPushBackInput.c: Rebuilt. * mc-boot/GRTExceptions.c: Rebuilt. * mc-boot/GRTint.c: Rebuilt. * mc-boot/GRTint.h: Rebuilt. * mc-boot/GStdIO.c: Rebuilt. * mc-boot/GStringConvert.c: Rebuilt. * mc-boot/GSysStorage.c: Rebuilt. * mc-boot/Gdecl.c: Rebuilt. * mc-boot/Gkeyc.c: Rebuilt. * mc-boot/GmcComment.c: Rebuilt. * mc-boot/GmcComp.c: Rebuilt. * mc-boot/GmcDebug.c: Rebuilt. * mc-boot/GmcMetaError.c: Rebuilt. * mc-boot/GmcOptions.c: Rebuilt. * mc-boot/GmcOptions.h: Rebuilt. * mc-boot/GmcStack.c: Rebuilt. * mc-boot/GnameKey.c: Rebuilt. * mc-boot/GsymbolKey.c: Rebuilt. * mc/decl.mod:: Rebuilt. * mc/mcOptions.def: Rebuilt. * mc/mcOptions.mod:: Rebuilt. * pge-boot/GDynamicStrings.c: Rebuilt. * pge-boot/GFIO.c: Rebuilt. * pge-boot/GIndexing.c: Rebuilt. * pge-boot/GM2EXCEPTION.c: Rebuilt. * pge-boot/GM2RTS.c: Rebuilt. * pge-boot/GNameKey.c: Rebuilt. * pge-boot/GPushBackInput.c: Rebuilt. * pge-boot/GRTExceptions.c: Rebuilt. * pge-boot/GStdIO.c: Rebuilt. * pge-boot/GSymbolKey.c: Rebuilt. * pge-boot/GSysStorage.c: Rebuilt. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/Make-lang.in | 5 + gcc/m2/Make-maintainer.in | 32 ++- gcc/m2/gm2-libs-ch/UnixArgs.cc | 3 +- gcc/m2/gm2-libs-ch/dtoa.cc | 4 +- gcc/m2/gm2-libs-ch/ldtoa.cc | 4 +- gcc/m2/gm2-libs-ch/m2rts.h | 2 +- gcc/m2/gm2-libs/RTint.def | 2 +- gcc/m2/mc-boot-ch/GUnixArgs.cc | 10 - gcc/m2/mc-boot/GDynamicStrings.c | 32 +-- gcc/m2/mc-boot/GFIO.c | 2 +- gcc/m2/mc-boot/GIndexing.c | 6 +- gcc/m2/mc-boot/GM2EXCEPTION.c | 4 +- gcc/m2/mc-boot/GPushBackInput.c | 6 +- gcc/m2/mc-boot/GRTExceptions.c | 34 +-- gcc/m2/mc-boot/GRTint.c | 476 ++++++++++++++++++-------------------- gcc/m2/mc-boot/GRTint.h | 2 +- gcc/m2/mc-boot/GStdIO.c | 4 +- gcc/m2/mc-boot/GStringConvert.c | 4 +- gcc/m2/mc-boot/GSysStorage.c | 6 +- gcc/m2/mc-boot/Gdecl.c | 136 +++++------ gcc/m2/mc-boot/Gkeyc.c | 2 +- gcc/m2/mc-boot/GmcComment.c | 2 +- gcc/m2/mc-boot/GmcComp.c | 4 +- gcc/m2/mc-boot/GmcDebug.c | 2 +- gcc/m2/mc-boot/GmcMetaError.c | 8 +- gcc/m2/mc-boot/GmcOptions.c | 42 ++++ gcc/m2/mc-boot/GmcOptions.h | 12 + gcc/m2/mc-boot/GmcStack.c | 4 +- gcc/m2/mc-boot/GnameKey.c | 4 +- gcc/m2/mc-boot/GsymbolKey.c | 6 +- gcc/m2/mc/decl.mod | 8 +- gcc/m2/mc/mcOptions.def | 14 ++ gcc/m2/mc/mcOptions.mod | 28 ++- gcc/m2/pge-boot/GDynamicStrings.c | 32 +-- gcc/m2/pge-boot/GFIO.c | 2 +- gcc/m2/pge-boot/GIndexing.c | 6 +- gcc/m2/pge-boot/GM2EXCEPTION.c | 4 +- gcc/m2/pge-boot/GM2RTS.c | 60 ++--- gcc/m2/pge-boot/GNameKey.c | 4 +- gcc/m2/pge-boot/GPushBackInput.c | 6 +- gcc/m2/pge-boot/GRTExceptions.c | 34 +-- gcc/m2/pge-boot/GStdIO.c | 4 +- gcc/m2/pge-boot/GSymbolKey.c | 6 +- gcc/m2/pge-boot/GSysStorage.c | 6 +- gcc/m2/pge-boot/GUnixArgs.cc | 4 +- gcc/m2/pge-boot/m2rts.h | 2 +- 46 files changed, 594 insertions(+), 486 deletions(-) diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index 92a413b86be..644dcf26772 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -1373,6 +1373,11 @@ mcflex.o: mcflex.c m2/gm2-libs/gm2-libs-host.h mcflex.c: $(srcdir)/m2/mc/mc.flex flex -t $< > $@ +m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-H) + -test -d $(@D) || $(mkinstalldirs) $(@D) + $(MC) --suppress-noreturn -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod + $(COMPILER) -c -DIN_GCC $(CFLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/M2RTS.c -o $@ + m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs-boot/%.mod $(MCDEPS) $(BUILD-BOOT-H) -test -d $(@D) || $(mkinstalldirs) $(@D) $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs-boot/$*.mod diff --git a/gcc/m2/Make-maintainer.in b/gcc/m2/Make-maintainer.in index f6b12ac59f6..81f5abea59c 100644 --- a/gcc/m2/Make-maintainer.in +++ b/gcc/m2/Make-maintainer.in @@ -111,6 +111,13 @@ m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.cc m2/gm2-libs/gm -test -d m2/gm2-ppg-boot || $(mkinstalldirs) m2/gm2-ppg-boot $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@ +m2/gm2-ppg-boot/$(SRC_PREFIX)M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-PPG-H) + -test -d m2/gm2-ppg-boot || $(mkinstalldirs) m2/gm2-ppg-boot + $(MCC) --suppress-noreturn -o=m2/gm2-ppg-boot/$(SRC_PREFIX)M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) \ + -Im2/gm2-ppg-boot -I$(srcdir)/m2/mc-boot -Im2/gm2-libs-boot \ + -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)M2RTS.c -o $@ + m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-PPG-H) -test -d m2/gm2-ppg-boot || $(mkinstalldirs) m2/gm2-ppg-boot $(MCC) -o=m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod @@ -214,6 +221,14 @@ m2/gm2-pg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.cc m2/gm2-libs/gm2 -test -d m2/gm2-pg-boot || $(mkinstalldirs) m2/gm2-pg-boot $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@ +m2/gm2-pg-boot/$(SRC_PREFIX)M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-PG-H) + -test -d m2/gm2-pg-boot || $(mkinstalldirs) m2/gm2-pg-boot + $(MCC) --suppress-noreturn -o=m2/gm2-pg-boot/$(SRC_PREFIX)M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pg-boot -I$(srcdir)/m2/mc-boot \ + -I$(srcdir)/m2/mc-boot-ch \ + -Im2/gm2-libs-boot $(INCLUDES) \ + -g -c m2/gm2-pg-boot/$(SRC_PREFIX)M2RTS.c -o $@ + m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-PG-H) -test -d m2/gm2-pg-boot || $(mkinstalldirs) m2/gm2-pg-boot $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod @@ -225,13 +240,13 @@ m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-B m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-PG-H) -test -d m2/gm2-pg-boot || $(mkinstalldirs) m2/gm2-pg-boot $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod - $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pg-boot/$(SRC_PREFIX)$*.c -o $@ m2/gm2-pg-boot/$(SRC_PREFIX)pg.o: m2/gm2-auto/pg.mod $(MCDEPS) $(BUILD-BOOT-PG-H) -test -d m2/gm2-pg-boot || $(mkinstalldirs) m2/gm2-pg-boot $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)pg.c m2/gm2-auto/pg.mod - $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pg-boot/$(SRC_PREFIX)pg.c -o $@ m2/pg$(exeext): m2/boot-bin/mc \ @@ -336,17 +351,24 @@ m2/gm2-pge-boot/$(SRC_PREFIX)errno.o: $(srcdir)/m2/mc-boot-ch/Gerrno.c -test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c $< -o $@ +m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-PGE-H) + -test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot + $(MCC) --suppress-noreturn -o=m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/gm2-pge-boot -I$(srcdir)/m2/mc-boot \ + -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs-boot \ + $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.c -o $@ + m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-PGE-H) -test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod - $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pge-boot -I$(srcdir)/m2/mc-boot \ + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/gm2-pge-boot -I$(srcdir)/m2/mc-boot \ -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs-boot \ $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@ m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-PGE-H) -test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod - $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot \ + $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot -Im2/gm2-compiler-boot \ -Im2/gm2-libs-boot \ -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@ @@ -354,7 +376,7 @@ m2/gm2-pge-boot/$(SRC_PREFIX)pge.o: m2/gm2-auto/pge.mod $(MCDEPS) $(BUILD-BOOT- -test -d m2/gm2-pge-boot || $(mkinstalldirs) m2/gm2-pge-boot $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)pge.c m2/gm2-auto/pge.mod $(CXX) -I. -I$(srcdir)/../include -I$(srcdir) \ - -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ + -I$(srcdir)/m2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \ -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)pge.c -o $@ m2/pge$(exeext): m2/boot-bin/mc \ diff --git a/gcc/m2/gm2-libs-ch/UnixArgs.cc b/gcc/m2/gm2-libs-ch/UnixArgs.cc index 68b84023aee..8db7c9ab94f 100644 --- a/gcc/m2/gm2-libs-ch/UnixArgs.cc +++ b/gcc/m2/gm2-libs-ch/UnixArgs.cc @@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include #include "m2rts.h" +#define LIBNAME "m2pim" extern "C" int UnixArgs_GetArgC (void); extern "C" char **UnixArgs_GetArgV (void); @@ -85,6 +86,6 @@ _M2_UnixArgs_dep (void) extern "C" void __attribute__((__constructor__)) _M2_UnixArgs_ctor (void) { - M2RTS_RegisterModule ("UnixArgs", _M2_UnixArgs_init, _M2_UnixArgs_finish, + M2RTS_RegisterModule ("UnixArgs", LIBNAME, _M2_UnixArgs_init, _M2_UnixArgs_finish, _M2_UnixArgs_dep); } diff --git a/gcc/m2/gm2-libs-ch/dtoa.cc b/gcc/m2/gm2-libs-ch/dtoa.cc index d3304294336..2aa774dff21 100644 --- a/gcc/m2/gm2-libs-ch/dtoa.cc +++ b/gcc/m2/gm2-libs-ch/dtoa.cc @@ -31,6 +31,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "gm2-libs-host.h" #include "m2rts.h" +#define LIBNAME "m2pim" + #ifdef __cplusplus extern "C" { #endif @@ -192,7 +194,7 @@ _M2_dtoa_dep (void) extern "C" void __attribute__((__constructor__)) _M2_dtoa_ctor (void) { - M2RTS_RegisterModule ("dtoa", _M2_dtoa_init, _M2_dtoa_finish, + M2RTS_RegisterModule ("dtoa", LIBNAME, _M2_dtoa_init, _M2_dtoa_finish, _M2_dtoa_dep); } diff --git a/gcc/m2/gm2-libs-ch/ldtoa.cc b/gcc/m2/gm2-libs-ch/ldtoa.cc index 2518c6acd0a..b1df51b4fff 100644 --- a/gcc/m2/gm2-libs-ch/ldtoa.cc +++ b/gcc/m2/gm2-libs-ch/ldtoa.cc @@ -28,6 +28,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "system.h" #include "ansidecl.h" +#define LIBNAME "m2pim" + #include "gm2-libs-host.h" #include "m2rts.h" @@ -121,7 +123,7 @@ _M2_ldtoa_dep (void) extern "C" void __attribute__((__constructor__)) _M2_ldtoa_ctor (void) { - M2RTS_RegisterModule ("ldtoa", _M2_ldtoa_init, _M2_ldtoa_finish, + M2RTS_RegisterModule ("ldtoa", LIBNAME, _M2_ldtoa_init, _M2_ldtoa_finish, _M2_ldtoa_dep); } diff --git a/gcc/m2/gm2-libs-ch/m2rts.h b/gcc/m2/gm2-libs-ch/m2rts.h index 09d55f41d3b..e70c9f63f7b 100644 --- a/gcc/m2/gm2-libs-ch/m2rts.h +++ b/gcc/m2/gm2-libs-ch/m2rts.h @@ -29,7 +29,7 @@ typedef void (*proc_con) (int, char **, char **); typedef void (*proc_dep) (void); extern "C" void M2RTS_RequestDependant (const char *modulename, const char *dependancy); -extern "C" void M2RTS_RegisterModule (const char *modulename, +extern "C" void M2RTS_RegisterModule (const char *modulename, const char *libname, proc_con init, proc_con fini, proc_dep dependencies); extern "C" void _M2_M2RTS_init (void); diff --git a/gcc/m2/gm2-libs/RTint.def b/gcc/m2/gm2-libs/RTint.def index 8827a69d99c..d2df9c23c58 100644 --- a/gcc/m2/gm2-libs/RTint.def +++ b/gcc/m2/gm2-libs/RTint.def @@ -84,7 +84,7 @@ PROCEDURE GetTimeVector (vec: CARDINAL; VAR micro, secs: CARDINAL) ; vector. *) -PROCEDURE AttachVector (vec: CARDINAL; p: ADDRESS) : ADDRESS ; +PROCEDURE AttachVector (vec: CARDINAL; ptr: ADDRESS) : ADDRESS ; (* diff --git a/gcc/m2/mc-boot-ch/GUnixArgs.cc b/gcc/m2/mc-boot-ch/GUnixArgs.cc index 815abc3b371..d1b9e88bd3f 100644 --- a/gcc/m2/mc-boot-ch/GUnixArgs.cc +++ b/gcc/m2/mc-boot-ch/GUnixArgs.cc @@ -81,13 +81,3 @@ extern "C" void _M2_UnixArgs_dep (void) { } - -#if 0 -struct _M2_UnixArgs_ctor { _M2_UnixArgs_ctor (); } _M2_UnixArgs_ctor; - -_M2_UnixArgs_ctor::_M2_UnixArgs_ctor (void) -{ - M2RTS_RegisterModule ("UnixArgs", _M2_UnixArgs_init, _M2_UnixArgs_fini, - _M2_UnixArgs_dep); -} -#endif diff --git a/gcc/m2/mc-boot/GDynamicStrings.c b/gcc/m2/mc-boot/GDynamicStrings.c index 2099c2b420b..dfc163646bb 100644 --- a/gcc/m2/mc-boot/GDynamicStrings.c +++ b/gcc/m2/mc-boot/GDynamicStrings.c @@ -1214,7 +1214,7 @@ static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned (*c).next->contents.next = NULL; ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o); AddDebugInfo ((*c).next); - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 722, (const char *) "ConcatContents", 14); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 722, (const char *) "ConcatContents", 14); } else { @@ -1312,7 +1312,7 @@ static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigne AddDebugInfo ((*c).next); if (TraceOn) { - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 917, (const char *) "ConcatContentsAddress", 21); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 917, (const char *) "ConcatContentsAddress", 21); } } else @@ -1537,7 +1537,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 758, (const char *) "InitString", 10); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 758, (const char *) "InitString", 10); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1640,7 +1640,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 957, (const char *) "InitStringCharStar", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 957, (const char *) "InitStringCharStar", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1665,7 +1665,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) s = DynamicStrings_InitString ((const char *) &a.array[0], 1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 977, (const char *) "InitStringChar", 14); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 977, (const char *) "InitStringChar", 14); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1823,7 +1823,7 @@ extern "C" DynamicStrings_String DynamicStrings_Dup (DynamicStrings_String s) s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1173, (const char *) "Dup", 3); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1173, (const char *) "Dup", 3); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1845,7 +1845,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b); if (TraceOn) { - a = AssignDebug (a, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1193, (const char *) "Add", 3); + a = AssignDebug (a, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1193, (const char *) "Add", 3); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1910,7 +1910,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v t = DynamicStrings_InitStringCharStar (a); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1250, (const char *) "EqualCharStar", 13); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1250, (const char *) "EqualCharStar", 13); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1948,7 +1948,7 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons t = DynamicStrings_InitString ((const char *) a, _a_high); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1280, (const char *) "EqualArray", 10); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1280, (const char *) "EqualArray", 10); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1986,7 +1986,7 @@ extern "C" DynamicStrings_String DynamicStrings_Mult (DynamicStrings_String s, u } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1312, (const char *) "Mult", 4); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1312, (const char *) "Mult", 4); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2065,7 +2065,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, AddDebugInfo (t->contents.next); if (TraceOn) { - t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1380, (const char *) "Slice", 5); + t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1380, (const char *) "Slice", 5); } } t = t->contents.next; @@ -2083,7 +2083,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, } if (TraceOn) { - d = AssignDebug (d, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1397, (const char *) "Slice", 5); + d = AssignDebug (d, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1397, (const char *) "Slice", 5); } return d; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2211,7 +2211,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveComment (DynamicStrings_St } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1509, (const char *) "RemoveComment", 13); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1509, (const char *) "RemoveComment", 13); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2236,7 +2236,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePrefix (DynamicString s = DynamicStrings_Slice (s, (int ) (i), 0); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1621, (const char *) "RemoveWhitePrefix", 17); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1621, (const char *) "RemoveWhitePrefix", 17); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2261,7 +2261,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePostfix (DynamicStrin s = DynamicStrings_Slice (s, 0, i+1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1643, (const char *) "RemoveWhitePostfix", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1643, (const char *) "RemoveWhitePostfix", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2630,7 +2630,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned { stop (); /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's") */ - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); + 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); } else { diff --git a/gcc/m2/mc-boot/GFIO.c b/gcc/m2/mc-boot/GFIO.c index 4a6056f35e3..65819a10a4b 100644 --- a/gcc/m2/mc-boot/GFIO.c +++ b/gcc/m2/mc-boot/GFIO.c @@ -555,7 +555,7 @@ static FIO_File GetNextFreeDescriptor (void) return f; /* create new slot */ } } - ReturnException ("../../gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GIndexing.c b/gcc/m2/mc-boot/GIndexing.c index f6ec58272c0..0817ff36ca2 100644 --- a/gcc/m2/mc-boot/GIndexing.c +++ b/gcc/m2/mc-boot/GIndexing.c @@ -222,7 +222,7 @@ extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n) { return (n >= i->Low) && (n <= i->High); } - ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } @@ -242,7 +242,7 @@ extern "C" unsigned int Indexing_HighIndice (Indexing_Index i) { return i->High; } - ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } @@ -262,7 +262,7 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) { return i->Low; } - ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.c b/gcc/m2/mc-boot/GM2EXCEPTION.c index a7b88652858..387b0476462 100644 --- a/gcc/m2/mc-boot/GM2EXCEPTION.c +++ b/gcc/m2/mc-boot/GM2EXCEPTION.c @@ -57,13 +57,13 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void) n = RTExceptions_GetNumber (e); if (n == (UINT_MAX)) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); } else { return (M2EXCEPTION_M2Exceptions) (n); } - ReturnException ("../../gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GPushBackInput.c b/gcc/m2/mc-boot/GPushBackInput.c index 895130edb30..e15b3eb9007 100644 --- a/gcc/m2/mc-boot/GPushBackInput.c +++ b/gcc/m2/mc-boot/GPushBackInput.c @@ -274,7 +274,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/m2/gm2-libs/PushBackInput.mod", 39); + 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); } return ch; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -300,7 +300,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/m2/gm2-libs/PushBackInput.mod", 39); + Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } @@ -321,7 +321,7 @@ extern "C" void PushBackInput_PutStr (DynamicStrings_String s) i -= 1; if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast (i)))) != (DynamicStrings_char (s, static_cast (i)))) { - Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39); + Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } diff --git a/gcc/m2/mc-boot/GRTExceptions.c b/gcc/m2/mc-boot/GRTExceptions.c index f78a3cb7ab8..23f8fede117 100644 --- a/gcc/m2/mc-boot/GRTExceptions.c +++ b/gcc/m2/mc-boot/GRTExceptions.c @@ -721,7 +721,7 @@ static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) static void indexf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 613, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 613, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); } @@ -731,7 +731,7 @@ static void indexf (void * a) static void range (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 625, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 625, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); } @@ -741,7 +741,7 @@ static void range (void * a) static void casef (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 637, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 637, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); } @@ -751,7 +751,7 @@ static void casef (void * a) static void invalidloc (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 649, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 649, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); } @@ -761,7 +761,7 @@ static void invalidloc (void * a) static void function (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 661, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 661, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ } @@ -771,7 +771,7 @@ static void function (void * a) static void wholevalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 673, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 673, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -781,7 +781,7 @@ static void wholevalue (void * a) static void wholediv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 685, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 685, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -791,7 +791,7 @@ static void wholediv (void * a) static void realvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 697, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 697, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); } @@ -801,7 +801,7 @@ static void realvalue (void * a) static void realdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 709, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 709, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); } @@ -811,7 +811,7 @@ static void realdiv (void * a) static void complexvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 721, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 721, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); } @@ -821,7 +821,7 @@ static void complexvalue (void * a) static void complexdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 733, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 733, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); } @@ -831,7 +831,7 @@ static void complexdiv (void * a) static void protection (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 745, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 745, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); } @@ -841,7 +841,7 @@ static void protection (void * a) static void systemf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 757, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 757, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); } @@ -851,7 +851,7 @@ static void systemf (void * a) static void coroutine (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 769, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 769, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); } @@ -861,7 +861,7 @@ static void coroutine (void * a) static void exception (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 781, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 781, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); } @@ -1180,13 +1180,13 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void) { if (currentEHB == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTExceptions.mod", 38, 599, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); + 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); } else { return currentEHB; } - ReturnException ("../../gcc/m2/gm2-libs/RTExceptions.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GRTint.c b/gcc/m2/mc-boot/GRTint.c index 65c8c8af06f..a3030f2d9a1 100644 --- a/gcc/m2/mc-boot/GRTint.c +++ b/gcc/m2/mc-boot/GRTint.c @@ -132,12 +132,12 @@ extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, uns extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsigned int *secs); /* - AttachVector - adds the pointer, p, to be associated with the interrupt + AttachVector - adds the pointer ptr to be associated with the interrupt vector. It returns the previous value attached to this vector. */ -extern "C" void * RTint_AttachVector (unsigned int vec, void * p); +extern "C" void * RTint_AttachVector (unsigned int vec, void * ptr); /* IncludeVector - includes, vec, into the dispatcher list of @@ -178,14 +178,14 @@ static int Max (int i, int j); static int Min (int i, int j); /* - FindVector - searches the exists list for a vector of type, t, + FindVector - searches the exists list for a vector of type which is associated with file descriptor, fd. */ -static RTint_Vector FindVector (int fd, RTint_VectorType t); +static RTint_Vector FindVector (int fd, RTint_VectorType type); /* - FindVectorNo - searches the Exists list for vector, vec. + FindVectorNo - searches the Exists list for vector vec. */ static RTint_Vector FindVectorNo (unsigned int vec); @@ -197,10 +197,10 @@ static RTint_Vector FindVectorNo (unsigned int vec); static RTint_Vector FindPendingVector (unsigned int vec); /* - AddFd - adds the file descriptor, fd, to set, s, updating, max. + AddFd - adds the file descriptor fd to set updating max. */ -static void AddFd (Selective_SetOfFd *s, int *max, int fd); +static void AddFd (Selective_SetOfFd *set, int *max, int fd); /* DumpPendingQueue - displays the pending queue. @@ -208,12 +208,6 @@ static void AddFd (Selective_SetOfFd *s, int *max, int fd); static void DumpPendingQueue (void); -/* - DumpPendingQueue - displays the pending queue. -*/ - -static void stop (void); - /* AddTime - t1 := t1 + t2 */ @@ -236,7 +230,7 @@ static void SubTime (unsigned int *s, unsigned int *m, Selective_Timeval a, Sele activatePending - activates the first interrupt pending and clears it. */ -static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *i, Selective_SetOfFd *o, Selective_Timeval *t, Selective_Timeval b4, Selective_Timeval after); +static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after); /* init - @@ -282,22 +276,22 @@ static int Min (int i, int j) /* - FindVector - searches the exists list for a vector of type, t, + FindVector - searches the exists list for a vector of type which is associated with file descriptor, fd. */ -static RTint_Vector FindVector (int fd, RTint_VectorType t) +static RTint_Vector FindVector (int fd, RTint_VectorType type) { - RTint_Vector v; + RTint_Vector vec; - v = Exists; - while (v != NULL) + vec = Exists; + while (vec != NULL) { - if ((v->type == t) && (v->File == fd)) + if ((vec->type == type) && (vec->File == fd)) { - return v; + return vec; } - v = v->exists; + vec = vec->exists; } return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -306,19 +300,19 @@ static RTint_Vector FindVector (int fd, RTint_VectorType t) /* - FindVectorNo - searches the Exists list for vector, vec. + FindVectorNo - searches the Exists list for vector vec. */ static RTint_Vector FindVectorNo (unsigned int vec) { - RTint_Vector v; + RTint_Vector vptr; - v = Exists; - while ((v != NULL) && (v->no != vec)) + vptr = Exists; + while ((vptr != NULL) && (vptr->no != vec)) { - v = v->exists; + vptr = vptr->exists; } - return v; + return vptr; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -330,19 +324,19 @@ static RTint_Vector FindVectorNo (unsigned int vec) static RTint_Vector FindPendingVector (unsigned int vec) { - unsigned int i; - RTint_Vector v; + unsigned int pri; + RTint_Vector vptr; - for (i=COROUTINES_UnassignedPriority; i<=7; i++) + for (pri=COROUTINES_UnassignedPriority; pri<=7; pri++) { - v = Pending.array[i-(COROUTINES_UnassignedPriority)]; - while ((v != NULL) && (v->no != vec)) + vptr = Pending.array[pri-(COROUTINES_UnassignedPriority)]; + while ((vptr != NULL) && (vptr->no != vec)) { - v = v->pending; + vptr = vptr->pending; } - if ((v != NULL) && (v->no == vec)) + if ((vptr != NULL) && (vptr->no == vec)) { - return v; + return vptr; } } return NULL; @@ -352,19 +346,19 @@ static RTint_Vector FindPendingVector (unsigned int vec) /* - AddFd - adds the file descriptor, fd, to set, s, updating, max. + AddFd - adds the file descriptor fd to set updating max. */ -static void AddFd (Selective_SetOfFd *s, int *max, int fd) +static void AddFd (Selective_SetOfFd *set, int *max, int fd) { (*max) = Max (fd, (*max)); - if ((*s) == NULL) + if ((*set) == NULL) { - (*s) = Selective_InitSet (); - Selective_FdZero ((*s)); + (*set) = Selective_InitSet (); + Selective_FdZero ((*set)); } /* printf('%d, ', fd) */ - Selective_FdSet (fd, (*s)); + Selective_FdSet (fd, (*set)); } @@ -374,45 +368,36 @@ static void AddFd (Selective_SetOfFd *s, int *max, int fd) static void DumpPendingQueue (void) { - COROUTINES_PROTECTION p; - RTint_Vector v; - unsigned int s; - unsigned int m; + COROUTINES_PROTECTION pri; + RTint_Vector vptr; + unsigned int sec; + unsigned int micro; libc_printf ((const char *) "Pending queue\\n", 15); - for (p=COROUTINES_UnassignedPriority; p<=7; p++) + for (pri=COROUTINES_UnassignedPriority; pri<=7; pri++) { - libc_printf ((const char *) "[%d] ", 6, p); - v = Pending.array[p-(COROUTINES_UnassignedPriority)]; - while (v != NULL) + libc_printf ((const char *) "[%d] ", 6, pri); + vptr = Pending.array[pri-(COROUTINES_UnassignedPriority)]; + while (vptr != NULL) { - if ((v->type == RTint_input) || (v->type == RTint_output)) + if ((vptr->type == RTint_input) || (vptr->type == RTint_output)) { - libc_printf ((const char *) "(fd=%d) (vec=%d)", 16, v->File, v->no); + libc_printf ((const char *) "(fd=%d) (vec=%d)", 16, vptr->File, vptr->no); } - else if (v->type == RTint_time) + else if (vptr->type == RTint_time) { /* avoid dangling else. */ - Selective_GetTime (v->rel, &s, &m); - Assertion_Assert (m < Microseconds); - libc_printf ((const char *) "time (%u.%06u secs) (arg = 0x%x)\\n", 34, s, m, v->arg); + Selective_GetTime (vptr->rel, &sec, µ); + Assertion_Assert (micro < Microseconds); + libc_printf ((const char *) "time (%u.%06u secs) (arg = %p)\\n", 32, sec, micro, vptr->arg); } - v = v->pending; + vptr = vptr->pending; } libc_printf ((const char *) " \\n", 3); } } -/* - DumpPendingQueue - displays the pending queue. -*/ - -static void stop (void) -{ -} - - /* AddTime - t1 := t1 + t2 */ @@ -503,86 +488,86 @@ static void SubTime (unsigned int *s, unsigned int *m, Selective_Timeval a, Sele activatePending - activates the first interrupt pending and clears it. */ -static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *i, Selective_SetOfFd *o, Selective_Timeval *t, Selective_Timeval b4, Selective_Timeval after) +static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after) { - int r; + int result; unsigned int p; - RTint_Vector v; + RTint_Vector vec; unsigned int b4s; unsigned int b4m; unsigned int afs; unsigned int afm; - unsigned int s; - unsigned int m; + unsigned int sec; + unsigned int micro; RTco_wait (lock); p = static_cast (7); while (p > pri) { - v = Pending.array[p-(COROUTINES_UnassignedPriority)]; - while (v != NULL) + vec = Pending.array[p-(COROUTINES_UnassignedPriority)]; + while (vec != NULL) { - switch (v->type) + switch (vec->type) { case RTint_input: - if (((v->File < maxFd) && ((*i) != NULL)) && (Selective_FdIsSet (v->File, (*i)))) + if (((vec->File < maxFd) && ((*inSet) != NULL)) && (Selective_FdIsSet (vec->File, (*inSet)))) { if (Debugging) { - libc_printf ((const char *) "read (fd=%d) is ready (vec=%d)\\n", 32, v->File, v->no); + libc_printf ((const char *) "read (fd=%d) is ready (vec=%d)\\n", 32, vec->File, vec->no); DumpPendingQueue (); } - Selective_FdClr (v->File, (*i)); /* so we dont activate this again from our select. */ + Selective_FdClr (vec->File, (*inSet)); /* so we dont activate this again from our select. */ RTco_signal (lock); /* so we dont activate this again from our select. */ - (*call.proc) (v->no, v->priority, v->arg); + (*call.proc) (vec->no, vec->priority, vec->arg); return TRUE; } break; case RTint_output: - if (((v->File < maxFd) && ((*o) != NULL)) && (Selective_FdIsSet (v->File, (*o)))) + if (((vec->File < maxFd) && ((*outSet) != NULL)) && (Selective_FdIsSet (vec->File, (*outSet)))) { if (Debugging) { - libc_printf ((const char *) "write (fd=%d) is ready (vec=%d)\\n", 33, v->File, v->no); + libc_printf ((const char *) "write (fd=%d) is ready (vec=%d)\\n", 33, vec->File, vec->no); DumpPendingQueue (); } - Selective_FdClr (v->File, (*o)); /* so we dont activate this again from our select. */ + Selective_FdClr (vec->File, (*outSet)); /* so we dont activate this again from our select. */ RTco_signal (lock); /* so we dont activate this again from our select. */ - (*call.proc) (v->no, v->priority, v->arg); + (*call.proc) (vec->no, vec->priority, vec->arg); return TRUE; } break; case RTint_time: - if (untilInterrupt && ((*t) != NULL)) + if (untilInterrupt && ((*timeval) != NULL)) { - r = Selective_GetTimeOfDay (after); - Assertion_Assert (r == 0); + result = Selective_GetTimeOfDay (after); + Assertion_Assert (result == 0); if (Debugging) { - Selective_GetTime ((*t), &s, &m); - Assertion_Assert (m < Microseconds); + Selective_GetTime ((*timeval), &sec, µ); + Assertion_Assert (micro < Microseconds); Selective_GetTime (after, &afs, &afm); Assertion_Assert (afm < Microseconds); Selective_GetTime (b4, &b4s, &b4m); Assertion_Assert (b4m < Microseconds); - libc_printf ((const char *) "waited %u.%06u + %u.%06u now is %u.%06u\\n", 41, s, m, b4s, b4m, afs, afm); + libc_printf ((const char *) "waited %u.%06u + %u.%06u now is %u.%06u\\n", 41, sec, micro, b4s, b4m, afs, afm); } - if (IsGreaterEqual (after, v->abs_)) + if (IsGreaterEqual (after, vec->abs_)) { if (Debugging) { DumpPendingQueue (); libc_printf ((const char *) "time has expired calling dispatcher\\n", 37); } - (*t) = Selective_KillTime ((*t)); /* so we dont activate this again from our select. */ + (*timeval) = Selective_KillTime ((*timeval)); /* so we dont activate this again from our select. */ RTco_signal (lock); /* so we dont activate this again from our select. */ if (Debugging) { - libc_printf ((const char *) "call (%d, %d, 0x%x)\\n", 21, v->no, v->priority, v->arg); + libc_printf ((const char *) "call (%d, %d, 0x%x)\\n", 21, vec->no, vec->priority, vec->arg); } - (*call.proc) (v->no, v->priority, v->arg); + (*call.proc) (vec->no, vec->priority, vec->arg); return TRUE; } else if (Debugging) @@ -595,10 +580,10 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch default: - CaseException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1); + CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } - v = v->pending; + vec = vec->pending; } p -= 1; } @@ -636,33 +621,33 @@ static void init (void) extern "C" unsigned int RTint_InitInputVector (int fd, unsigned int pri) { - RTint_Vector v; + RTint_Vector vptr; if (Debugging) { libc_printf ((const char *) "InitInputVector fd = %d priority = %d\\n", 39, fd, pri); } RTco_wait (lock); - v = FindVector (fd, RTint_input); - if (v == NULL) + vptr = FindVector (fd, RTint_input); + if (vptr == NULL) { - Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); + Storage_ALLOCATE ((void **) &vptr, sizeof (RTint__T1)); VecNo += 1; - v->type = RTint_input; - v->priority = pri; - v->arg = NULL; - v->pending = NULL; - v->exists = Exists; - v->no = VecNo; - v->File = fd; - Exists = v; + vptr->type = RTint_input; + vptr->priority = pri; + vptr->arg = NULL; + vptr->pending = NULL; + vptr->exists = Exists; + vptr->no = VecNo; + vptr->File = fd; + Exists = vptr; RTco_signal (lock); return VecNo; } else { RTco_signal (lock); - return v->no; + return vptr->no; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -676,14 +661,14 @@ extern "C" unsigned int RTint_InitInputVector (int fd, unsigned int pri) extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) { - RTint_Vector v; + RTint_Vector vptr; RTco_wait (lock); - v = FindVector (fd, RTint_output); - if (v == NULL) + vptr = FindVector (fd, RTint_output); + if (vptr == NULL) { - Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); - if (v == NULL) + Storage_ALLOCATE ((void **) &vptr, sizeof (RTint__T1)); + if (vptr == NULL) { M2RTS_HALT (-1); __builtin_unreachable (); @@ -691,14 +676,14 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) else { VecNo += 1; - v->type = RTint_output; - v->priority = pri; - v->arg = NULL; - v->pending = NULL; - v->exists = Exists; - v->no = VecNo; - v->File = fd; - Exists = v; + vptr->type = RTint_output; + vptr->priority = pri; + vptr->arg = NULL; + vptr->pending = NULL; + vptr->exists = Exists; + vptr->no = VecNo; + vptr->File = fd; + Exists = vptr; RTco_signal (lock); return VecNo; } @@ -706,9 +691,9 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) else { RTco_signal (lock); - return v->no; + return vptr->no; } - ReturnException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } @@ -720,11 +705,11 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int secs, unsigned int pri) { - RTint_Vector v; + RTint_Vector vptr; RTco_wait (lock); - Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); - if (v == NULL) + Storage_ALLOCATE ((void **) &vptr, sizeof (RTint__T1)); + if (vptr == NULL) { M2RTS_HALT (-1); __builtin_unreachable (); @@ -733,16 +718,16 @@ extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int s { VecNo += 1; Assertion_Assert (micro < Microseconds); - v->type = RTint_time; - v->priority = pri; - v->arg = NULL; - v->pending = NULL; - v->exists = Exists; - v->no = VecNo; - v->rel = Selective_InitTime (secs+DebugTime, micro); - v->abs_ = Selective_InitTime (0, 0); - v->queued = FALSE; - Exists = v; + vptr->type = RTint_time; + vptr->priority = pri; + vptr->arg = NULL; + vptr->pending = NULL; + vptr->exists = Exists; + vptr->no = VecNo; + vptr->rel = Selective_InitTime (secs+DebugTime, micro); + vptr->abs_ = Selective_InitTime (0, 0); + vptr->queued = FALSE; + Exists = vptr; } RTco_signal (lock); return VecNo; @@ -758,18 +743,18 @@ extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int s extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, unsigned int secs) { - RTint_Vector v; + RTint_Vector vptr; Assertion_Assert (micro < Microseconds); RTco_wait (lock); - v = FindVectorNo (vec); - if (v == NULL) + vptr = FindVectorNo (vec); + if (vptr == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 286, (const char *) "ReArmTimeVector", 15, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 286, (const char *) "ReArmTimeVector", 15, (const char *) "cannot find vector supplied", 27); } else { - Selective_SetTime (v->rel, secs+DebugTime, micro); + Selective_SetTime (vptr->rel, secs+DebugTime, micro); } RTco_signal (lock); } @@ -784,17 +769,17 @@ extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, uns extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsigned int *secs) { - RTint_Vector v; + RTint_Vector vptr; RTco_wait (lock); - v = FindVectorNo (vec); - if (v == NULL) + vptr = FindVectorNo (vec); + if (vptr == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 312, (const char *) "GetTimeVector", 13, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 312, (const char *) "GetTimeVector", 13, (const char *) "cannot find vector supplied", 27); } else { - Selective_GetTime (v->rel, secs, micro); + Selective_GetTime (vptr->rel, secs, micro); Assertion_Assert ((*micro) < Microseconds); } RTco_signal (lock); @@ -802,35 +787,35 @@ extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsi /* - AttachVector - adds the pointer, p, to be associated with the interrupt + AttachVector - adds the pointer ptr to be associated with the interrupt vector. It returns the previous value attached to this vector. */ -extern "C" void * RTint_AttachVector (unsigned int vec, void * p) +extern "C" void * RTint_AttachVector (unsigned int vec, void * ptr) { - RTint_Vector v; - void * l; + RTint_Vector vptr; + void * prevArg; RTco_wait (lock); - v = FindVectorNo (vec); - if (v == NULL) + vptr = FindVectorNo (vec); + if (vptr == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 339, (const char *) "AttachVector", 12, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 339, (const char *) "AttachVector", 12, (const char *) "cannot find vector supplied", 27); } else { - l = v->arg; - v->arg = p; + prevArg = vptr->arg; + vptr->arg = ptr; if (Debugging) { - libc_printf ((const char *) "AttachVector %d with 0x%x\\n", 27, vec, p); + libc_printf ((const char *) "AttachVector %d with %p\\n", 25, vec, ptr); DumpPendingQueue (); } RTco_signal (lock); - return l; + return prevArg; } - ReturnException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } @@ -842,37 +827,37 @@ extern "C" void * RTint_AttachVector (unsigned int vec, void * p) extern "C" void RTint_IncludeVector (unsigned int vec) { - RTint_Vector v; - unsigned int m; - unsigned int s; - int r; + RTint_Vector vptr; + unsigned int micro; + unsigned int sec; + int result; RTco_wait (lock); - v = FindPendingVector (vec); - if (v == NULL) + vptr = FindPendingVector (vec); + if (vptr == NULL) { /* avoid dangling else. */ - v = FindVectorNo (vec); - if (v == NULL) + vptr = FindVectorNo (vec); + if (vptr == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 372, (const char *) "IncludeVector", 13, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 372, (const char *) "IncludeVector", 13, (const char *) "cannot find vector supplied", 27); } else { /* printf('including vector %d (fd = %d) ', vec, v^.File) ; */ - v->pending = Pending.array[v->priority-(COROUTINES_UnassignedPriority)]; - Pending.array[v->priority-(COROUTINES_UnassignedPriority)] = v; - if ((v->type == RTint_time) && ! v->queued) + vptr->pending = Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)]; + Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)] = vptr; + if ((vptr->type == RTint_time) && ! vptr->queued) { - v->queued = TRUE; - r = Selective_GetTimeOfDay (v->abs_); - Assertion_Assert (r == 0); - Selective_GetTime (v->abs_, &s, &m); - Assertion_Assert (m < Microseconds); - AddTime (v->abs_, v->rel); - Selective_GetTime (v->abs_, &s, &m); - Assertion_Assert (m < Microseconds); + vptr->queued = TRUE; + result = Selective_GetTimeOfDay (vptr->abs_); + Assertion_Assert (result == 0); + Selective_GetTime (vptr->abs_, &sec, µ); + Assertion_Assert (micro < Microseconds); + AddTime (vptr->abs_, vptr->rel); + Selective_GetTime (vptr->abs_, &sec, µ); + Assertion_Assert (micro < Microseconds); } } } @@ -880,9 +865,8 @@ extern "C" void RTint_IncludeVector (unsigned int vec) { if (Debugging) { - libc_printf ((const char *) "odd vector (%d) type (%d) arg (0x%x) is already attached to the pending queue\\n", 79, vec, v->type, v->arg); + libc_printf ((const char *) "odd vector (%d) type (%d) arg (%p) is already attached to the pending queue\\n", 77, vec, vptr->type, vptr->arg); } - stop (); } RTco_signal (lock); } @@ -895,35 +879,35 @@ extern "C" void RTint_IncludeVector (unsigned int vec) extern "C" void RTint_ExcludeVector (unsigned int vec) { - RTint_Vector v; - RTint_Vector u; + RTint_Vector vptr; + RTint_Vector uptr; RTco_wait (lock); - v = FindPendingVector (vec); - if (v == NULL) + vptr = FindPendingVector (vec); + if (vptr == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 415, (const char *) "ExcludeVector", 13, (const char *) "cannot find pending vector supplied", 35); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 414, (const char *) "ExcludeVector", 13, (const char *) "cannot find pending vector supplied", 35); } else { /* printf('excluding vector %d ', vec) ; */ - if (Pending.array[v->priority-(COROUTINES_UnassignedPriority)] == v) + if (Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)] == vptr) { - Pending.array[v->priority-(COROUTINES_UnassignedPriority)] = Pending.array[v->priority-(COROUTINES_UnassignedPriority)]->pending; + Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)] = Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)]->pending; } else { - u = Pending.array[v->priority-(COROUTINES_UnassignedPriority)]; - while (u->pending != v) + uptr = Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)]; + while (uptr->pending != vptr) { - u = u->pending; + uptr = uptr->pending; } - u->pending = v->pending; + uptr->pending = vptr->pending; } - if (v->type == RTint_time) + if (vptr->type == RTint_time) { - v->queued = FALSE; + vptr->queued = FALSE; } } RTco_signal (lock); @@ -942,19 +926,19 @@ extern "C" void RTint_ExcludeVector (unsigned int vec) extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri) { unsigned int found; - int r; + int result; Selective_Timeval after; Selective_Timeval b4; - Selective_Timeval t; - RTint_Vector v; - Selective_SetOfFd i; - Selective_SetOfFd o; + Selective_Timeval timeval; + RTint_Vector vec; + Selective_SetOfFd inSet; + Selective_SetOfFd outSet; unsigned int b4s; unsigned int b4m; unsigned int afs; unsigned int afm; - unsigned int s; - unsigned int m; + unsigned int sec; + unsigned int micro; int maxFd; unsigned int p; @@ -966,103 +950,103 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector DumpPendingQueue (); } maxFd = -1; - t = NULL; - i = NULL; - o = NULL; - t = Selective_InitTime (static_cast (INT_MAX), 0); + timeval = NULL; + inSet = NULL; + outSet = NULL; + timeval = Selective_InitTime (static_cast (INT_MAX), 0); p = static_cast (7); found = FALSE; while (p > pri) { - v = Pending.array[p-(COROUTINES_UnassignedPriority)]; - while (v != NULL) + vec = Pending.array[p-(COROUTINES_UnassignedPriority)]; + while (vec != NULL) { - switch (v->type) + switch (vec->type) { case RTint_input: - AddFd (&i, &maxFd, v->File); + AddFd (&inSet, &maxFd, vec->File); break; case RTint_output: - AddFd (&o, &maxFd, v->File); + AddFd (&outSet, &maxFd, vec->File); break; case RTint_time: - if (IsGreaterEqual (t, v->abs_)) + if (IsGreaterEqual (timeval, vec->abs_)) { - Selective_GetTime (v->abs_, &s, &m); - Assertion_Assert (m < Microseconds); + Selective_GetTime (vec->abs_, &sec, µ); + Assertion_Assert (micro < Microseconds); if (Debugging) { - libc_printf ((const char *) "shortest delay is %u.%06u\\n", 27, s, m); + libc_printf ((const char *) "shortest delay is %u.%06u\\n", 27, sec, micro); } - Selective_SetTime (t, s, m); + Selective_SetTime (timeval, sec, micro); found = TRUE; } break; default: - CaseException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1); + CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } - v = v->pending; + vec = vec->pending; } p -= 1; } if (! untilInterrupt) { - Selective_SetTime (t, 0, 0); + Selective_SetTime (timeval, 0, 0); } - if (((untilInterrupt && (i == NULL)) && (o == NULL)) && ! found) + if (((untilInterrupt && (inSet == NULL)) && (outSet == NULL)) && ! found) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, 731, (const char *) "Listen", 6, (const char *) "deadlock found, no more processes to run and no interrupts active", 65); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 730, (const char *) "Listen", 6, (const char *) "deadlock found, no more processes to run and no interrupts active", 65); } /* printf('} ') ; */ - if (((! found && (maxFd == -1)) && (i == NULL)) && (o == NULL)) + if (((! found && (maxFd == -1)) && (inSet == NULL)) && (outSet == NULL)) { /* no file descriptors to be selected upon. */ - t = Selective_KillTime (t); + timeval = Selective_KillTime (timeval); RTco_signal (lock); return ; } else { - Selective_GetTime (t, &s, &m); - Assertion_Assert (m < Microseconds); + Selective_GetTime (timeval, &sec, µ); + Assertion_Assert (micro < Microseconds); b4 = Selective_InitTime (0, 0); after = Selective_InitTime (0, 0); - r = Selective_GetTimeOfDay (b4); - Assertion_Assert (r == 0); - SubTime (&s, &m, t, b4); - Selective_SetTime (t, s, m); + result = Selective_GetTimeOfDay (b4); + Assertion_Assert (result == 0); + SubTime (&sec, µ, timeval, b4); + Selective_SetTime (timeval, sec, micro); if (Debugging) { - libc_printf ((const char *) "select waiting for %u.%06u seconds\\n", 36, s, m); + libc_printf ((const char *) "select waiting for %u.%06u seconds\\n", 36, sec, micro); } RTco_signal (lock); do { if (Debugging) { - libc_printf ((const char *) "select (.., .., .., %u.%06u)\\n", 30, s, m); + libc_printf ((const char *) "select (.., .., .., %u.%06u)\\n", 30, sec, micro); } - r = RTco_select (maxFd+1, i, o, NULL, t); - if (r == -1) + result = RTco_select (maxFd+1, inSet, outSet, NULL, timeval); + if (result == -1) { libc_perror ((const char *) "select", 6); - r = RTco_select (maxFd+1, i, o, NULL, NULL); - if (r == -1) + result = RTco_select (maxFd+1, inSet, outSet, NULL, NULL); + if (result == -1) { libc_perror ((const char *) "select timeout argument is faulty", 33); } - r = RTco_select (maxFd+1, i, NULL, NULL, t); - if (r == -1) + result = RTco_select (maxFd+1, inSet, NULL, NULL, timeval); + if (result == -1) { libc_perror ((const char *) "select output fd argument is faulty", 35); } - r = RTco_select (maxFd+1, NULL, o, NULL, t); - if (r == -1) + result = RTco_select (maxFd+1, NULL, outSet, NULL, timeval); + if (result == -1) { libc_perror ((const char *) "select input fd argument is faulty", 34); } @@ -1071,29 +1055,29 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector libc_perror ((const char *) "select maxFD+1 argument is faulty", 33); } } - } while (! (r != -1)); + } while (! (result != -1)); } - while (activatePending (untilInterrupt, call, pri, maxFd+1, &i, &o, &t, b4, after)) + while (activatePending (untilInterrupt, call, pri, maxFd+1, &inSet, &outSet, &timeval, b4, after)) {} /* empty. */ - if (t != NULL) + if (timeval != NULL) { - t = Selective_KillTime (t); + timeval = Selective_KillTime (timeval); } if (after != NULL) { - t = Selective_KillTime (after); + after = Selective_KillTime (after); } if (b4 != NULL) { - t = Selective_KillTime (b4); + b4 = Selective_KillTime (b4); } - if (i != NULL) + if (inSet != NULL) { - i = Selective_KillSet (i); + inSet = Selective_KillSet (inSet); } - if (o != NULL) + if (outSet != NULL) { - o = Selective_KillSet (o); + outSet = Selective_KillSet (outSet); } } RTco_signal (lock); diff --git a/gcc/m2/mc-boot/GRTint.h b/gcc/m2/mc-boot/GRTint.h index 5e264019888..ccc6afefc40 100644 --- a/gcc/m2/mc-boot/GRTint.h +++ b/gcc/m2/mc-boot/GRTint.h @@ -97,7 +97,7 @@ EXTERN void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsigned vector. */ -EXTERN void * RTint_AttachVector (unsigned int vec, void * p); +EXTERN void * RTint_AttachVector (unsigned int vec, void * ptr); /* IncludeVector - includes, vec, into the dispatcher list of diff --git a/gcc/m2/mc-boot/GStdIO.c b/gcc/m2/mc-boot/GStdIO.c index e5cc572be9e..41affe2a054 100644 --- a/gcc/m2/mc-boot/GStdIO.c +++ b/gcc/m2/mc-boot/GStdIO.c @@ -193,7 +193,7 @@ extern "C" StdIO_ProcWrite StdIO_GetCurrentOutput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } @@ -252,7 +252,7 @@ extern "C" StdIO_ProcRead StdIO_GetCurrentInput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GStringConvert.c b/gcc/m2/mc-boot/GStringConvert.c index 8858afc7a1c..faa5e34459e 100644 --- a/gcc/m2/mc-boot/GStringConvert.c +++ b/gcc/m2/mc-boot/GStringConvert.c @@ -1916,7 +1916,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/m2/gm2-libs/StringConvert.mod", 39, 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, 1222, (const char *) "ToSigFig", 8); point = DynamicStrings_Index (s, '.', 0); if (point < 0) { @@ -1968,7 +1968,7 @@ extern "C" DynamicStrings_String StringConvert_ToDecimalPlaces (DynamicStrings_S { int point; - Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc/m2/gm2-libs/StringConvert.mod", 39, 1069, (const char *) "ToDecimalPlaces", 15); + Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1069, (const char *) "ToDecimalPlaces", 15); point = DynamicStrings_Index (s, '.', 0); if (point < 0) { diff --git a/gcc/m2/mc-boot/GSysStorage.c b/gcc/m2/mc-boot/GSysStorage.c index 3d37ecf9518..98c03f66c35 100644 --- a/gcc/m2/mc-boot/GSysStorage.c +++ b/gcc/m2/mc-boot/GSysStorage.c @@ -93,7 +93,7 @@ extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size) (*a) = libc_malloc (static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { @@ -118,7 +118,7 @@ extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size) } if ((libc_memset ((*a), 0, static_cast (size))) != (*a)) { - Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + 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); } } if (enableDeallocation) @@ -163,7 +163,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size) (*a) = libc_realloc ((*a), static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { diff --git a/gcc/m2/mc-boot/Gdecl.c b/gcc/m2/mc-boot/Gdecl.c index 08eba89167a..4a851638d39 100644 --- a/gcc/m2/mc-boot/Gdecl.c +++ b/gcc/m2/mc-boot/Gdecl.c @@ -2746,6 +2746,8 @@ extern "C" unsigned int mcOptions_getGccConfigSystem (void); extern "C" unsigned int mcOptions_getScaffoldDynamic (void); extern "C" unsigned int mcOptions_getScaffoldMain (void); extern "C" void mcOptions_writeGPLheader (FIO_File f); +extern "C" void mcOptions_setSuppressNoReturn (unsigned int value); +extern "C" unsigned int mcOptions_getSuppressNoReturn (void); extern "C" DynamicStrings_String FormatStrings_Sprintf0 (DynamicStrings_String fmt); extern "C" DynamicStrings_String FormatStrings_Sprintf1 (DynamicStrings_String fmt, const unsigned char *w_, unsigned int _w_high); extern "C" DynamicStrings_String FormatStrings_Sprintf2 (DynamicStrings_String fmt, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high); @@ -6680,7 +6682,7 @@ static decl_node newNode (decl_nodeT k) d->at.firstUsed = 0; return d; } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7040,7 +7042,7 @@ static decl_node addToScope (decl_node n) } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7118,7 +7120,7 @@ static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7401,7 +7403,7 @@ static void putFieldVarient (decl_node f, decl_node v) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } switch (f->kind) @@ -7412,7 +7414,7 @@ static void putFieldVarient (decl_node f, decl_node v) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7463,7 +7465,7 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type, default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* fill in, n. */ @@ -7521,7 +7523,7 @@ static void putVarientTag (decl_node v, decl_node tag) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7545,7 +7547,7 @@ static decl_node getParent (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7573,7 +7575,7 @@ static decl_node getRecord (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7753,7 +7755,7 @@ static unsigned int getConstExpComplete (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7858,7 +7860,7 @@ static decl_node makeVal (decl_node params) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7879,7 +7881,7 @@ static decl_node makeCast (decl_node c, decl_node p) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -8389,7 +8391,7 @@ static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -8483,7 +8485,7 @@ static DynamicStrings_String getStringContents (decl_node n) } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -8619,7 +8621,7 @@ static decl_node doMakeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return n; @@ -9219,12 +9221,12 @@ static decl_node doGetExprType (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -9363,12 +9365,12 @@ static decl_node getSymScope (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -9680,7 +9682,7 @@ static unsigned int needsParen (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return TRUE; @@ -9789,7 +9791,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -9815,7 +9817,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -10093,7 +10095,7 @@ static decl_node doGetLastOp (decl_node a, decl_node b) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -10733,7 +10735,7 @@ static void doExprC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -10938,7 +10940,7 @@ static void doExprM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -11110,7 +11112,7 @@ static DynamicStrings_String replaceChar (DynamicStrings_String s, char ch, cons return s; } } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -11170,7 +11172,7 @@ static unsigned int countChar (DynamicStrings_String s, char ch) return c; } } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12229,7 +12231,7 @@ static decl_node doMin (decl_node n) M2RTS_HALT (-1); /* finish the cacading elsif statement. */ __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12310,7 +12312,7 @@ static decl_node doMax (decl_node n) M2RTS_HALT (-1); /* finish the cacading elsif statement. */ __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12599,7 +12601,7 @@ static void doBaseC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } mcPretty_setNeedSpace (p); @@ -12689,7 +12691,7 @@ static void doSystemC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -13338,7 +13340,7 @@ static void doProcedureHeadingC (decl_node n, unsigned int prototype) outText (doP, (const char *) "void", 4); } mcPretty_print (doP, (const char *) ")", 1); - if (n->procedureF.noreturn && prototype) + if ((n->procedureF.noreturn && prototype) && (! (mcOptions_getSuppressNoReturn ()))) { mcPretty_setNeedSpace (doP); outText (doP, (const char *) "__attribute__ ((noreturn))", 26); @@ -16043,7 +16045,7 @@ static void doCreal (mcPretty_pretty p, decl_node t) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -16074,7 +16076,7 @@ static void doCimag (mcPretty_pretty p, decl_node t) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -16205,7 +16207,7 @@ static void doIntrinsicC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } outText (p, (const char *) ";", 1); @@ -17367,7 +17369,7 @@ static void dbs (decl_dependentState s, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } if (n != NULL) @@ -18260,10 +18262,10 @@ static decl_dependentState doDependants (alists_alist l, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -18360,7 +18362,7 @@ static void visitIntrinsicFunction (alists_alist v, decl_node n, decl_nodeProced default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -19359,7 +19361,7 @@ static void visitDependants (alists_alist v, decl_node n, decl_nodeProcedure p) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -19706,12 +19708,12 @@ static DynamicStrings_String genKind (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -20886,7 +20888,7 @@ static void doBaseM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } mcPretty_setNeedSpace (p); @@ -20912,7 +20914,7 @@ static void doSystemM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22123,10 +22125,10 @@ static decl_node doDupExpr (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -22456,7 +22458,7 @@ extern "C" unsigned int decl_isVisited (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -22486,7 +22488,7 @@ extern "C" void decl_unsetVisited (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22514,7 +22516,7 @@ extern "C" void decl_setVisited (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22542,7 +22544,7 @@ extern "C" void decl_setEnumsComplete (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22570,7 +22572,7 @@ extern "C" unsigned int decl_getEnumsComplete (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -22791,7 +22793,7 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -23166,12 +23168,12 @@ extern "C" decl_node decl_getType (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -23565,7 +23567,7 @@ extern "C" decl_node decl_getScope (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -24220,7 +24222,7 @@ extern "C" decl_node decl_makeVarient (decl_node r) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return n; @@ -24687,7 +24689,7 @@ extern "C" nameKey_Name decl_getSymName (decl_node n) __builtin_unreachable (); break; } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -24725,7 +24727,7 @@ extern "C" decl_node decl_import (decl_node m, decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } importEnumFields (m, n); @@ -24854,7 +24856,7 @@ extern "C" void decl_setSource (decl_node n, nameKey_Name s) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -24882,7 +24884,7 @@ extern "C" nameKey_Name decl_getSource (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -25325,7 +25327,7 @@ extern "C" void decl_addParameter (decl_node proc, decl_node param) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -25418,7 +25420,7 @@ extern "C" decl_node decl_makeBinaryTok (mcReserved_toktype op, decl_node l, dec M2RTS_HALT (-1); /* most likely op needs a clause as above. */ __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -25450,7 +25452,7 @@ extern "C" decl_node decl_makeUnaryTok (mcReserved_toktype op, decl_node e) M2RTS_HALT (-1); /* most likely op needs a clause as above. */ __builtin_unreachable (); } - ReturnException ("../../gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -25888,7 +25890,7 @@ extern "C" void decl_setConstExpComplete (decl_node n) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26253,7 +26255,7 @@ extern "C" void decl_putBegin (decl_node b, decl_node s) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26280,7 +26282,7 @@ extern "C" void decl_putFinally (decl_node b, decl_node s) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26908,7 +26910,7 @@ extern "C" void decl_out (void) default: - CaseException ("../../gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } closeOutput (); diff --git a/gcc/m2/mc-boot/Gkeyc.c b/gcc/m2/mc-boot/Gkeyc.c index 4adcf300abb..e089ac95250 100644 --- a/gcc/m2/mc-boot/Gkeyc.c +++ b/gcc/m2/mc-boot/Gkeyc.c @@ -908,7 +908,7 @@ static unsigned int mangleN (nameKey_Name n, DynamicStrings_String *m, unsigned return TRUE; } } - ReturnException ("../../gcc/m2/mc/keyc.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/keyc.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GmcComment.c b/gcc/m2/mc-boot/GmcComment.c index c14beb17714..2e60c7aa567 100644 --- a/gcc/m2/mc-boot/GmcComment.c +++ b/gcc/m2/mc-boot/GmcComment.c @@ -257,7 +257,7 @@ static void dumpComment (mcComment_commentDesc cd) default: - CaseException ("../../gcc/m2/mc/mcComment.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/mcComment.def", 20, 1); __builtin_unreachable (); } if (cd->used) diff --git a/gcc/m2/mc-boot/GmcComp.c b/gcc/m2/mc-boot/GmcComp.c index 9362f90f5a3..8a79413add4 100644 --- a/gcc/m2/mc-boot/GmcComp.c +++ b/gcc/m2/mc-boot/GmcComp.c @@ -294,7 +294,7 @@ static decl_node examineCompilationUnit (void) } mcflex_mcError (DynamicStrings_string (DynamicStrings_InitString ((const char *) "failed to find module name", 26))); libc_exit (1); - ReturnException ("../../gcc/m2/mc/mcComp.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1); __builtin_unreachable (); } @@ -324,7 +324,7 @@ static decl_node peepInto (DynamicStrings_String s) mcPrintf_fprintf1 (FIO_StdErr, (const char *) "failed to open %s\\n", 19, (const unsigned char *) &s, (sizeof (s)-1)); libc_exit (1); } - ReturnException ("../../gcc/m2/mc/mcComp.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GmcDebug.c b/gcc/m2/mc-boot/GmcDebug.c index 26d8efd8d38..db45ae8ac87 100644 --- a/gcc/m2/mc-boot/GmcDebug.c +++ b/gcc/m2/mc-boot/GmcDebug.c @@ -54,7 +54,7 @@ extern "C" void mcDebug_assert (unsigned int q) { if (! q) { - mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/mc/mcDebug.mod", 27, 35); + mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/mc/mcDebug.mod", 42, 35); } } diff --git a/gcc/m2/mc-boot/GmcMetaError.c b/gcc/m2/mc-boot/GmcMetaError.c index e56cad7868b..4d406851d0b 100644 --- a/gcc/m2/mc-boot/GmcMetaError.c +++ b/gcc/m2/mc-boot/GmcMetaError.c @@ -408,7 +408,7 @@ static void internalFormat (DynamicStrings_String s, int i, const char *m_, unsi s = DynamicStrings_ConCatChar (s, '^'); s = SFIO_WriteS (FIO_StdOut, s); FIO_WriteLine (FIO_StdOut); - mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 97); + mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 97); } @@ -420,7 +420,7 @@ static DynamicStrings_String x (DynamicStrings_String a, DynamicStrings_String b { if (a != b) { - mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 109); + mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 109); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -734,7 +734,7 @@ static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned case mcMetaError_chained: if (e == NULL) { - mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 355); + mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 355); } else { @@ -758,7 +758,7 @@ static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned default: - mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 369); + mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 369); break; } return e; diff --git a/gcc/m2/mc-boot/GmcOptions.c b/gcc/m2/mc-boot/GmcOptions.c index 40f4154518d..5d4e31be5a7 100644 --- a/gcc/m2/mc-boot/GmcOptions.c +++ b/gcc/m2/mc-boot/GmcOptions.c @@ -62,6 +62,7 @@ static unsigned int scaffoldDynamic; static unsigned int caseRuntime; static unsigned int arrayRuntime; static unsigned int returnRuntime; +static unsigned int suppressNoReturn; static unsigned int gccConfigSystem; static unsigned int ignoreFQ; static unsigned int debugTopological; @@ -170,6 +171,18 @@ extern "C" unsigned int mcOptions_getScaffoldMain (void); extern "C" void mcOptions_writeGPLheader (FIO_File f); +/* + setSuppressNoReturn - set suppressNoReturn to value. +*/ + +extern "C" void mcOptions_setSuppressNoReturn (unsigned int value); + +/* + getSuppressNoReturn - return the suppressNoReturn value. +*/ + +extern "C" unsigned int mcOptions_getSuppressNoReturn (void); + /* getYear - return the year. */ @@ -376,6 +389,7 @@ static void displayHelp (void) mcPrintf_printf0 ((const char *) " --automatic generate a comment at the start of the file warning not to edit as it was automatically generated\\n", 121); mcPrintf_printf0 ((const char *) " --scaffold-dynamic generate dynamic module initialization code for C++\\n", 75); mcPrintf_printf0 ((const char *) " --scaffold-main generate main function which calls upon the dynamic initialization support in M2RTS\\n", 107); + mcPrintf_printf0 ((const char *) " --suppress-noreturn suppress the emission of any attribute noreturn\\n", 71); mcPrintf_printf0 ((const char *) " filename the source file must be the last option\\n", 63); libc_exit (0); } @@ -824,6 +838,11 @@ static void handleOption (DynamicStrings_String arg) /* avoid dangling else. */ scaffoldDynamic = TRUE; } + else if (optionIs ((const char *) "--suppress-noreturn", 19, arg)) + { + /* avoid dangling else. */ + suppressNoReturn = TRUE; + } } @@ -1045,6 +1064,28 @@ extern "C" void mcOptions_writeGPLheader (FIO_File f) issueGPL (f); } + +/* + setSuppressNoReturn - set suppressNoReturn to value. +*/ + +extern "C" void mcOptions_setSuppressNoReturn (unsigned int value) +{ + suppressNoReturn = value; +} + + +/* + getSuppressNoReturn - return the suppressNoReturn value. +*/ + +extern "C" unsigned int mcOptions_getSuppressNoReturn (void) +{ + return suppressNoReturn; + /* static analysis guarentees a RETURN statement will be used before here. */ + __builtin_unreachable (); +} + extern "C" void _M2_mcOptions_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { langC = TRUE; @@ -1066,6 +1107,7 @@ extern "C" void _M2_mcOptions_init (__attribute__((unused)) int argc,__attribute gccConfigSystem = FALSE; scaffoldMain = FALSE; scaffoldDynamic = FALSE; + suppressNoReturn = FALSE; hPrefix = DynamicStrings_InitString ((const char *) "", 0); cppArgs = DynamicStrings_InitString ((const char *) "", 0); cppProgram = DynamicStrings_InitString ((const char *) "", 0); diff --git a/gcc/m2/mc-boot/GmcOptions.h b/gcc/m2/mc-boot/GmcOptions.h index cdb5b9520b4..de2bc071c9f 100644 --- a/gcc/m2/mc-boot/GmcOptions.h +++ b/gcc/m2/mc-boot/GmcOptions.h @@ -132,6 +132,18 @@ EXTERN unsigned int mcOptions_getScaffoldMain (void); */ EXTERN void mcOptions_writeGPLheader (FIO_File f); + +/* + setSuppressNoReturn - set suppressNoReturn to value. +*/ + +EXTERN void mcOptions_setSuppressNoReturn (unsigned int value); + +/* + getSuppressNoReturn - return the suppressNoReturn value. +*/ + +EXTERN unsigned int mcOptions_getSuppressNoReturn (void); # ifdef __cplusplus } # endif diff --git a/gcc/m2/mc-boot/GmcStack.c b/gcc/m2/mc-boot/GmcStack.c index 146c79d61c0..95d31a5037b 100644 --- a/gcc/m2/mc-boot/GmcStack.c +++ b/gcc/m2/mc-boot/GmcStack.c @@ -165,7 +165,7 @@ extern "C" void * mcStack_pop (mcStack_stack s) Indexing_DeleteIndice (s->list, Indexing_HighIndice (s->list)); return a; } - ReturnException ("../../gcc/m2/mc/mcStack.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1); __builtin_unreachable (); } @@ -215,7 +215,7 @@ extern "C" void * mcStack_access (mcStack_stack s, unsigned int i) { return Indexing_GetIndice (s->list, i); } - ReturnException ("../../gcc/m2/mc/mcStack.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GnameKey.c b/gcc/m2/mc-boot/GnameKey.c index 7bb1e8fe76f..b00a59868e4 100644 --- a/gcc/m2/mc-boot/GnameKey.c +++ b/gcc/m2/mc-boot/GnameKey.c @@ -323,7 +323,7 @@ extern "C" nameKey_Name nameKey_makeKey (const char *a_, unsigned int _a_high) (*p) = ASCII_nul; return doMakeKey (n, higha); } - ReturnException ("../../gcc/m2/mc/nameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1); __builtin_unreachable (); } @@ -373,7 +373,7 @@ extern "C" nameKey_Name nameKey_makekey (void * a) return doMakeKey (n, higha); } } - ReturnException ("../../gcc/m2/mc/nameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GsymbolKey.c b/gcc/m2/mc-boot/GsymbolKey.c index c993097dff0..8c16a63474e 100644 --- a/gcc/m2/mc-boot/GsymbolKey.c +++ b/gcc/m2/mc-boot/GsymbolKey.c @@ -142,7 +142,7 @@ static void findNodeAndParentInTree (symbolKey_symbolTree t, nameKey_Name n, sym (*father) = t; if (t == NULL) { - Debug_Halt ((const char *) "parameter t should never be NIL", 31, 203, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29); + Debug_Halt ((const char *) "parameter t should never be NIL", 31, 203, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } (*child) = t->left; if ((*child) != NULL) @@ -285,7 +285,7 @@ extern "C" void symbolKey_putSymKey (symbolKey_symbolTree t, nameKey_Name name, } else { - Debug_Halt ((const char *) "symbol already stored", 21, 119, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29); + Debug_Halt ((const char *) "symbol already stored", 21, 119, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } } @@ -352,7 +352,7 @@ extern "C" void symbolKey_delSymKey (symbolKey_symbolTree t, nameKey_Name name) } else { - Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 186, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29); + Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 186, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } } diff --git a/gcc/m2/mc/decl.mod b/gcc/m2/mc/decl.mod index 3550fd606a5..ab93fe09080 100644 --- a/gcc/m2/mc/decl.mod +++ b/gcc/m2/mc/decl.mod @@ -30,7 +30,11 @@ FROM SFIO IMPORT OpenToWrite, WriteS ; FROM FIO IMPORT File, Close, FlushBuffer, StdOut, WriteLine, WriteChar ; FROM DynamicStrings IMPORT String, InitString, EqualArray, InitStringCharStar, KillString, ConCat, Mark, RemoveWhitePostfix, RemoveWhitePrefix ; FROM StringConvert IMPORT CardinalToString, ostoc ; -FROM mcOptions IMPORT getOutputFile, getDebugTopological, getHPrefix, getIgnoreFQ, getExtendedOpaque, writeGPLheader, getGccConfigSystem, getScaffoldDynamic, getScaffoldMain ; + +FROM mcOptions IMPORT getOutputFile, getDebugTopological, getHPrefix, getIgnoreFQ, + getExtendedOpaque, writeGPLheader, getGccConfigSystem, + getScaffoldDynamic, getScaffoldMain, getSuppressNoReturn ; + FROM FormatStrings IMPORT Sprintf0, Sprintf1, Sprintf2, Sprintf3 ; FROM libc IMPORT printf, memset ; FROM mcMetaError IMPORT metaError1, metaError2, metaError3, metaErrors1, metaErrors2 ; @@ -8421,7 +8425,7 @@ BEGIN outText (doP, "void") END ; print (doP, ")") ; - IF n^.procedureF.noreturn AND prototype + IF n^.procedureF.noreturn AND prototype AND (NOT getSuppressNoReturn ()) THEN setNeedSpace (doP) ; outText (doP, "__attribute__ ((noreturn))") diff --git a/gcc/m2/mc/mcOptions.def b/gcc/m2/mc/mcOptions.def index 0587da0a092..a0284f462b4 100644 --- a/gcc/m2/mc/mcOptions.def +++ b/gcc/m2/mc/mcOptions.def @@ -134,4 +134,18 @@ PROCEDURE getScaffoldMain () : BOOLEAN ; PROCEDURE writeGPLheader (f: File) ; +(* + setSuppressNoReturn - set suppressNoReturn to value. +*) + +PROCEDURE setSuppressNoReturn (value: BOOLEAN) ; + + +(* + getSuppressNoReturn - return the suppressNoReturn value. +*) + +PROCEDURE getSuppressNoReturn () : BOOLEAN ; + + END mcOptions. diff --git a/gcc/m2/mc/mcOptions.mod b/gcc/m2/mc/mcOptions.mod index 909d7983a71..d2837fb3d34 100644 --- a/gcc/m2/mc/mcOptions.mod +++ b/gcc/m2/mc/mcOptions.mod @@ -46,6 +46,7 @@ VAR caseRuntime, arrayRuntime, returnRuntime, + suppressNoReturn, gccConfigSystem, ignoreFQ, debugTopological, @@ -140,7 +141,8 @@ BEGIN printf0 (' --automatic generate a comment at the start of the file warning not to edit as it was automatically generated\n') ; printf0 (' --scaffold-dynamic generate dynamic module initialization code for C++\n') ; printf0 (' --scaffold-main generate main function which calls upon the dynamic initialization support in M2RTS\n') ; - printf0 (" filename the source file must be the last option\n") ; + printf0 (' --suppress-noreturn suppress the emission of any attribute noreturn\n'); + printf0 (' filename the source file must be the last option\n') ; exit (0) END displayHelp ; @@ -439,6 +441,26 @@ BEGIN END getExtendedOpaque ; +(* + setSuppressNoReturn - set suppressNoReturn to value. +*) + +PROCEDURE setSuppressNoReturn (value: BOOLEAN) ; +BEGIN + suppressNoReturn := value +END setSuppressNoReturn; + + +(* + getSuppressNoReturn - return the suppressNoReturn value. +*) + +PROCEDURE getSuppressNoReturn () : BOOLEAN ; +BEGIN + RETURN suppressNoReturn +END getSuppressNoReturn ; + + (* setSearchPath - set the search path for the module sources. *) @@ -675,6 +697,9 @@ BEGIN ELSIF optionIs ('--scaffold-dynamic', arg) THEN scaffoldDynamic := TRUE + ELSIF optionIs ('--suppress-noreturn', arg) + THEN + suppressNoReturn := TRUE END END handleOption ; @@ -733,6 +758,7 @@ BEGIN gccConfigSystem := FALSE ; scaffoldMain := FALSE ; scaffoldDynamic := FALSE ; + suppressNoReturn := FALSE ; hPrefix := InitString ('') ; cppArgs := InitString ('') ; cppProgram := InitString ('') ; diff --git a/gcc/m2/pge-boot/GDynamicStrings.c b/gcc/m2/pge-boot/GDynamicStrings.c index ed917cfae2e..2dd4985b47e 100644 --- a/gcc/m2/pge-boot/GDynamicStrings.c +++ b/gcc/m2/pge-boot/GDynamicStrings.c @@ -1217,7 +1217,7 @@ static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned (*c).next->contents.next = NULL; ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o); AddDebugInfo ((*c).next); - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 722, (const char *) "ConcatContents", 14); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 722, (const char *) "ConcatContents", 14); } else { @@ -1315,7 +1315,7 @@ static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigne AddDebugInfo ((*c).next); if (TraceOn) { - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 917, (const char *) "ConcatContentsAddress", 21); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 917, (const char *) "ConcatContentsAddress", 21); } } else @@ -1540,7 +1540,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 758, (const char *) "InitString", 10); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 758, (const char *) "InitString", 10); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1643,7 +1643,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 957, (const char *) "InitStringCharStar", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 957, (const char *) "InitStringCharStar", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1668,7 +1668,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) s = DynamicStrings_InitString ((const char *) &a.array[0], 1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 977, (const char *) "InitStringChar", 14); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 977, (const char *) "InitStringChar", 14); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1826,7 +1826,7 @@ extern "C" DynamicStrings_String DynamicStrings_Dup (DynamicStrings_String s) s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1173, (const char *) "Dup", 3); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1173, (const char *) "Dup", 3); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1848,7 +1848,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b); if (TraceOn) { - a = AssignDebug (a, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1193, (const char *) "Add", 3); + a = AssignDebug (a, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1193, (const char *) "Add", 3); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1913,7 +1913,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v t = DynamicStrings_InitStringCharStar (a); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1250, (const char *) "EqualCharStar", 13); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1250, (const char *) "EqualCharStar", 13); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1951,7 +1951,7 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons t = DynamicStrings_InitString ((const char *) a, _a_high); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1280, (const char *) "EqualArray", 10); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1280, (const char *) "EqualArray", 10); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1989,7 +1989,7 @@ extern "C" DynamicStrings_String DynamicStrings_Mult (DynamicStrings_String s, u } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1312, (const char *) "Mult", 4); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1312, (const char *) "Mult", 4); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2068,7 +2068,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, AddDebugInfo (t->contents.next); if (TraceOn) { - t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1380, (const char *) "Slice", 5); + t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1380, (const char *) "Slice", 5); } } t = t->contents.next; @@ -2086,7 +2086,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, } if (TraceOn) { - d = AssignDebug (d, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1397, (const char *) "Slice", 5); + d = AssignDebug (d, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1397, (const char *) "Slice", 5); } return d; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2214,7 +2214,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveComment (DynamicStrings_St } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1509, (const char *) "RemoveComment", 13); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1509, (const char *) "RemoveComment", 13); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2239,7 +2239,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePrefix (DynamicString s = DynamicStrings_Slice (s, (int ) (i), 0); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1621, (const char *) "RemoveWhitePrefix", 17); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1621, (const char *) "RemoveWhitePrefix", 17); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2264,7 +2264,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePostfix (DynamicStrin s = DynamicStrings_Slice (s, 0, i+1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1643, (const char *) "RemoveWhitePostfix", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1643, (const char *) "RemoveWhitePostfix", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2633,7 +2633,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned { stop (); /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's") */ - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); + 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); } else { diff --git a/gcc/m2/pge-boot/GFIO.c b/gcc/m2/pge-boot/GFIO.c index d3e6b4dacc6..848860781aa 100644 --- a/gcc/m2/pge-boot/GFIO.c +++ b/gcc/m2/pge-boot/GFIO.c @@ -558,7 +558,7 @@ static FIO_File GetNextFreeDescriptor (void) return f; /* create new slot */ } } - ReturnException ("../../gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GIndexing.c b/gcc/m2/pge-boot/GIndexing.c index 428f22bfce1..630feb7c694 100644 --- a/gcc/m2/pge-boot/GIndexing.c +++ b/gcc/m2/pge-boot/GIndexing.c @@ -227,7 +227,7 @@ extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n) { return (n >= i->Low) && (n <= i->High); } - ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } @@ -247,7 +247,7 @@ extern "C" unsigned int Indexing_HighIndice (Indexing_Index i) { return i->High; } - ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } @@ -267,7 +267,7 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) { return i->Low; } - ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.c b/gcc/m2/pge-boot/GM2EXCEPTION.c index 10de9b98d64..cf19a4e18b7 100644 --- a/gcc/m2/pge-boot/GM2EXCEPTION.c +++ b/gcc/m2/pge-boot/GM2EXCEPTION.c @@ -56,13 +56,13 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void) n = RTExceptions_GetNumber (e); if (n == (UINT_MAX)) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); } else { return (M2EXCEPTION_M2Exceptions) (n); } - ReturnException ("../../gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GM2RTS.c b/gcc/m2/pge-boot/GM2RTS.c index c6eb399bba4..d283f3f7f79 100644 --- a/gcc/m2/pge-boot/GM2RTS.c +++ b/gcc/m2/pge-boot/GM2RTS.c @@ -162,7 +162,7 @@ extern "C" void M2RTS_ExecuteTerminationProcedures (void); not call ExecuteTerminationProcedures. */ -extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn)); +extern "C" void M2RTS_Terminate (void); /* HALT - terminate the current program. The procedure @@ -175,7 +175,7 @@ extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn)); then calling HALT with no parameter. */ -extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn)); +extern "C" void M2RTS_HALT (int exitcode); /* Halt - provides a more user friendly version of HALT, which takes @@ -183,7 +183,7 @@ extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn)); 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) __attribute__ ((noreturn)); +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); /* HaltC - provides a more user friendly version of HALT, which takes @@ -191,7 +191,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) __attribute__ ((noreturn)); +extern "C" void M2RTS_HaltC (void * filename, unsigned int line, void * function, void * description); /* ExitOnHalt - if HALT is executed then call exit with the exit code, e. @@ -203,7 +203,7 @@ extern "C" void M2RTS_ExitOnHalt (int e); ErrorMessage - emits an error message to stderr and then calls exit (1). */ -extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high) __attribute__ ((noreturn)); +extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high); /* Length - returns the length of a string, a. This is called whenever @@ -212,30 +212,30 @@ extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_ */ extern "C" unsigned int M2RTS_Length (const char *a_, unsigned int _a_high); -extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); +extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); /* ExecuteReverse - execute the procedure associated with procptr @@ -268,7 +268,7 @@ static void ErrorStringC (void * str); ErrorMessageC - emits an error message to stderr and then calls exit (1). */ -static void ErrorMessageC (void * message, void * filename, unsigned int line, void * function) __attribute__ ((noreturn)); +static void ErrorMessageC (void * message, void * filename, unsigned int line, void * function); /* InitProcList - initialize the head and tail pointers to NIL. diff --git a/gcc/m2/pge-boot/GNameKey.c b/gcc/m2/pge-boot/GNameKey.c index 37d8c961e49..ff8621f959d 100644 --- a/gcc/m2/pge-boot/GNameKey.c +++ b/gcc/m2/pge-boot/GNameKey.c @@ -330,7 +330,7 @@ extern "C" NameKey_Name NameKey_MakeKey (const char *a_, unsigned int _a_high) (*p) = ASCII_nul; return DoMakeKey (n, higha); } - ReturnException ("../../gcc/m2/gm2-compiler/NameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-compiler/NameKey.def", 20, 1); __builtin_unreachable (); } @@ -380,7 +380,7 @@ extern "C" NameKey_Name NameKey_makekey (void * a) return DoMakeKey (n, higha); } } - ReturnException ("../../gcc/m2/gm2-compiler/NameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-compiler/NameKey.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GPushBackInput.c b/gcc/m2/pge-boot/GPushBackInput.c index 612e94a6b6a..3165ce12be4 100644 --- a/gcc/m2/pge-boot/GPushBackInput.c +++ b/gcc/m2/pge-boot/GPushBackInput.c @@ -275,7 +275,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/m2/gm2-libs/PushBackInput.mod", 39); + 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); } return ch; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -301,7 +301,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/m2/gm2-libs/PushBackInput.mod", 39); + Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } @@ -322,7 +322,7 @@ extern "C" void PushBackInput_PutStr (DynamicStrings_String s) i -= 1; if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast (i)))) != (DynamicStrings_char (s, static_cast (i)))) { - Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39); + Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } diff --git a/gcc/m2/pge-boot/GRTExceptions.c b/gcc/m2/pge-boot/GRTExceptions.c index 8c2d35d8880..5c2eccc2eac 100644 --- a/gcc/m2/pge-boot/GRTExceptions.c +++ b/gcc/m2/pge-boot/GRTExceptions.c @@ -724,7 +724,7 @@ static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) static void indexf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 613, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 613, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); } @@ -734,7 +734,7 @@ static void indexf (void * a) static void range (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 625, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 625, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); } @@ -744,7 +744,7 @@ static void range (void * a) static void casef (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 637, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 637, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); } @@ -754,7 +754,7 @@ static void casef (void * a) static void invalidloc (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 649, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 649, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); } @@ -764,7 +764,7 @@ static void invalidloc (void * a) static void function (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 661, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 661, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ } @@ -774,7 +774,7 @@ static void function (void * a) static void wholevalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 673, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 673, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -784,7 +784,7 @@ static void wholevalue (void * a) static void wholediv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 685, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 685, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -794,7 +794,7 @@ static void wholediv (void * a) static void realvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 697, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 697, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); } @@ -804,7 +804,7 @@ static void realvalue (void * a) static void realdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 709, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 709, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); } @@ -814,7 +814,7 @@ static void realdiv (void * a) static void complexvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 721, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 721, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); } @@ -824,7 +824,7 @@ static void complexvalue (void * a) static void complexdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 733, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 733, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); } @@ -834,7 +834,7 @@ static void complexdiv (void * a) static void protection (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 745, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 745, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); } @@ -844,7 +844,7 @@ static void protection (void * a) static void systemf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 757, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 757, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); } @@ -854,7 +854,7 @@ static void systemf (void * a) static void coroutine (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 769, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 769, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); } @@ -864,7 +864,7 @@ static void coroutine (void * a) static void exception (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc/m2/gm2-libs/RTExceptions.mod")), 781, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 781, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); } @@ -1183,13 +1183,13 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void) { if (currentEHB == NULL) { - M2RTS_Halt ((const char *) "../../gcc/m2/gm2-libs/RTExceptions.mod", 38, 599, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); + 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); } else { return currentEHB; } - ReturnException ("../../gcc/m2/gm2-libs/RTExceptions.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GStdIO.c b/gcc/m2/pge-boot/GStdIO.c index 8b551aa5b97..d918673c9ac 100644 --- a/gcc/m2/pge-boot/GStdIO.c +++ b/gcc/m2/pge-boot/GStdIO.c @@ -191,7 +191,7 @@ extern "C" StdIO_ProcWrite StdIO_GetCurrentOutput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } @@ -250,7 +250,7 @@ extern "C" StdIO_ProcRead StdIO_GetCurrentInput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GSymbolKey.c b/gcc/m2/pge-boot/GSymbolKey.c index 51df5fce89d..699b70a5c62 100644 --- a/gcc/m2/pge-boot/GSymbolKey.c +++ b/gcc/m2/pge-boot/GSymbolKey.c @@ -183,7 +183,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/m2/gm2-compiler/SymbolKey.mod", 39); + Debug_Halt ((const char *) "parameter t should never be NIL", 31, 240, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54); } Assertion_Assert (t->Right == NULL); (*child) = t->Left; @@ -392,7 +392,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/m2/gm2-compiler/SymbolKey.mod", 39); + Debug_Halt ((const char *) "symbol already stored", 21, 156, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54); } } @@ -459,7 +459,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/m2/gm2-compiler/SymbolKey.mod", 39); + 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); } } diff --git a/gcc/m2/pge-boot/GSysStorage.c b/gcc/m2/pge-boot/GSysStorage.c index e008d91d0e8..d9cd60bd9fc 100644 --- a/gcc/m2/pge-boot/GSysStorage.c +++ b/gcc/m2/pge-boot/GSysStorage.c @@ -93,7 +93,7 @@ extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size) (*a) = libc_malloc (static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { @@ -118,7 +118,7 @@ extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size) } if ((libc_memset ((*a), 0, static_cast (size))) != (*a)) { - Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + 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); } } if (enableDeallocation) @@ -163,7 +163,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size) (*a) = libc_realloc ((*a), static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36); + Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { diff --git a/gcc/m2/pge-boot/GUnixArgs.cc b/gcc/m2/pge-boot/GUnixArgs.cc index 29b8ec27323..254d5edcc55 100644 --- a/gcc/m2/pge-boot/GUnixArgs.cc +++ b/gcc/m2/pge-boot/GUnixArgs.cc @@ -36,6 +36,8 @@ static int UnixArgs_ArgC; static char **UnixArgs_ArgV; static char **UnixArgs_EnvV; +#define LIBNAME "m2pim" + /* GetArgC returns argc. */ @@ -86,6 +88,6 @@ struct _M2_UnixArgs_ctor { _M2_UnixArgs_ctor (); } _M2_UnixArgs_ctor; _M2_UnixArgs_ctor::_M2_UnixArgs_ctor (void) { - M2RTS_RegisterModule ("UnixArgs", _M2_UnixArgs_init, _M2_UnixArgs_fini, + M2RTS_RegisterModule ("UnixArgs", LIBNAME, _M2_UnixArgs_init, _M2_UnixArgs_fini, _M2_UnixArgs_dep); } diff --git a/gcc/m2/pge-boot/m2rts.h b/gcc/m2/pge-boot/m2rts.h index 09d55f41d3b..e70c9f63f7b 100644 --- a/gcc/m2/pge-boot/m2rts.h +++ b/gcc/m2/pge-boot/m2rts.h @@ -29,7 +29,7 @@ typedef void (*proc_con) (int, char **, char **); typedef void (*proc_dep) (void); extern "C" void M2RTS_RequestDependant (const char *modulename, const char *dependancy); -extern "C" void M2RTS_RegisterModule (const char *modulename, +extern "C" void M2RTS_RegisterModule (const char *modulename, const char *libname, proc_con init, proc_con fini, proc_dep dependencies); extern "C" void _M2_M2RTS_init (void);