aboutsummaryrefslogtreecommitdiff
path: root/gcc/m2
AgeCommit message (Collapse)AuthorFilesLines
2023-04-03Daily bump.GCC Administrator1-0/+19
2023-04-02PR modula2/109336 pass -fmod= though and build m2/stage2/cc1gm2 libsGaius Mulley5-14/+45
This patch enables gm2 to pass -fmod= though to cc1gm2. It also builds the libraries for m2/stage2/cc1gm2 with no named path and full debugging. gcc/m2/ChangeLog: PR modula2/109336 * Make-lang.in (GM2_O): Set to -O0. (GM2_LIBS): Remove target libraries and replace with build libs. (BUILD-LIBS): New declaration. (m2/gm2-libs/libgm2.a): New rule. (m2/gm2-libs/%.o): New rule. (m2/gm2-libs/choosetemp.o): New rule. * gm2-compiler/M2ColorString.mod (append): Use ADR rather than implicit conversion. * gm2-compiler/M2Comp.mod (Compile): Add qprintf messages for when a source file is not found. Improve comments and formatting. * gm2-libs-ch/cgetopt.c (cgetopt_cgetopt_long): Remove ansi-decl.h. Add getopt.h. (cgetopt_cgetopt_long_only): Change cgetopt_ to getopt_. * gm2spec.cc (lang_specific_driver): Do not skip -fmod=. Remove comment. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-30Daily bump.GCC Administrator1-0/+29
2023-03-29PR modula2/109336 - The -fmod= and -fdef= options do not workGaius Mulley6-40/+106
The -fmod= and -fdef= options do not work. After the linking re-implementation and subsequent restructuring the -fmod= amd -fdef= are now broken. This patch adds -fmod= and -fdef= processing into gm2spec.cc. It also reduces the complexity of extension handling within M2Search by storing the preceeding "." in the extension. gcc/m2/ChangeLog: PR modula2/109336 PR modula2/109315 * gm2-compiler/M2FileName.mod (CalculateFileName): Simplified by ensuring the extension contains the ".". (CalculateStemName): Re-formatted. (ExtractExtension): Re-formatted. (ExtractModule): Re-formatted. * gm2-compiler/M2Options.def (setdefextension): Add block comment. (setmodextension): Add block comment. Re-formatted. * gm2-compiler/M2Options.mod (setdefextension): Add block comment. (setmodextension): Add block comment. Re-formatted. * gm2-compiler/M2Search.mod (FindSourceDefFile): Use DefaultDefExt. (DefaultDefExt): New constant. (DefaultModExt): New constant. (FindSourceModFile): Use DefaultModExt. * gm2-gcc/m2decl.cc (m2decl_DeclareKnownVariable): Correct spelling. * gm2spec.cc (M2SOURCE): New constant. (LANGSPEC): New value. (MATHLIB): New value. (WITHLIBC): New value. (SKIPOPT): New value. (lang_specific_driver): Replace seen_module_extension bool with module_extension char *. Detect -fmod= and remember extension. Use the extension to detect modula-2 source and mark it as such. gcc/testsuite/ChangeLog: PR modula2/109336 * gm2/link/nondefaultext/pass/hello.md: New test. * gm2/link/nondefaultext/pass/liba.dm: New test. * gm2/link/nondefaultext/pass/liba.md: New test. * gm2/link/nondefaultext/pass/link-nondefaultext-pass.exp: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-24Daily bump.GCC Administrator1-0/+31
2023-03-23PR modula2/109264 Bugfix resolve opaque types containing setsGaius Mulley6-80/+206
Resolve opaque type handling. The bug is caused by the compiler attempting to resolve the meta types of a constant constructor. It incorrectly attempts to get the type on an enumeration type (resulting in NulSym) which causes the meta resolver to spin. Some PHBuild rules (building records need to be copied from P3Build so that hidden types are resolved in order across the compile. gcc/m2/ChangeLog: PR modula2/109264 * gm2-compiler/M2Quads.mod (BuildConstFunctionCall): Comment out ErrorString in debugging block. (BuildConstructorStart): Replace Assert with a call to MetaErrorT3. Import MetaErrorT3. * gm2-compiler/PCSymBuild.mod (buildConstFunction): Rename local variables. (WalkFunctionParam): Remove test for IsEnumeration when resolving MIN or MAX parameters. * gm2-compiler/PHBuild.bnf (BlockAssert): New procedure. (ErrorArrayat): New procedure. (Expect): Renamed parameter t to tok. (PushQualident): New rule. (ConstSetOrQualidentOrFunction): Force AutoOn. (TypeDeclaration): Add debugging assert. (SimpleType): Add debugging assert. (DefaultRecordAttributes): New rule (and bugfix). (FieldPragmaExpression): New rule (and bugfix). (PragmaConstExpression): New rule (and bugfix). (SetOrDesignatorOrFunction): Add debugging assert. (Block): Add debugging assert. * gm2-gcc/m2expr.cc (m2expr_ConstantExpressionWarning): int to bool. * gm2-gcc/m2expr.h (m2expr_TreeOverflow): int to bool. (m2expr_GetBooleanTrue): Remove. (m2expr_GetBooleanFalse): Remove. * gm2-gcc/m2options.h (M2Options_SetStatistics): Replace int with bool. gcc/testsuite/ChangeLog: PR modula2/109264 * gm2/iso/extended-opaque/pass/iso-extended-opaque-pass.exp: New test. * gm2/iso/extended-opaque/pass/stressset.def: New test. * gm2/iso/extended-opaque/pass/stressset.mod: New test. * gm2/iso/extended-opaque/pass/testset.mod: New test. * gm2/projects/iso/small/run/pass/iso-extended-opaque-run-pass.exp: New test. * gm2/projects/iso/small/run/pass/stressset.def: New test. * gm2/projects/iso/small/run/pass/stressset.mod: New test. * gm2/projects/iso/small/run/pass/test1.mod: New test. * gm2/projects/iso/small/run/pass/testlib.def: New test. * gm2/projects/iso/small/run/pass/testlib.mod: New test. * gm2/projects/iso/small/run/pass/testset.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-23Daily bump.GCC Administrator1-0/+53
2023-03-22modula2: Add cwd to include path. Include m2cor before m2pim.Gaius Mulley2-4/+13
The driver should default to include the current working directory in the module search path. This patch adds . to the search path provided -fm2-pathname has not been specified. The patch also reorders the pim libraries so that the m2cor directory is searched before m2pim. Coroutine support is visible by default for both -fpim and -fiso (from their respective SYSTEM modules). gcc/m2/ChangeLog: PR modula2/109248 * Make-lang.in (m2/pge-boot/%.o): Add CFLAGS and CXXFLAGS for C and C++ compiles. * gm2spec.cc (add_m2_I_path): Indentation. (lang_specific_driver): New variable seen_pathname. Detect -fm2-pathname. If not seen then push_back_Ipath ("."). Change non iso library path to "m2cor,m2log,m2pim,m2iso". Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-22PR modula2/107630 Remove M2LINK and remove some cross linkingGaius Mulley14-243/+71
Remove M2LINK.def. Pass the user forced module initialization string as a parameter to M2RTS.ConstructModules. This patch allows -fm2-whole-program to link successfully using dynamic libraries. gcc/m2/ChangeLog: PR modula2/107630 * Make-lang.in (m2/stage2/cc1gm2$(exeext)): Remove m2/gm2-libs-boot/M2LINK.o. (m2/stage1/cc1gm2$(exeext)): Ditto. (GM2-LIBS-BOOT-DEFS): Remove M2LINK.def. (GM2-LIBS-DEFS): Ditto. (m2/mc-boot/$(SRC_PREFIX)%.o): Replace CXX_FLAGS with CXXFLAGS. (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto. (m2/mc-boot/main.o): Ditto. (mcflex.o): Add $(CFLAGS). (m2/gm2-libs-boot/M2LINK.o): Remove rule. * gm2-compiler/M2GCCDeclare.def (DeclareM2linkGlobals): Remove. * gm2-compiler/M2GCCDeclare.mod: (M2LinkEntry): Remove. (M2LinkIndex): Remove. (DoVariableDeclaration): Remove initial and call to AddEntryM2Link. (AddEntryM2Link): Remove. (GetEntryM2Link): Remove. (DeclareM2linkGlobals): Remove. (DetectM2LinkInitial): Remove. (InitM2LinkModule): Remove. * gm2-compiler/M2GenGCC.mod (CodeFinallyEnd): Remove call to DeclareM2linkGlobals. * gm2-compiler/M2Quads.mod (BuildM2InitFunction): Add extra parameter containing runtime module override to ConstructModules. * gm2-compiler/M2Scaffold.mod: Update comment describing ConstructModules. * gm2-gcc/m2decl.cc (m2decl_DeclareM2linkForcedModuleInitOrder): Remove. * gm2-libs-iso/M2RTS.def (ConstructModules): Add overrideliborder parameter. * gm2-libs-iso/M2RTS.mod: Add overrideliborder parameter. * gm2-libs/M2Dependent.def (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2Dependent.mod (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2RTS.def (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2RTS.mod (ConstructModules): Add overrideliborder parameter. * gm2-libs/M2LINK.def: Removed. libgm2/ChangeLog: * libm2pim/Makefile.am (M2DEFS): Remove M2LINK.def. * libm2pim/Makefile.in: Rebuild. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-22Daily bump.GCC Administrator1-0/+7
2023-03-21[modula2] Add $(CXX_FLAGS) to the bootstrap tool rules.Gaius Mulley1-4/+4
The bootstrap tool mc is built using $(CXX) and it is missing $(CXXFLAGS). gcc/m2/ChangeLog: * Make-lang.in (m2/mc-boot/$(SRC_PREFIX)%.o): Add $(CXXFLAGS). (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Add $(CXXFLAGS). (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Add $(CXXFLAGS). (m2/mc-boot/main.o): Add $(CXXFLAGS). Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-20Daily bump.GCC Administrator1-0/+82
2023-03-19[modula2] target independent doc and tools rebuiltGaius Mulley38-447/+412
The target independent documentation needs to be rebuilt together with the bootstrap tools after the library changes and after the <* noreturn *> attribute has been implemented. gcc/m2/ChangeLog: * Make-maintainer.in (gm2.maintainer-clean): Remove. (gm2.maintainer-help): Add gm2.maintainer-tools, gm2.maintainer-doc. Remove gm2.maintainer-clean. Change target-independent directory to target-independent/m2. * gm2-compiler/ppg.mod: Correct __FILE_ typo to __FILE__. * gm2-compiler/M2Options.def (SetAutoInit): Update comment. * gm2-compiler/M2Options.mod (SetAutoInit): Update comment. * gm2-gcc/m2color.cc (m2color_colorize_start): Rename name_len to _name_high. * gm2-gcc/m2color.def (colorize_start): change ARRAY OF CHAR to ADDRESS and add _name_high. * gm2-gcc/m2decl.cc (m2decl_BuildStartFunctionDeclaration): Change int to bool. * gm2-gcc/m2decl.h (m2decl_BuildStartFunctionDeclaration): Change int to bool. * gm2-gcc/m2expr.cc (m2expr_BuildBinarySetDo): Change int to bool. (m2expr_BuildIfConstInVar): Change int to bool. (m2expr_BuildIfNotConstInVar): Change int to bool. (m2expr_BuildIfVarInVar): Change int to bool. (m2expr_BuildIfNotVarInVar): Change int to bool. (m2expr_BuildForeachWordInSetDoIfExpr): Change int to bool. * gm2-gcc/m2expr.h (m2expr_BuildIfNotVarInVar): Change int to bool. (m2expr_BuildIfVarInVar): Change int to bool. (m2expr_BuildIfNotConstInVar): Change int to bool. (m2expr_BuildIfConstInVar): Change int to bool. * gm2-gcc/m2options.h (M2Options_SetAutoInit): Change int to bool. (M2Options_SetNilCheck): Change int to bool. (M2Options_SetReturnCheck): Change int to bool. (M2Options_SetCaseCheck): Change int to bool. (M2Options_SetCheckAll): Change int to bool. (M2Options_SetVerboseUnbounded): Change int to bool. (M2Options_SetUnboundedByReference): Change int to bool. (M2Options_SetOptimizing): Change int to bool. (M2Options_SetQuiet): Change int to bool. (M2Options_SetCpp): Change int to bool. (M2Options_SetM2g): Change int to bool. (M2Options_SetLowerCaseKeywords): Change int to bool. (M2Options_SetVerbose): Change int to bool. * gm2-gcc/m2treelib.cc (m2treelib_get_rvalue): Change int to bool. (m2treelib_get_field_no): Change int to bool. (m2treelib_get_set_value): Change int to bool. (m2treelib_get_set_address): Change int to bool. (m2treelib_get_set_address_if_var): Change int to bool. * gm2-gcc/m2treelib.def (get_set_address_if_var): Change int to bool. (get_set_address): Change int to bool. (get_set_value): Change int to bool. (get_field_no): Change int to bool. (get_rvalue): Change int to bool. * gm2-gcc/m2treelib.h (m2treelib_get_field_no): Change int to bool. (m2treelib_get_set_value): Change int to bool. (m2treelib_get_set_address): Change int to bool. (m2treelib_get_set_address_if_var): Change int to bool. * gm2-gcc/m2type.cc (m2type_BuildEndFunctionType): Change int to bool. * gm2-gcc/m2type.h (m2type_BuildEndFunctionType): Change int to bool. * gm2-libs-ch/dtoa.cc (dtoa_calcsign): Change int to bool. * gm2-libs-ch/ldtoa.cc (dtoa_calcsign): Change int to bool. (ldtoa_ldtoa): Change int to bool. * m2.flex (functionInfo): Change int to bool. (pushFunction): Change parameter from int to bool. * mc-boot/GDebug.cc (Debug_Halt): Rebuild. * mc-boot/GDebug.h (Debug_Halt): Rebuild. * mc-boot/GDynamicStrings.cc: Rebuild. * mc-boot/GDynamicStrings.h: Rebuild. * mc-boot/GFIO.cc: Rebuild. * mc-boot/GM2RTS.cc: Rebuild. * mc-boot/GM2RTS.h: Rebuild. * mc-boot/GPushBackInput.cc: Rebuild. * mc-boot/GRTExceptions.cc: Rebuild. * mc-boot/GRTint.cc: Rebuild. * mc-boot/GSysStorage.cc: Rebuild. * mc-boot/Gdecl.cc: Rebuild. * mc-boot/GsymbolKey.cc: Rebuild. * mc/symbolKey.mod: Rebuild. * target-independent/m2/Builtins.texi: Rebuild. * target-independent/m2/SYSTEM-iso.texi: Rebuild. * target-independent/m2/SYSTEM-pim.texi: Rebuild. * target-independent/m2/gm2-libs.texi: Rebuild. * tools-src/def2doc.py (PIM_Log): Change gm2-libs-pim to gm2-lib-log. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-18Daily bump.GCC Administrator1-0/+19
2023-03-17PR modula2/109032 - message 'compiler checks to force' is too complicatedGaius Mulley2-12/+15
Correct typos and improve the descriptions of command line options. Improve comments in gm2-gcc/m2expr.cc. gcc/m2/ChangeLog: PR modula2/109032 * gm2-gcc/m2expr.cc: Correct ? : order in comments. (m2expr_BuildDivM2): Improve comment. * lang.opt: Improve option descriptions. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-17PR modula2/109102 Wrong quotes in diagnosticGaius Mulley1-1/+1
The backtick and single quote should be replaced with %< and %> or %qs. gcc/m2/ChangeLog: PR modula2/109102 * gm2-gcc/m2builtins.cc (ASSERT): Change format specifier to use %qs rather than quotes. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-17[modula2] Bugfix local symbol names for -fm2-whole-programGaius Mulley2-16/+14
Local symbols must be prefixed by the modulename if -fm2-whole-program is used to avoid a name clash. gcc/m2/ChangeLog: * gm2-compiler/M2AsmUtil.mod (SymNeedsModulePrefix): Re-implemented. * gm2-libs/SysStorage.mod (enableTrace): Disable tracing. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-17Daily bump.GCC Administrator1-0/+86
2023-03-16PR 107630 runtime libs should be self-containedGaius Mulley25-405/+194
This is a patch to improve the layering of libgm2. It removes the m2cor Debug.{def,mod} (the codebase will use m2pim Debug instead). It also layers SysStorage under both m2pim Storage and m2iso Storage. SysStorage is now a dependant of m2pim Storage.mod. Halt parameters for Debug.mod and M2RTS.mod now have the same order. gcc/m2/ChangeLog: * gm2-compiler/SymbolKey.mod (PutSymKey): Halt parameters reordered. (DelSymKey): Ditto. * gm2-compiler/ppg.mod (GetEpsilon): Ditto. (GetReachEnd): Ditto. (GetFollow): Ditto. (CodeCondition): Ditto. (CodeThenDo): Ditto. (CodeEnd): Ditto. (RecoverCondition): Ditto. (ConditionIndent): Ditto. * gm2-libs-ch/m2rts.h (M2RTS_Halt): Ditto. * gm2-libs-coroutines/Executive.mod (Assert): Ditto. (Resume): Remove redundant comments. (Wait): Remove redundant comments. * gm2-libs-coroutines/SYSTEM.mod (TRANSFER): Halt parameters reordered. (IOTransferHandler): Ditto. (Finished): Ditto. (localInit): Ditto. * gm2-libs-coroutines/TimerHandler.mod (WaitOn): Halt parameters reordered. (Cancel): Ditto. (ReArmEvent): Ditto. (OnActiveQueue): Ditto. * gm2-libs-iso/COROUTINES.mod (NEWCOROUTINE): Ditto. (Transfer): Ditto. (IOTRANSFER): Ditto. * gm2-libs-iso/EXCEPTIONS.mod (RAISE): Correct Halt parameters. * gm2-libs-iso/M2RTS.def (Halt): Halt parameters reordered. (HaltC): Ditto. * gm2-libs-iso/M2RTS.mod: Ditto. * gm2-libs-iso/RTentity.mod (PutKey): Ditto. (DelKey): Ditto. (findChildAndParent): Ditto. (assert): Ditto. * gm2-libs-iso/Storage.mod (ALLOCATE): Add DebugTrace. Add UseMallocFree test. (DEALLOCATE): Add DebugTrace. Add UseMallocFree test. (assert): Halt parameters reordered. * gm2-libs-log/Termbase.mod (Read): Ditto. (KeyPressed): Ditto. (Write): Ditto. (Init): Ditto. * gm2-libs/Debug.def (Halt): Halt parameters reordered. * gm2-libs/Debug.mod (Halt): Ditto. * gm2-libs/DynamicStrings.def (PopAllocation): Improve comment. * gm2-libs/DynamicStrings.mod (PopAllocation): Improve comment. Halt parameters reordered. * gm2-libs/M2RTS.def (Halt): Ditto. (HaltC): Ditto. * gm2-libs/M2RTS.mod (Halt): Ditto. (HaltC): Ditto. * gm2-libs/PushBackInput.mod (PutStr): Ditto. (PutString): Ditto. (PutCh): Ditto. * gm2-libs/RTExceptions.mod (GetBaseExceptionBlock): Ditto. * gm2-libs/RTint.mod (ReArmTimeVector): Ditto. (GetTimeVector): Ditto. (AttachVector): Ditto. (IncludeVector): Ditto. (Listen): Ditto. * gm2-libs/SysStorage.mod (ALLOCATE): Ditto. (DEALLOCATE): Ditto. (REALLOCATE): Ditto. * gm2-libs-coroutines/Debug.def: Removed. * gm2-libs-coroutines/Debug.mod: Removed. libgm2/ChangeLog: * libm2cor/Makefile.am: Remove * libm2cor/Makefile.in: Rebuild. * libm2iso/RTco.cc (newSem): Halt parameters reordered. (currentThread): Ditto. (never): Ditto. (defined): Ditto. (initThread): Ditto. * libm2iso/m2rts.h (m2iso_M2RTS_HaltC): Ditto. gcc/testsuite/ChangeLog: * gm2/complex/pass/arith3.mod: Halt parameters reordered. * gm2/complex/run/pass/arith3.mod: Ditto. * gm2/complex/run/pass/arith4.mod: Ditto. * gm2/complex/run/pass/arith5.mod: Ditto. * gm2/isolib/run/pass/real2.mod: Ditto. * gm2/isolib/run/pass/real3.mod: Ditto. * gm2/isolib/run/pass/realconv.mod: Ditto. * gm2/isolib/run/pass/realconv2.mod: Ditto. * gm2/pim/pass/testshort.mod: Ditto. * gm2/projects/pim/run/pass/tower/AdvSystem.mod: Ditto. * gm2/projects/pim/run/pass/tower/DrawL.mod: Ditto. * gm2/warnings/returntype/pass/Termbase.mod: Ditto. * gm2/warnings/returntype/pass/keypressedsimple.mod: Ditto. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-16Move target independent documentation files into subdirGaius Mulley8-10/+1590
Move target independent documentation files into a subdir m2 so that the maintainer-scripts/update_web_docs_git can build gm2.texi from the source tree (and without any build dir). gcc/m2/ChangeLog: * Make-lang.in: Rename target-independent to target-independent/m2. * target-independent/readme.txt: Update. * target-independent/m2/gm2-ebnf.texi: New file. * target-independent/m2/gpl_v3_without_node.texi: New file. * target-independent/Builtins.texi: Rename ... * target-independent/m2/Builtins.texi: ... to this. * target-independent/SYSTEM-iso.texi: Rename ... * target-independent/m2/SYSTEM-iso.texi: ... to this. * target-independent/SYSTEM-pim.texi: Rename ... * target-independent/m2/SYSTEM-pim.texi: ... to this. * target-independent/gm2-libs.texi: Rename ... * target-independent/m2/gm2-libs.texi: ... to this. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-16Daily bump.GCC Administrator1-0/+6
2023-03-15PR 109125 13 regression SIGBUS in m2pim_ldtoa_ldtoaGaius Mulley2-4/+4
This patch fixes more bool int parameter mismatches found in dtoa and ldtoa. gcc/m2/ChangeLog: PR modula2/109125 * gm2-libs-ch/dtoa.cc (dtoa_strtod): Replace int with bool. * gm2-libs-ch/ldtoa.cc (ldtoa_strtold): Replace int with bool. libgm2/ChangeLog: PR modula2/109125 * libm2pim/dtoa.cc (TRUE): Remove. (FALSE): Remove. Replace int with bool. * libm2pim/ldtoa.cc (TRUE): Remove. (FALSE): Remove. Replace int with bool. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-15Daily bump.GCC Administrator1-0/+9
2023-03-14PR 109125 Modula2 SIGBUS in m2pim_ldtoa_ldtoaGaius Mulley3-380/+382
13 regression failures seen on sparc SIGBUS in m2pim_ldtoa_ldtoa. This patch fixes int bool parameter mismatches between the definition modules and their C/C++ implementations. gcc/m2/ChangeLog: PR modula2/109125 * gm2-libs-ch/cgetopt.c (cgetopt_SetOption): Replace int for bool. * gm2-libs-ch/termios.c (doSetUnset): Replace int for bool. * gm2-libs/Builtins.mod (isfinitef): Correct typo in return statement. libgm2/ChangeLog: PR modula2/109125 * libm2iso/ErrnoCategory.cc (FALSE): Remove. (TRUE): Remove. * libm2iso/wrapsock.c (TRUE): Remove. (FALSE): Remove. * libm2iso/wraptime.cc (TRUE): Remove. (FALSE): Remove. * libm2pim/cgetopt.cc: Replace int for bool for every BOOLEAN parameter in the definition module. * libm2pim/dtoa.cc: Ditto. * libm2pim/ldtoa.cc: Ditto. * libm2pim/termios.cc: Ditto. (doSetUnset): Replace int for bool. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-14Daily bump.GCC Administrator1-0/+109
2023-03-13PR 109103 Modula2 Missing function internal_error_atGaius Mulley13-130/+279
m2expr.cc should call to internal_error_at, but that function does not exist yet. For symmetry with the other error reporting functions, it should be added. This patch provides this function and also corrects obvious bool/int parameter mismatches in m2options.h and m2expr.h. gcc/m2/ChangeLog: PR modula2/109103 * gm2-compiler/M2ALU.def (PushString): New parameter issueError. * gm2-compiler/M2ALU.mod (PushString): New parameter issueError. * gm2-compiler/SymbolTable.mod (PushString): New parameter issueError. * gm2-gcc/m2decl.cc (m2decl_DetermineSizeOfConstant): Pass location to interpret_m2_integer. (m2decl_BuildConstLiteralNumber): New parameter issueError. * gm2-gcc/m2expr.cc (m2expr_IsTrue): Replace int with bool. (m2expr_IsFalse): Replace int with bool. (m2expr_AreConstantsEqual): Replace int with bool. (m2expr_BuildBinaryForeachWordDo): Call m2linemap_internal_error_at. (append_digit): Ditto. (m2expr_interpret_integer): Add location parameter. (append_m2_digit): Call m2linemap_internal_error_at. (m2expr_interpret_m2_integer): Add location parameter. (m2expr_GetSizeOf): Replace sizeof with SIZE in error message. * gm2-gcc/m2expr.h (m2expr_AreRealOrComplexConstantsEqual): Replace int with bool. (m2expr_AreConstantsEqual): Ditto. (m2expr_IsFalse): Ditto. (m2expr_IsTrue): Ditto. (m2expr_interpret_integer): Add location parameter. (m2expr_interpret_m2_integer): Add location parameter. * gm2-gcc/m2linemap.cc (mformat_value): New function. (expand_format): New function. (expand_message): New function. (gm2_internal_error_at): New function. (m2linemap_internal_error_at): New function. * gm2-gcc/m2linemap.h (m2linemap_internal_error_at): New function. * gm2-gcc/m2options.h (M2Options_SetISO): Replace int with bool. (M2Options_SetPIM): Ditto. (M2Options_SetPIM2): Ditto. (M2Options_SetPIM3): Ditto. (M2Options_SetPIM4): Ditto. (M2Options_SetFloatValueCheck): Ditto. (M2Options_SetWholeValueCheck): Ditto. (M2Options_GetISO): Ditto. (M2Options_GetPIM): Ditto. (M2Options_GetPIM2): Ditto. (M2Options_GetPIM3): Ditto. (M2Options_GetPIM4): Ditto. (M2Options_GetPositiveModFloor): Ditto. (M2Options_GetFloatValueCheck): Ditto. (M2Options_GetWholeValueCheck): Ditto. (M2Options_Setc): Ditto. (M2Options_Getc): Ditto. (M2Options_SetPPOnly): Ditto. (M2Options_GetPPOnly): Ditto. (M2Options_SetUselist): Ditto. (M2Options_SetAutoInit): Ditto. (M2Options_SetPositiveModFloor): Ditto. (M2Options_SetNilCheck): Ditto. (M2Options_SetWholeDiv): Ditto. (M2Options_SetIndex): Ditto. (M2Options_SetRange): Ditto. (M2Options_SetReturnCheck): Ditto. (M2Options_SetCaseCheck): Ditto. (M2Options_SetCheckAll): Ditto. (M2Options_SetExceptions): Ditto. (M2Options_SetStyle): Ditto. (M2Options_SetPedantic): Ditto. (M2Options_SetPedanticParamNames): Ditto. (M2Options_SetPedanticCast): Ditto. (M2Options_SetExtendedOpaque): Ditto. (M2Options_SetVerboseUnbounded): Ditto. (M2Options_SetXCode): Ditto. (M2Options_SetCompilerDebugging): Ditto. (M2Options_SetQuadDebugging): Ditto. (M2Options_SetDebugTraceQuad): Ditto. (M2Options_SetDebugTraceAPI): Ditto. (M2Options_SetSources): Ditto. (M2Options_SetUnboundedByReference): Ditto. (M2Options_SetDumpSystemExports): Ditto. (M2Options_SetOptimizing): Ditto. (M2Options_SetQuiet): Ditto. (M2Options_SetCC1Quiet): Ditto. (M2Options_SetCpp): Ditto. (M2Options_SetSwig): Ditto. (M2Options_SetWholeProgram): Ditto. (M2Options_SetDebugFunctionLineNumbers): Ditto. (M2Options_SetGenerateStatementNote): Ditto. (M2Options_GetCpp): Ditto. (M2Options_GetM2g): Ditto. (M2Options_SetM2g): Ditto. (M2Options_SetLowerCaseKeywords): Ditto. (M2Options_SetVerbose): Ditto. (M2Options_SetUnusedVariableChecking): Ditto. (M2Options_SetUnusedParameterChecking): Ditto. (M2Options_SetStrictTypeChecking): Ditto. (M2Options_SetWall): Ditto. (M2Options_SetSaveTemps): Ditto. (M2Options_GetSaveTemps): Ditto. (M2Options_SetScaffoldStatic): Ditto. (M2Options_SetScaffoldDynamic): Ditto. (M2Options_SetScaffoldMain): Ditto. (M2Options_SetGenModuleList): Ditto. (M2Options_SetShared): Ditto. * gm2-libs-ch/M2LINK.c: Ditto. * gm2-libs-ch/m2rts.h (M2RTS_RequestDependant): Replace const char * with const void *. (M2RTS_RegisterModule): Ditto. (M2RTS_ConstructModules): Ditto. * gm2-gcc/m2decl.def (DetermineSizeOfConstant): New parameter issueError. * gm2-gcc/m2decl.h (DetermineSizeOfConstant): New parameter issueError. gcc/testsuite/ChangeLog: * gm2/pim/fail/largeconst.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-13Daily bump.GCC Administrator1-0/+183
2023-03-12[PR modula2/109089] implementation of boolean should be C++/C boolGaius Mulley165-2365/+2664
[PR modula2/109089]. This patch implements BOOLEAN using bool (boolean_type_node) thoughout cc1gm2. The patch also includes a patched version of the bootstrap tool mc. gcc/ChangeLog: * doc/gm2.texi (Elementary data types): Equivalence BOOLEAN with bool. gcc/m2/ChangeLog: PR modula2/109089 * gm2-compiler/M2GCCDeclare.mod (DeclareKnownType): Import. * gm2-gcc/gcc-consolidation.h (stdbool.h): Include. * gm2-gcc/init.h (defined): Change block start. * gm2-gcc/m2block.cc: Change FALSE to false, change TRUE to true. * gm2-gcc/m2block.h: Change int to bool. * gm2-gcc/m2builtins.cc: Ditto. * gm2-gcc/m2builtins.h: Ditto. * gm2-gcc/m2convert.cc: Change FALSE to false, TRUE to true and int to bool. * gm2-gcc/m2convert.h: Change int to bool. * gm2-gcc/m2decl.cc: Change int to bool. * gm2-gcc/m2decl.h: Change int to bool. * gm2-gcc/m2expr.cc: Change FALSE to false, TRUE to true and int to bool. * gm2-gcc/m2expr.h: Change int to bool. * gm2-gcc/m2statement.cc: Change FALSE to false, TRUE to true and int to bool. * gm2-gcc/m2statement.h: Change int to bool. * gm2-gcc/m2top.cc: Change int to bool. * gm2-gcc/m2top.h: Change int to bool. * gm2-gcc/m2tree.cc: Change int to bool. * gm2-gcc/m2tree.h: Change int to bool. * gm2-gcc/m2type.cc: Change int to bool. * gm2-gcc/m2type.h: Change int to bool. * gm2-lang.cc (convert_loc): Call convert_to_integer for BOOLEAN_TYPE. * gm2-libs/Builtins.def (isfinitef): Change return value from BOOLEAN to INTEGER. (isfinite): Ditto. (isfinitel): Ditto. * gm2-libs/Builtins.mod (isfinitef): Change return value from BOOLEAN to INTEGER. (isfinite): Ditto. (isfinitel): Ditto. * mc-boot/GASCII.cc: Rebuild. * mc-boot/GASCII.h: Rebuild. * mc-boot/GArgs.cc: Rebuild. * mc-boot/GArgs.h: Rebuild. * mc-boot/GAssertion.cc: Rebuild. * mc-boot/GAssertion.h: Rebuild. * mc-boot/GBreak.cc: Rebuild. * mc-boot/GBreak.h: Rebuild. * mc-boot/GCOROUTINES.h: Rebuild. * mc-boot/GCmdArgs.cc: Rebuild. * mc-boot/GCmdArgs.h: Rebuild. * mc-boot/GDebug.cc: Rebuild. * mc-boot/GDebug.h: Rebuild. * mc-boot/GDynamicStrings.cc: Rebuild. * mc-boot/GDynamicStrings.h: Rebuild. * mc-boot/GEnvironment.cc: Rebuild. * mc-boot/GEnvironment.h: Rebuild. * mc-boot/GFIO.cc: Rebuild. * mc-boot/GFIO.h: Rebuild. * mc-boot/GFormatStrings.cc: Rebuild. * mc-boot/GFormatStrings.h: Rebuild. * mc-boot/GFpuIO.cc: Rebuild. * mc-boot/GFpuIO.h: Rebuild. * mc-boot/GIO.cc: Rebuild. * mc-boot/GIO.h: Rebuild. * mc-boot/GIndexing.cc: Rebuild. * mc-boot/GIndexing.h: Rebuild. * mc-boot/GM2Dependent.cc: Rebuild. * mc-boot/GM2Dependent.h: Rebuild. * mc-boot/GM2EXCEPTION.cc: Rebuild. * mc-boot/GM2EXCEPTION.h: Rebuild. * mc-boot/GM2LINK.h: Rebuild. * mc-boot/GM2RTS.cc: Rebuild. * mc-boot/GM2RTS.h: Rebuild. * mc-boot/GMemUtils.cc: Rebuild. * mc-boot/GMemUtils.h: Rebuild. * mc-boot/GNumberIO.cc: Rebuild. * mc-boot/GNumberIO.h: Rebuild. * mc-boot/GPushBackInput.cc: Rebuild. * mc-boot/GPushBackInput.h: Rebuild. * mc-boot/GRTExceptions.cc: Rebuild. * mc-boot/GRTExceptions.h: Rebuild. * mc-boot/GRTco.h: Rebuild. * mc-boot/GRTentity.h: Rebuild. * mc-boot/GRTint.cc: Rebuild. * mc-boot/GRTint.h: Rebuild. * mc-boot/GSArgs.cc: Rebuild. * mc-boot/GSArgs.h: Rebuild. * mc-boot/GSFIO.cc: Rebuild. * mc-boot/GSFIO.h: Rebuild. * mc-boot/GSYSTEM.h: Rebuild. * mc-boot/GSelective.h: Rebuild. * mc-boot/GStdIO.cc: Rebuild. * mc-boot/GStdIO.h: Rebuild. * mc-boot/GStorage.cc: Rebuild. * mc-boot/GStorage.h: Rebuild. * mc-boot/GStrCase.cc: Rebuild. * mc-boot/GStrCase.h: Rebuild. * mc-boot/GStrIO.cc: Rebuild. * mc-boot/GStrIO.h: Rebuild. * mc-boot/GStrLib.cc: Rebuild. * mc-boot/GStrLib.h: Rebuild. * mc-boot/GStringConvert.cc: Rebuild. * mc-boot/GStringConvert.h: Rebuild. * mc-boot/GSysExceptions.h: Rebuild. * mc-boot/GSysStorage.cc: Rebuild. * mc-boot/GSysStorage.h: Rebuild. * mc-boot/GTimeString.cc: Rebuild. * mc-boot/GTimeString.h: Rebuild. * mc-boot/GUnixArgs.h: Rebuild. * mc-boot/Galists.cc: Rebuild. * mc-boot/Galists.h: Rebuild. * mc-boot/Gdecl.cc: Rebuild. * mc-boot/Gdecl.h: Rebuild. * mc-boot/Gdtoa.h: Rebuild. * mc-boot/Gerrno.h: Rebuild. * mc-boot/Gkeyc.cc: Rebuild. * mc-boot/Gkeyc.h: Rebuild. * mc-boot/Gldtoa.h: Rebuild. * mc-boot/Glibc.h: Rebuild. * mc-boot/Glibm.h: Rebuild. * mc-boot/Glists.cc: Rebuild. * mc-boot/Glists.h: Rebuild. * mc-boot/GmcComment.cc: Rebuild. * mc-boot/GmcComment.h: Rebuild. * mc-boot/GmcComp.cc: Rebuild. * mc-boot/GmcComp.h: Rebuild. * mc-boot/GmcDebug.cc: Rebuild. * mc-boot/GmcDebug.h: Rebuild. * mc-boot/GmcError.cc: Rebuild. * mc-boot/GmcError.h: Rebuild. * mc-boot/GmcFileName.cc: Rebuild. * mc-boot/GmcFileName.h: Rebuild. * mc-boot/GmcLexBuf.cc: Rebuild. * mc-boot/GmcLexBuf.h: Rebuild. * mc-boot/GmcMetaError.cc: Rebuild. * mc-boot/GmcMetaError.h: Rebuild. * mc-boot/GmcOptions.cc: Rebuild. * mc-boot/GmcOptions.h: Rebuild. * mc-boot/GmcPreprocess.cc: Rebuild. * mc-boot/GmcPreprocess.h: Rebuild. * mc-boot/GmcPretty.cc: Rebuild. * mc-boot/GmcPretty.h: Rebuild. * mc-boot/GmcPrintf.cc: Rebuild. * mc-boot/GmcPrintf.h: Rebuild. * mc-boot/GmcQuiet.cc: Rebuild. * mc-boot/GmcQuiet.h: Rebuild. * mc-boot/GmcReserved.cc: Rebuild. * mc-boot/GmcReserved.h: Rebuild. * mc-boot/GmcSearch.cc: Rebuild. * mc-boot/GmcSearch.h: Rebuild. * mc-boot/GmcStack.cc: Rebuild. * mc-boot/GmcStack.h: Rebuild. * mc-boot/GmcStream.cc: Rebuild. * mc-boot/GmcStream.h: Rebuild. * mc-boot/Gmcflex.h: Rebuild. * mc-boot/Gmcp1.cc: Rebuild. * mc-boot/Gmcp1.h: Rebuild. * mc-boot/Gmcp2.cc: Rebuild. * mc-boot/Gmcp2.h: Rebuild. * mc-boot/Gmcp3.cc: Rebuild. * mc-boot/Gmcp3.h: Rebuild. * mc-boot/Gmcp4.cc: Rebuild. * mc-boot/Gmcp4.h: Rebuild. * mc-boot/Gmcp5.cc: Rebuild. * mc-boot/Gmcp5.h: Rebuild. * mc-boot/GnameKey.cc: Rebuild. * mc-boot/GnameKey.h: Rebuild. * mc-boot/GsymbolKey.cc: Rebuild. * mc-boot/GsymbolKey.h: Rebuild. * mc-boot/Gtermios.h: Rebuild. * mc-boot/Gtop.cc: Rebuild. * mc-boot/Gvarargs.cc: Rebuild. * mc-boot/Gvarargs.h: Rebuild. * mc-boot/Gwlists.cc: Rebuild. * mc-boot/Gwlists.h: Rebuild. * mc-boot/Gwrapc.h: Rebuild. * mc/decl.mod (doBoolC): New procedure. (doBaseC): Call doBoolC. * mc/keyc.mod: Import useBool. (genBool): New procedure. (genDefs): Call genBool. * mc/mcOptions.def (useBool): New procedure. * mc/mcOptions.mod (useBool): New procedure. (useBoolType): New variable. (optionIs): Assign useBoolType to TRUE. gcc/testsuite/ChangeLog: PR modula2/109089 * gm2/pimlib/run/pass/limittests.mod: Rewritten to reflect the external definitions of isfinite. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-05Daily bump.GCC Administrator1-0/+254
2023-03-04Fix modula-2 rename autogenerated .c files to .ccGaius Mulley110-0/+125948
This patch adds the replacement .cc files for the autogenerated tools. gcc/m2/ChangeLog: * mc-boot-ch/GBuiltins.cc: New file. * mc-boot-ch/Gdtoa.cc: New file. * mc-boot-ch/Gerrno.cc: New file. * mc-boot-ch/Gldtoa.cc: New file. * mc-boot-ch/Gm2rtsdummy.cc: New file. * mc-boot/GASCII.cc: New file. * mc-boot/GArgs.cc: New file. * mc-boot/GAssertion.cc: New file. * mc-boot/GBreak.cc: New file. * mc-boot/GCmdArgs.cc: New file. * mc-boot/GDebug.cc: New file. * mc-boot/GDynamicStrings.cc: New file. * mc-boot/GEnvironment.cc: New file. * mc-boot/GFIO.cc: New file. * mc-boot/GFormatStrings.cc: New file. * mc-boot/GFpuIO.cc: New file. * mc-boot/GIO.cc: New file. * mc-boot/GIndexing.cc: New file. * mc-boot/GM2Dependent.cc: New file. * mc-boot/GM2EXCEPTION.cc: New file. * mc-boot/GM2RTS.cc: New file. * mc-boot/GMemUtils.cc: New file. * mc-boot/GNumberIO.cc: New file. * mc-boot/GPushBackInput.cc: New file. * mc-boot/GRTExceptions.cc: New file. * mc-boot/GRTint.cc: New file. * mc-boot/GSArgs.cc: New file. * mc-boot/GSFIO.cc: New file. * mc-boot/GStdIO.cc: New file. * mc-boot/GStorage.cc: New file. * mc-boot/GStrCase.cc: New file. * mc-boot/GStrIO.cc: New file. * mc-boot/GStrLib.cc: New file. * mc-boot/GStringConvert.cc: New file. * mc-boot/GSysStorage.cc: New file. * mc-boot/GTimeString.cc: New file. * mc-boot/Galists.cc: New file. * mc-boot/Gdecl.cc: New file. * mc-boot/Gkeyc.cc: New file. * mc-boot/Glists.cc: New file. * mc-boot/GmcComment.cc: New file. * mc-boot/GmcComp.cc: New file. * mc-boot/GmcDebug.cc: New file. * mc-boot/GmcError.cc: New file. * mc-boot/GmcFileName.cc: New file. * mc-boot/GmcLexBuf.cc: New file. * mc-boot/GmcMetaError.cc: New file. * mc-boot/GmcOptions.cc: New file. * mc-boot/GmcPreprocess.cc: New file. * mc-boot/GmcPretty.cc: New file. * mc-boot/GmcPrintf.cc: New file. * mc-boot/GmcQuiet.cc: New file. * mc-boot/GmcReserved.cc: New file. * mc-boot/GmcSearch.cc: New file. * mc-boot/GmcStack.cc: New file. * mc-boot/GmcStream.cc: New file. * mc-boot/Gmcp1.cc: New file. * mc-boot/Gmcp2.cc: New file. * mc-boot/Gmcp3.cc: New file. * mc-boot/Gmcp4.cc: New file. * mc-boot/Gmcp5.cc: New file. * mc-boot/GnameKey.cc: New file. * mc-boot/GsymbolKey.cc: New file. * mc-boot/Gtop.cc: New file. * mc-boot/Gvarargs.cc: New file. * mc-boot/Gwlists.cc: New file. * pge-boot/GASCII.cc: New file. * pge-boot/GArgs.cc: New file. * pge-boot/GAssertion.cc: New file. * pge-boot/GBuiltins.cc: New file. * pge-boot/GDebug.cc: New file. * pge-boot/GDynamicStrings.cc: New file. * pge-boot/GFIO.cc: New file. * pge-boot/GIO.cc: New file. * pge-boot/GIndexing.cc: New file. * pge-boot/GLists.cc: New file. * pge-boot/GM2Dependent.cc: New file. * pge-boot/GM2EXCEPTION.cc: New file. * pge-boot/GM2LINK.cc: New file. * pge-boot/GM2RTS.cc: New file. * pge-boot/GNameKey.cc: New file. * pge-boot/GNumberIO.cc: New file. * pge-boot/GOutput.cc: New file. * pge-boot/GPushBackInput.cc: New file. * pge-boot/GRTExceptions.cc: New file. * pge-boot/GRTco.cc: New file. * pge-boot/GSFIO.cc: New file. * pge-boot/GSYSTEM.cc: New file. * pge-boot/GSelective.cc: New file. * pge-boot/GStdIO.cc: New file. * pge-boot/GStorage.cc: New file. * pge-boot/GStrCase.cc: New file. * pge-boot/GStrIO.cc: New file. * pge-boot/GStrLib.cc: New file. * pge-boot/GSymbolKey.cc: New file. * pge-boot/GSysExceptions.cc: New file. * pge-boot/GSysStorage.cc: New file. * pge-boot/Gabort.cc: New file. * pge-boot/Gbnflex.cc: New file. * pge-boot/Gcbuiltin.cc: New file. * pge-boot/Gdtoa.cc: New file. * pge-boot/Gerrno.cc: New file. * pge-boot/Gldtoa.cc: New file. * pge-boot/Glibc.cc: New file. * pge-boot/Glibm.cc: New file. * pge-boot/Gmcrts.cc: New file. * pge-boot/Gpge.cc: New file. * pge-boot/Gwrapc.cc: New file. * pge-boot/main.cc: New file. * pge-boot/network.cc: New file. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-04Modula-2 rename autogenerated .c files to .ccGaius Mulley114-126074/+63
This patch renames all the pge-boot/*.c files to .cc. It also renames the m2/mc-boot/*.c files to .cc. Finally it renames some of the mc-boot-ch hand built interface files to .cc. gcc/m2/ChangeLog: * Make-lang.in (MC-LIB-BOOT-C): Rename to MC-LIB-BOOT-CC. (MC-BOOT-C): Rename to MC-BOOT-CC. (BUILD-MC-BOOT-C): Rename to BUILD-MC-BOOT-CC. (BUILD-MC-BOOT-AUTO-C): Rename to BUILD-MC-BOOT-AUTO-CC. (m2/mc-boot/$(SRC_PREFIX)%.o): Change source file extension to .cc. (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto. * Make-maintainer.in (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): Change source file extension to .cc. (m2/gm2-ppg-boot/main.o): Ditto. (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): Ditto. to .cc. (m2/gm2-pg-boot/main.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)ldtoa.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)dtoa.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)errno.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)pge.o): Ditto. (m2/gm2-pge-boot/main.o): Ditto. (mc-push): Ditto. (mc-clean): Ditto. (mc-stage2): Ditto. ((objdir)/m2/mc-boot-gen): Ditto. (m2/mc-boot-gen/$(SRC_PREFIX)decl.c): Ditto. (m2/mc-boot-gen/$(SRC_PREFIX)%.c): Ditto. * mc-boot-ch/GBuiltins.c: Correct comment and rename. * mc-boot-ch/Gdtoa.c: Correct comment and rename. * mc-boot-ch/Gldtoa.c: Correct comment and rename * mc-boot-ch/Gtermios.cc: Rename from Gtermios.c. * mc-boot-ch/Gerrno.c: Rename. * mc-boot-ch/GRTco.c: Removed. * mc-boot/GASCII.c: Rename to mc-boot/GASCII.cc. * mc-boot/GArgs.c: Rename to mc-boot/GArgs.cc. * mc-boot/GAssertion.c: Rename to mc-boot/GAssertion.cc. * mc-boot/GBreak.c: Rename to mc-boot/GBreak.cc. * mc-boot/GCmdArgs.c: Rename to mc-boot/GCmdArgs.cc. * mc-boot/GDebug.c: Rename to mc-boot/GDebug.cc. * mc-boot/GDynamicStrings.c: Rename to mc-boot/GDynamicStrings.cc. * mc-boot/GEnvironment.c: Rename to mc-boot/GEnvironment.cc. * mc-boot/GFIO.c: Rename to mc-boot/GFIO.cc. * mc-boot/GFormatStrings.c: Rename to mc-boot/GFormatStrings.cc. * mc-boot/GFpuIO.c: Rename to mc-boot/GFpuIO.cc. * mc-boot/GIO.c: Rename to mc-boot/GIO.cc. * mc-boot/GIndexing.c: Rename to mc-boot/GIndexing.cc. * mc-boot/GM2Dependent.c: Rename to mc-boot/GM2Dependent.cc. * mc-boot/GM2EXCEPTION.c: Rename to mc-boot/GM2EXCEPTION.cc. * mc-boot/GM2RTS.c: Rename to mc-boot/GM2RTS.cc. * mc-boot/GMemUtils.c: Rename to mc-boot/GMemUtils.cc. * mc-boot/GNumberIO.c: Rename to mc-boot/GNumberIO.cc. * mc-boot/GPushBackInput.c: Rename to mc-boot/GPushBackInput.cc. * mc-boot/GRTExceptions.c: Rename to mc-boot/GRTExceptions.cc. * mc-boot/GRTint.c: Rename to mc-boot/GRTint.cc. * mc-boot/GSArgs.c: Rename to mc-boot/GSArgs.cc. * mc-boot/GSFIO.c: Rename to mc-boot/GSFIO.cc. * mc-boot/GStdIO.c: Rename to mc-boot/GStdIO.cc. * mc-boot/GStorage.c: Rename to mc-boot/GStorage.cc. * mc-boot/GStrCase.c: Rename to mc-boot/GStrCase.cc. * mc-boot/GStrIO.c: Rename to mc-boot/GStrIO.cc. * mc-boot/GStrLib.c: Rename to mc-boot/GStrLib.cc. * mc-boot/GStringConvert.c: Rename to mc-boot/GStringConvert.cc. * mc-boot/GSysStorage.c: Rename to mc-boot/GSysStorage.cc. * mc-boot/GTimeString.c: Rename to mc-boot/GTimeString.cc. * mc-boot/Galists.c: Rename to mc-boot/Galists.cc. * mc-boot/Gdecl.c: Rename to mc-boot/Gdecl.cc. * mc-boot/Gkeyc.c: Rename to mc-boot/Gkeyc.cc. * mc-boot/Glists.c: Rename to mc-boot/Glists.cc. * mc-boot/GmcComment.c: Rename to mc-boot/GmcComment.cc. * mc-boot/GmcComp.c: Rename to mc-boot/GmcComp.cc. * mc-boot/GmcDebug.c: Rename to mc-boot/GmcDebug.cc. * mc-boot/GmcError.c: Rename to mc-boot/GmcError.cc. * mc-boot/GmcFileName.c: Rename to mc-boot/GmcFileName.cc. * mc-boot/GmcLexBuf.c: Rename to mc-boot/GmcLexBuf.cc. * mc-boot/GmcMetaError.c: Rename to mc-boot/GmcMetaError.cc. * mc-boot/GmcOptions.c: Rename to mc-boot/GmcOptions.cc. * mc-boot/GmcPreprocess.c: Rename to mc-boot/GmcPreprocess.cc. * mc-boot/GmcPretty.c: Rename to mc-boot/GmcPretty.cc. * mc-boot/GmcPrintf.c: Rename to mc-boot/GmcPrintf.cc. * mc-boot/GmcQuiet.c: Rename to mc-boot/GmcQuiet.cc. * mc-boot/GmcReserved.c: Rename to mc-boot/GmcReserved.cc. * mc-boot/GmcSearch.c: Rename to mc-boot/GmcSearch.cc. * mc-boot/GmcStack.c: Rename to mc-boot/GmcStack.cc. * mc-boot/GmcStream.c: Rename to mc-boot/GmcStream.cc. * mc-boot/Gmcp1.c: Rename to mc-boot/Gmcp1.cc. * mc-boot/Gmcp2.c: Rename to mc-boot/Gmcp2.cc. * mc-boot/Gmcp3.c: Rename to mc-boot/Gmcp3.cc. * mc-boot/Gmcp4.c: Rename to mc-boot/Gmcp4.cc. * mc-boot/Gmcp5.c: Rename to mc-boot/Gmcp5.cc. * mc-boot/GnameKey.c: Rename to mc-boot/GnameKey.cc. * mc-boot/GsymbolKey.c: Rename to mc-boot/GsymbolKey.cc. * mc-boot/Gtop.c: Rename to mc-boot/Gtop.cc. * mc-boot/Gvarargs.c: Rename to mc-boot/Gvarargs.cc. * mc-boot/Gwlists.c: Rename to mc-boot/Gwlists.cc. * pge-boot/GASCII.c: Rename to pge-boot/GASCII.cc. * pge-boot/GArgs.c: Rename to pge-boot/GArgs.cc. * pge-boot/GAssertion.c: Rename to pge-boot/GAssertion.cc. * pge-boot/GBuiltins.c: Rename to pge-boot/GBuiltins.cc. * pge-boot/GDebug.c: Rename to pge-boot/GDebug.cc. * pge-boot/GDynamicStrings.c: Rename to pge-boot/GDynamicStrings.cc. * pge-boot/GFIO.c: Rename to pge-boot/GFIO.cc. * pge-boot/GIO.c: Rename to pge-boot/GIO.cc. * pge-boot/GIndexing.c: Rename to pge-boot/GIndexing.cc. * pge-boot/GLists.c: Rename to pge-boot/GLists.cc. * pge-boot/GM2Dependent.c: Rename to pge-boot/GM2Dependent.cc. * pge-boot/GM2EXCEPTION.c: Rename to pge-boot/GM2EXCEPTION.cc. * pge-boot/GM2LINK.c: Rename to pge-boot/GM2LINK.cc. * pge-boot/GM2RTS.c: Rename to pge-boot/GM2RTS.cc. * pge-boot/GNameKey.c: Rename to pge-boot/GNameKey.cc. * pge-boot/GNumberIO.c: Rename to pge-boot/GNumberIO.cc. * pge-boot/GOutput.c: Rename to pge-boot/GOutput.cc. * pge-boot/GPushBackInput.c: Rename to pge-boot/GPushBackInput.cc. * pge-boot/GRTExceptions.c: Rename to pge-boot/GRTExceptions.cc. * pge-boot/GRTco.c: Rename to pge-boot/GRTco.cc. * pge-boot/GSFIO.c: Rename to pge-boot/GSFIO.cc. * pge-boot/GSYSTEM.c: Rename to pge-boot/GSYSTEM.cc. * pge-boot/GSelective.c: Rename to pge-boot/GSelective.cc. * pge-boot/GStdIO.c: Rename to pge-boot/GStdIO.cc. * pge-boot/GStorage.c: Rename to pge-boot/GStorage.cc. * pge-boot/GStrCase.c: Rename to pge-boot/GStrCase.cc. * pge-boot/GStrIO.c: Rename to pge-boot/GStrIO.cc. * pge-boot/GStrLib.c: Rename to pge-boot/GStrLib.cc. * pge-boot/GSymbolKey.c: Rename to pge-boot/GSymbolKey.cc. * pge-boot/GSysExceptions.c: Rename to pge-boot/GSysExceptions.cc. * pge-boot/GSysStorage.c: Rename to pge-boot/GSysStorage.cc. * pge-boot/Gabort.c: Rename to pge-boot/Gabort.cc. * pge-boot/Gbnflex.c: Rename to pge-boot/Gbnflex.cc. * pge-boot/Gcbuiltin.c: Rename to pge-boot/Gcbuiltin.cc. * pge-boot/Gdtoa.c: Rename to pge-boot/Gdtoa.cc. * pge-boot/Gerrno.c: Rename to pge-boot/Gerrno.cc. * pge-boot/Gldtoa.c: Rename to pge-boot/Gldtoa.cc. * pge-boot/Glibc.c: Rename to pge-boot/Glibc.cc. * pge-boot/Glibm.c: Rename to pge-boot/Glibm.cc. * pge-boot/Gmcrts.c: Rename to pge-boot/Gmcrts.cc. * pge-boot/Gpge.c: Rename to pge-boot/Gpge.cc. * pge-boot/Gwrapc.c: Rename to pge-boot/Gwrapc.cc. * pge-boot/README: Correct description. * pge-boot/main.c: Rename to pge-boot/main.cc. * pge-boot/network.c: Rename to pge-boot/network.cc. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-01Daily bump.GCC Administrator1-0/+64
2023-02-28Fix build warnings noreturn M2RTS and fix calls to RegisterModule [PR108956]Gaius Mulley46-486/+594
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 <gaiusmod2@gmail.com>
2023-02-26Daily bump.GCC Administrator1-0/+291
2023-02-25modula-2 module registration process seems to fail with shared libraries ↵Gaius Mulley102-1821/+2834
[PR108261] The commit adds pathnames to modula-2 which in turn appears in any external symbol. This is necessary to allow different dialects of libraries to coexist (different implementations of SYSTEM and Storage for example in libm2pim and libm2iso). It also makes it easier to debug as the library name forms part of the external mangled name. By default pathnames are not user facing. This commit fixes PR108261. gcc/ChangeLog: PR modula2/108261 * doc/gm2.texi (-fm2-pathname): New option documented. (-fm2-pathnameI): New option documented. (-fm2-prefix=): New option documented. (-fruntime-modules=): Update default module list. gcc/m2/ChangeLog: PR modula2/108261 * Make-lang.in (GM2-COMP-BOOT-DEFS): DynamicStringPath.def remove. DynamicPath.def add. (GM2-COMP-BOOT-MODS): DynamicStringPath.mod remove. DynamicPath.mod add. * Make-maintainer.in (BUILD-BOOT-PPG-H): New dependency. (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PPG-H) Add dependency. (PGE-DEF): New definition. (BUILD-BOOT-PG-H): New dependency. (m2/gm2-pg-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PG-H) Add dependency. (BUILD-BOOT-PGE-H): New dependency. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): $(BUILD-BOOT-PGE-H) Add dependency. (GM2PATH): Add pathname entries. (m2/boot-bin/mc-devel$(exeext)): Add m2/mc-boot-ch/Gm2rtsdummy.o dependency. (m2/boot-bin/mc-opt$(exeext)): Fix -I path. * gm2-compiler/DynamicStringPath.def: Renamed module to DynamicPath. (GetUserPath): Remove. (GetSystemPath): Remove. (SetUserPath): Remove. (SetSystemPath): Remove. (DumpPath): New procedure definition. * gm2-compiler/DynamicStringPath.mod: Renamed module to DynamicPath. (GetUserPath): Remove. (GetSystemPath): Remove. (SetUserPath): Remove. (SetSystemPath): Remove. (DumpPath): Remove Debugging conditional. * gm2-compiler/M2AsmUtil.mod: Import EqualArray, NulName and GetLibName. (Debugging): New declaration. (GetFullSymName): Re-implemented to prefix (mange) libname to any extern variable/procedure which is IsExportQualified. * gm2-compiler/M2Comp.mod (qprintLibName): New procedure. * gm2-compiler/M2Graph.mod (resolveImports): Add libname. * gm2-compiler/M2Options.def (SetM2Prefix): New procedure. (GetM2Prefix): New procedure function. (SetM2PathName): New procedure. (GetM2PathName): New procedure function. * gm2-compiler/M2Options.mod: (SetM2Prefix): New procedure implemented. (GetM2Prefix): New procedure function implemented. (SetM2PathName): New procedure implemented. (GetM2PathName): New procedure function implemented. (RuntimeModuleOverride): Set to DefaultRuntimeModuleOverride. * gm2-compiler/M2Quads.mod: Import GetLibName. (SafeRequestSym) Pass result of GetLibName to RequestDependant. (callRequestDependant): Add libname as a parameter. (BuildM2InitFunction): Add libname as a parameter. (BuildM2FiniFunction): Add libname as a parameter. (BuildM2CtorFunction): Add libname as a parameter. * gm2-compiler/M2Scaffold.mod (LookupModuleSym): Set LibName if a definition source was found. * gm2-compiler/M2Search.def (FindSourceFile): Add named library parameter. (FindSourceDefFile): Add named library parameter. (FindSourceModFile): Add named library parameter. * gm2-compiler/M2Search.mod (FindSourceFile): Reimplement. (FindSourceDefFile): Add named library parameter. (FindSourceModFile): Add named library parameter. * gm2-compiler/SymbolTable.def (MakeProcedureCtorExtern): Add libname parameter. (PutLibName): New procedure. (GetLibName): New procedure function. * gm2-compiler/SymbolTable.mod (MakeProcedureCtorExtern): Add libname parameter. (GenName): Add libname parameter. (InitCtorFields): Add moduleSym as a parameter. (PutCtorExtern): Add libname parameter to GenName. * gm2-gcc/init.cc (_M2_DynamicStringPath_init): Rename function... (_M2_DynamicPath_init): ...to this. (_M2_PathName_init): Added. * gm2-gcc/m2decl.cc (m2decl_DeclareM2linkStaticInitialization): Add m2pim as the manged component of the exported symbol. (m2decl_DeclareM2linkForcedModuleInitOrder): Add m2pim mangle prefix. * gm2-gcc/m2options.h (M2Options_SetM2Prefix): New function. (M2Options_GetM2Prefix): New function. (M2Options_SetM2PathName): New function. (M2Options_GetM2PathName): New function. * gm2-lang.cc (push_back_Ipath): New function. (add_one_import_path): New function. (gm2_langhook_handle_option): Record -I component. Call SetM2PathName when -fm2-pathname= is seen. Record -fm2-pathnameI component. Call SetM2Prefix when -fm2-prefix= is seen. (gm2_langhook_post_options): Iterative over pathname entries and call SetM2PathName, SetSearchPath as appropriate. * gm2-libs-iso/M2RTS.def (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs-iso/M2RTS.mod (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs-min/M2RTS.def (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs-min/M2RTS.mod (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs/M2Dependent.def (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs/M2Dependent.mod (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs/M2RTS.def (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs/M2RTS.mod (ConstructModules): Add libname parameter. (DeconstructModules): Add libname parameter. (RegisterModule): Add libname parameter. (RequestDependant): Add libname parameter. * gm2-libs/RTint.mod (FindVector): Rename variables. (initInputVector): Rename variables. (initOutputVector): Rename variables. (InitTimeVector): Rename variables. (FindVectorNo): Rename variables. (FindPendingVector): Rename variables. (ReArmTimeVector): Rename variables. (GetTimeVector): Rename variables. (AttachVector): Rename variables. (AttachVector): Rename variables. (IncludeVector): Rename variables. (ExcludeVector): Rename variables. (AddFd): Rename variables. (AddFd): Rename variables. (DumpPendingQueue): Rename variables. (stop): Remove. (activatePending): Rename variables. (Listen): Rename variables. * gm2-libs/libc.def (snprintf): New function. * gm2-libs/sckt.def: Change all exported identifiers to be export qualified. * gm2spec.cc (push_back_Ipath): New function. (add_m2_I_path): New function. (lang_specific_driver): Skip -fm2-pathname= and remember pathname. Skip -I and record the path and current pathname. Call add_m2_I_path. * lang-specs.h: Replace %{I*} with %{fm2-pathname*}. * lang.opt (-fm2-pathname=): New entry. (-fm2-pathname): New entry. (-fm2-prefix=): New entry. * mc-boot-ch/GUnixArgs.cc (_M2_UnixArgs_dep): New function. (_M2_UnixArgs_ctor::_M2_UnixArgs_ctor): New method. * mc-boot-ch/Glibc.c (libc_snprintf): New function. * mc-boot-ch/m2rts.h (M2RTS_RequestDependant): Changed prototype. (M2RTS_RegisterModule): Changed prototype. * mc-boot/GDynamicStrings.c: Rebuild. * mc-boot/GFIO.c: Rebuild. * mc-boot/GIndexing.c: Rebuild. * mc-boot/GM2Dependent.c: Rebuild. * mc-boot/GM2Dependent.h: Rebuild. * mc-boot/GM2EXCEPTION.c: Rebuild. * mc-boot/GM2RTS.c: Rebuild. * mc-boot/GM2RTS.h: Rebuild. * mc-boot/GPushBackInput.c: Rebuild. * mc-boot/GRTExceptions.c: Rebuild. * mc-boot/GRTint.c: Rebuild. * mc-boot/GStdIO.c: Rebuild. * mc-boot/GStringConvert.c: Rebuild. * mc-boot/GSysStorage.c: Rebuild. * mc-boot/Gdecl.c: Rebuild. * mc-boot/Gkeyc.c: Rebuild. * mc-boot/Glibc.h: Rebuild. * mc-boot/GmcComment.c: Rebuild. * mc-boot/GmcComp.c: Rebuild. * mc-boot/GmcDebug.c: Rebuild. * mc-boot/GmcMetaError.c: Rebuild. * mc-boot/GmcStack.c: Rebuild. * mc-boot/GnameKey.c: Rebuild. * mc-boot/GsymbolKey.c: Rebuild. * pge-boot/GASCII.c: Rebuild. * pge-boot/GArgs.c: Rebuild. * pge-boot/GAssertion.c: Rebuild. * pge-boot/GDebug.c: Rebuild. * pge-boot/GDynamicStrings.c: Rebuild. * pge-boot/GFIO.c: Rebuild. * pge-boot/GIO.c: Rebuild. * pge-boot/GIndexing.c: Rebuild. * pge-boot/GLists.c: Rebuild. * pge-boot/GM2Dependent.c: Rebuild. * pge-boot/GM2Dependent.h: Rebuild. * pge-boot/GM2EXCEPTION.c: Rebuild. * pge-boot/GM2RTS.c: Rebuild. * pge-boot/GM2RTS.h: Rebuild. * pge-boot/GNameKey.c: Rebuild. * pge-boot/GNumberIO.c: Rebuild. * pge-boot/GOutput.c: Rebuild. * pge-boot/GPushBackInput.c: Rebuild. * pge-boot/GRTExceptions.c: Rebuild. * pge-boot/GSFIO.c: Rebuild. * pge-boot/GStdIO.c: Rebuild. * pge-boot/GStorage.c: Rebuild. * pge-boot/GStrCase.c: Rebuild. * pge-boot/GStrIO.c: Rebuild. * pge-boot/GStrLib.c: Rebuild. * pge-boot/GSymbolKey.c: Rebuild. * pge-boot/GSysExceptions.c (_M2_SysExceptions_finish): Rename this... (_M2_SysExceptions_fini): ... to this. * pge-boot/GSysStorage.c: Rebuild. (_M2_SysStorage_finish): Rename this... (_M2_SysStorage_fini): ... to this. * pge-boot/GUnixArgs.cc: New file. * pge-boot/Gbnflex.c (_M2_bnflex_finish): Rename this... (_M2_bnflex_fini): ... to this. * pge-boot/Gerrno.c (_M2_errno_finish): Rename this... (_M2_errno_fini): ... to this. * pge-boot/Glibc.c (libc_snprintf): New function. * pge-boot/Glibc.h (libc_snprintf): New prototype. * pge-boot/Gpge.c (_M2_pge_finish): Rename this... (_M2_pge_fini): ... to this. * pge-boot/Gtermios.cc (_M2_termios_finish): Rename this... (_M2_termios_fini): ... to this. * pge-boot/main.c (_M2_RTExceptions_finish): Rename this... (_M2_RTExceptions_fini): ... to this. (_M2_M2EXCEPTION_finish): Rename this... (_M2_M2EXCEPTION_fini): ... to this. (_M2_M2RTS_finish): Rename this... (_M2_M2RTS_fini): ... to this. (_M2_SysExceptions_finish): Rename this... (_M2_SysExceptions_fini): ... to this. (_M2_StrLib_finish): Rename this... (_M2_StrLib_fini): ... to this. (_M2_errno_finish): Rename this... (_M2_errno_fini): ... to this. (_M2_termios_finish): Rename this... (_M2_termios_fini): ... to this. (_M2_IO_finish): Rename this... (_M2_IO_fini): ... to this. (_M2_StdIO_finish): Rename this... (_M2_StdIO_fini): ... to this. (_M2_Debug_finish): Rename this... (_M2_Debug_fini): ... to this. (_M2_SysStorage_finish): Rename this... (_M2_SysStorage_fini): ... to this. (_M2_Storage_finish): Rename this... (_M2_Storage_fini): ... to this. (_M2_StrIO_finish): Rename this... (_M2_StrIO_fini): ... to this. (_M2_DynamicStrings_finish): Rename this... (_M2_DynamicStrings_fini): ... to this. (_M2_Assertion_finish): Rename this... (_M2_Assertion_fini): ... to this. (_M2_Indexing_finish): Rename this... (_M2_Indexing_fini): ... to this. (_M2_NameKey_finish): Rename this... (_M2_NameKey_fini): ... to this. (_M2_NumberIO_finish): Rename this... (_M2_NumberIO_fini): ... to this. (_M2_PushBackInput_finish): Rename this... (_M2_PushBackInput_fini): ... to this. (_M2_SymbolKey_finish): Rename this... (_M2_SymbolKey_fini): ... to this. (_M2_UnixArgs_finish): Rename this... (_M2_UnixArgs_fini): ... to this. (_M2_FIO_finish): Rename this... (_M2_FIO_fini): ... to this. (_M2_SFIO_finish): Rename this... (_M2_SFIO_fini): ... to this. (_M2_StrCase_finish): Rename this... (_M2_StrCase_fini): ... to this. (_M2_bnflex_finish): Rename this... (_M2_bnflex_fini): ... to this. (_M2_Lists_finish): Rename this... (_M2_Lists_fini): ... to this. (_M2_Args_finish): Rename this... (_M2_Args_fini): ... to this. (_M2_Output_finish): Rename this... (_M2_Output_fini): ... to this. (_M2_pge_finish): Rename this... (_M2_pge_fini): ... to this. * plugin/m2rte.cc (m2_runtime_error_calls): Change all runtime procedure names to their name mangled counterparts. * gm2-libs-iso/wrapsock.c: Removed. * gm2-libs-iso/wraptime.c: Removed. * mc-boot/Gpth.h: Removed. * gm2-compiler/PathName.def: New file. * gm2-compiler/PathName.mod: New file. libgm2/ChangeLog: PR modula2/108261 * libm2cor/KeyBoardLEDs.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (KeyBoardLEDs_SwitchScroll): EXPORT. (KeyBoardLEDs_SwitchNum): EXPORT. (KeyBoardLEDs_SwitchCaps): EXPORT. (KeyBoardLEDs_SwitchLeds): EXPORT. (_M2_KeyBoardLEDs_init): M2EXPORT. (_M2_KeyBoardLEDs_finish): M2EXPORT. (_M2_KeyBoardLEDs_dep): M2EXPORT. * libm2cor/Makefile.am (libm2cor_la_M2FLAGS): Define path names. * libm2cor/Makefile.in: Rebuild. * libm2iso/ErrnoCategory.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (ErrnoCategory_IsErrnoHard): EXPORT. (ErrnoCategory_IsErrnoSoft): EXPORT. (ErrnoCategory_UnAvailable): EXPORT. (ErrnoCategory_GetOpenResults): EXPORT. (_M2_ErrnoCategory_init): M2EXPORT. (_M2_ErrnoCategory_fini): M2EXPORT. (_M2_ErrnoCategory_dep): M2EXPORT. (_M2_ErrnoCategory_ctor): M2EXPORT. * libm2iso/Makefile.am (libm2iso_la_M2FLAGS): Define path names. * libm2iso/Makefile.in: Rebuild. * libm2iso/RTco.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (newSem): Add module libname prefix to HaltC. (currentThread): Remove variable and replace with a function. (never): Add module libname prefix to HaltC. (initThread): Add module libname prefix to HaltC. * libm2iso/m2rts.h (str): New define. (M2RTS_RequestDependant): Change to the mangled name equivalent. (M2RTS_RegisterModule): Change to the mangled name equivalent. (m2iso_M2RTS_RequestDependant): Add libname parameter. (m2iso_M2RTS_RegisterModule): Add libname parameter. (m2pim_M2RTS_RegisterModule): Add libname parameter. (_M2_M2RTS_init): Rename this... (m2iso_M2_M2RTS_init): ...to this. (M2RTS_ConstructModules): Change to the mangled name equivalent. (M2RTS_Terminate): Change to the mangled name equivalent. (M2RTS_DeconstructModules): Change to the mangled name equivalent. (m2iso_M2RTS_ConstructModules): Add libname parameter. (m2iso_M2RTS_Terminate): Add libname parameter. (m2iso_M2RTS_DeconstructModules): Add libname parameter. (M2RTS_HaltC): Rename this... (m2iso_M2RTS_HaltC): ...to this. * libm2iso/wrapsock.c (EXPORT): New define. (IMPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (m2iso_M2RTS_RequestDependant): Add prototype. (wrapsock_clientOpen): EXPORT. (wrapsock_clientOpenIP): EXPORT. (wrapsock_getClientPortNo): EXPORT. (wrapsock_getClientHostname): EXPORT. (wrapsock_getClientSocketFd): EXPORT. (wrapsock_getClientIP): EXPORT. (wrapsock_getPushBackChar): EXPORT. (wrapsock_setPushBackChar): EXPORT. (wrapsock_getSizeOfClientInfo): EXPORT. (_M2_wrapsock_init): M2EXPORT. (_M2_wrapsock_fini): M2EXPORT. (ctor): M2EXPORT. New function. * libm2iso/wraptime.c: Rename to... * libm2iso/wraptime.cc: ...this. (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (wraptime_InitTimeval): EXPORT. (wraptime_KillTimeval): EXPORT. (wraptime_InitTimezone): EXPORT. (wraptime_KillTimezone): EXPORT. (wraptime_InitTM): EXPORT. (wraptime_KillTM): EXPORT. (wraptime_gettimeofday): EXPORT. (wraptime_settimeofday): EXPORT. (wraptime_GetFractions): EXPORT. (wraptime_localtime_r): EXPORT. (wraptime_GetYear): EXPORT. (wraptime_GetMonth): EXPORT. (wraptime_GetDay): EXPORT. (wraptime_GetHour): EXPORT. (wraptime_GetMinute): EXPORT. (wraptime_GetSecond): EXPORT. (wraptime_GetSummerTime): EXPORT. (wraptime_GetDST): EXPORT. (wraptime_SetTimezone): EXPORT. (wraptime_SetTimeval): EXPORT. (_M2_wraptime_init): M2EXPORT. (_M2_wraptime_fini): M2EXPORT. (ctor): M2EXPORT. New function. * libm2log/Makefile.am (libm2log_la_M2FLAGS): Define path names. * libm2log/Makefile.in: * libm2min/Makefile.am (libm2min_la_M2FLAGS): Define path names. * libm2min/Makefile.in: * libm2pim/Makefile.am (libm2pim_la_M2FLAGS): Define path names. * libm2pim/Makefile.in: * libm2pim/Selective.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (Selective_Select): EXPORT. (Selective_InitTime): EXPORT. (Selective_GetTime): EXPORT. (Selective_SetTime): EXPORT. (Selective_KillTime): EXPORT. (Selective_InitSet): EXPORT. (Selective_KillSet): EXPORT. (Selective_FdZero): EXPORT. (Selective_FdSet): EXPORT. (Selective_FdClr): EXPORT. (Selective_FdIsSet): EXPORT. (Selective_GetTimeOfDay): EXPORT. (Selective_MaxFdsPlusOne): EXPORT. (Selective_WriteCharRaw): EXPORT. (Selective_ReadCharRaw): EXPORT. (_M2_Selective_init): M2EXPORT. (_M2_Selective_fini): M2EXPORT. (_M2_Selective_dep): M2EXPORT. (_M2_Selective_ctor): M2EXPORT. * libm2pim/SysExceptions.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (SysExceptions_InitExceptionHandlers): EXPORT. (_M2_SysExceptions_init): M2EXPORT. (_M2_SysExceptions_fini): M2EXPORT. (_M2_SysExceptions_dep): M2EXPORT. (_M2_SysExceptions_ctor): M2EXPORT. * libm2pim/UnixArgs.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (UnixArgs_GetArgC): EXPORT. (UnixArgs_GetArgV): EXPORT. (UnixArgs_GetEnvV): EXPORT. (_M2_UnixArgs_init): M2EXPORT. (_M2_UnixArgs_fini): M2EXPORT. (_M2_UnixArgs_dep): M2EXPORT. (_M2_UnixArgs_ctor): M2EXPORT. * libm2pim/cgetopt.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (cgetopt_getopt): EXPORT. (cgetopt_getopt_long): EXPORT. (cgetopt_getopt_long_only): EXPORT. (cgetopt_InitOptions): EXPORT. (cgetopt_KillOptions): EXPORT. (cgetopt_SetOption): EXPORT. (cgetopt_GetLongOptionArray): EXPORT. (_M2_cgetopt_init): M2EXPORT. (_M2_cgetopt_fini): M2EXPORT. (_M2_cgetopt_dep): M2EXPORT. (_M2_cgetopt_ctor): M2EXPORT. * libm2pim/dtoa.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (dtoa_strtod): EXPORT. (dtoa_calcmaxsig): EXPORT. (dtoa_calcdecimal): EXPORT. (dtoa_calcsign): EXPORT. (dtoa_dtoa): EXPORT. (_M2_dtoa_init): M2EXPORT. (_M2_dtoa_fini): M2EXPORT. (_M2_dtoa_dep): M2EXPORT. (_M2_dtoa_ctor): M2EXPORT. * libm2pim/errno.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (errno_geterrno): EXPORT. (_M2_errno_init): M2EXPORT. (_M2_errno_fini): M2EXPORT. (_M2_errno_dep): M2EXPORT. (_M2_errno_ctor): M2EXPORT. * libm2pim/ldtoa.cc (EXPORT): New define. (IMPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (dtoa_calcmaxsig): EXPORT. (dtoa_calcdecimal): EXPORT. (dtoa_calcsign): EXPORT. (ldtoa_strtold): EXPORT. (ldtoa_ldtoa): EXPORT. (_M2_ldtoa_init): M2EXPORT. (_M2_ldtoa_fini): M2EXPORT. (_M2_ldtoa_dep): M2EXPORT. (_M2_ldtoa_ctor): M2EXPORT. * libm2pim/sckt.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (tcpServerEstablishPort): EXPORT. (tcpServerEstablish): EXPORT. (tcpServerAccept): EXPORT. (tcpServerPortNo): EXPORT. (tcpServerSocketFd): EXPORT. (getLocalIP): EXPORT. (tcpServerIP): EXPORT. (tcpServerClientIP): EXPORT. (tcpServerClientPortNo): EXPORT. (tcpClientSocket): EXPORT. (tcpClientSocketIP): EXPORT. (tcpClientConnect): EXPORT. (tcpClientPortNo): EXPORT. (tcpClientSocketFd): EXPORT. (tcpClientIP): EXPORT. (_M2_sckt_init): M2EXPORT. (_M2_sckt_finish): M2EXPORT. (_M2_sckt_dep): M2EXPORT. (_M2_sckt_ctor): M2EXPORT. * libm2pim/termios.cc (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (_M2_termios_init): M2EXPORT. (_M2_termios_fini): M2EXPORT. (_M2_termios_dep): M2EXPORT. (_M2_termios_ctor): M2EXPORT. * libm2pim/wrapc.c (EXPORT): New define. (M2EXPORT): New define. (M2LIBNAME): New define. (wrapc_strtime): EXPORT. (wrapc_filesize): EXPORT. (wrapc_filemtime): EXPORT. (wrapc_fileinode): EXPORT. (wrapc_getrand): EXPORT. (wrapc_getusername): EXPORT. (wrapc_getnameuidgid): EXPORT. (wrapc_signbit): EXPORT. (wrapc_signbitl): EXPORT. (wrapc_signbitf): EXPORT. (wrapc_isfinite): EXPORT. (wrapc_isfinitel): EXPORT. (wrapc_isfinitef): EXPORT. (_M2_wrapc_init): M2EXPORT. (_M2_wrapc_fini): M2EXPORT. (_M2_wrapc_ctor): M2EXPORT. gcc/testsuite/ChangeLog: PR modula2/108261 * gm2/examples/callingC/pass/examples-callingC-pass.exp: Tidy up variable access. * gm2/examples/callingC/run/pass/examples-callingC-run-pass.exp: Tidy up variable access. * gm2/examples/cpp/pass/examples-cpp-pass.exp: Tidy up variable access. * gm2/examples/cppDef/pass/examples-cppDef-pass.exp: Tidy up variable access. * gm2/examples/hello/pass/examples-hello-pass.exp: Tidy up variable access. * gm2/examples/map/pass/examples-map-pass.exp: Tidy up variable access. * gm2/iso/check/fail/iso-check-fail.exp: Add pathname. * gm2/link/externalscaffold/pass/link-externalscaffold-pass.exp: Add pathname. * gm2/link/externalscaffold/pass/scaffold.c: Add mangled export name. * gm2/pimlib/base/run/pass/FIO.mod: Updated test code. * gm2/pimlib/base/run/pass/StrLib.mod: Updated test code. * gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp: Remove path. * gm2/projects/pim/run/pass/random/projects-pim-run-pass-random.exp: Tidy up variable access. * gm2/switches/auto-init/fail/switches-auto-init-fail.exp: Add pathname. * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp: Add pathname. * gm2/switches/makeall/fail/switches-makeall-fail.exp: Remove -fmakeall. * gm2/switches/makeall/pass/switches-makeall-pass.exp: Remove -fmakeall. * lib/gm2-simple.exp (gm2_keep_executable): New global variable. (gm2_simple_execute): Keep executable if global is true. * lib/gm2-torture.exp: Add ; after global variable access. * lib/gm2.exp: Set up pathnames. * gm2/projects/pim/run/pass/tower/AdvCmd.def: New test. * gm2/projects/pim/run/pass/tower/AdvCmd.mod: New test. * gm2/projects/pim/run/pass/tower/AdvIntroduction.def: New test. * gm2/projects/pim/run/pass/tower/AdvIntroduction.mod: New test. * gm2/projects/pim/run/pass/tower/AdvMap.def: New test. * gm2/projects/pim/run/pass/tower/AdvMap.mod: New test. * gm2/projects/pim/run/pass/tower/AdvMath.def: New test. * gm2/projects/pim/run/pass/tower/AdvMath.mod: New test. * gm2/projects/pim/run/pass/tower/AdvParse.bnf: New test. * gm2/projects/pim/run/pass/tower/AdvParse.def: New test. * gm2/projects/pim/run/pass/tower/AdvParse.mod: New test. * gm2/projects/pim/run/pass/tower/AdvSound.def: New test. * gm2/projects/pim/run/pass/tower/AdvSound.mod: New test. * gm2/projects/pim/run/pass/tower/AdvSystem.def: New test. * gm2/projects/pim/run/pass/tower/AdvSystem.mod: New test. * gm2/projects/pim/run/pass/tower/AdvTreasure.def: New test. * gm2/projects/pim/run/pass/tower/AdvTreasure.mod: New test. * gm2/projects/pim/run/pass/tower/AdvUtil.def: New test. * gm2/projects/pim/run/pass/tower/AdvUtil.mod: New test. * gm2/projects/pim/run/pass/tower/DrawG.def: New test. * gm2/projects/pim/run/pass/tower/DrawG.mod: New test. * gm2/projects/pim/run/pass/tower/DrawL.def: New test. * gm2/projects/pim/run/pass/tower/DrawL.mod: New test. * gm2/projects/pim/run/pass/tower/Dungeon.mod: New test. * gm2/projects/pim/run/pass/tower/Lock.def: New test. * gm2/projects/pim/run/pass/tower/Lock.mod: New test. * gm2/projects/pim/run/pass/tower/ProcArgs.def: New test. * gm2/projects/pim/run/pass/tower/ProcArgs.mod: New test. * gm2/projects/pim/run/pass/tower/Screen.def: New test. * gm2/projects/pim/run/pass/tower/Screen.mod: New test. * gm2/projects/pim/run/pass/tower/SocketControl.c: New test. * gm2/projects/pim/run/pass/tower/SocketControl.def: New test. * gm2/projects/pim/run/pass/tower/Window.def: New test. * gm2/projects/pim/run/pass/tower/Window.mod: New test. * gm2/projects/pim/run/pass/tower/adv.flex: New test. * gm2/projects/pim/run/pass/tower/advflex.c: New test. * gm2/projects/pim/run/pass/tower/advflex.def: New test. * gm2/projects/pim/run/pass/tower/projects-pim-run-pass-tower.exp: New test. * gm2/projects/pim/run/pass/tower/star: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-07Daily bump.GCC Administrator1-0/+20
2023-02-06Modula2 meets clang [PR108135]Gaius Mulley1-1/+4
Remove unused function (and build warnings). gcc/m2/ChangeLog: * gm2-compiler/M2Search.mod (DSdbEnter): Comment out. (DSdbExit): Comment out. PR modula2/108135 Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-06Format error in m2pp.cc (m2pp_integer_cst) [PR107234]Gaius Mulley1-1/+1
Use HOST_WIDE_INT_PRINT_UNSIGNED instead of hardcoding a specific format. gcc/m2/ChangeLog: * m2pp.cc (m2pp_integer_cst): Use HOST_WIDE_INT_PRINT_UNSIGNED as the format specifier. PR modula2/107234 Co-Authored by: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-06Remove unused variables and procedures.Gaius Mulley3-29/+2
Remove unused variables and procedures (and remove build warning clutter). gcc/m2/ChangeLog: * gm2-compiler/M2Preprocess.mod (BaseName): Comment out. * gm2-lang.cc (opt): Remove. * gm2spec.cc (add_include): Remove. (full_libraries): Remove. (concat_option): Remove. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-04Daily bump.GCC Administrator1-0/+59
2023-02-03[modula-2] Bugfix to allow html doc build and simplify target dir creationGaius Mulley1-66/+87
This patch allows the m2 html documentation to be built. It also simplifies all calls to $(mkinstalldirs) using $(@D) in gcc/m2/Make-lang.in. gcc/ChangeLog: * doc/gm2.texi (Internals): Remove from menu. (Using): Comment out ifnohtml conditional. (Documentation): Use gcc url. (License): Node simplified. (Copying): New node. Include gpl_v3_without_node. (Contributing): Node simplified. (Internals): Commented out. (Libraries): Node simplified. (Indices): Ditto. (Contents): Ditto. (Functions): Ditto. gcc/m2/ChangeLog: * Make-lang.in (TEXISRC): Remove m2/images/gnu.eps. (RSTSRC): Remove m2/images/gnu.eps. (doc/m2.dvi): Add $(objdir)/m2/images/gnu.eps. (doc/m2.pdf): Add $(objdir)/m2/images/gnu.eps. (M2_PDFFILES): New definition. (m2.install-pdf): New rule. (m2.pod): Add $(objdir)/m2/images/gnu.eps. (m2.info): Add $(objdir)/m2/images/gnu.eps. (m2.html): New rule. (m2/gpl_v3_without_node.texi): New rule. (plugin/m2rte$(soext)): Simplify mkinstalldirs. (cc1gm2$(exeext)): Ditto. (m2/stage1/cc1gm2$(exeext)): Ditto. (m2/gm2-gcc/%.o): Ditto. (m2/gm2-gcc/rtegraph.o): Ditto. (m2/gm2-gcc/$(SRC_PREFIX)%.h): Ditto. (m2/mc-boot/$(SRC_PREFIX)%.o):Ditto. (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto. (m2/mc-boot/main.o): Ditto. (m2/gm2-libs-boot/%.o): Ditto. (m2/gm2-libs-boot/$(SRC_PREFIX)%.h): Ditto. (m2/gm2-libs-boot/RTcodummy.o): Ditto. (m2/gm2-libs-boot/wrapc.o): Ditto. (m2/gm2-libs-boot/M2LINK.o): Ditto. (m2/gm2-libs-boot/UnixArgs.o): Ditto. (m2/gm2-libs-boot/choosetemp.o): Ditto. (m2/gm2-libs-boot/errno.o): Ditto. (m2/gm2-libs-boot/dtoa.o): Ditto. (m2/gm2-libs-boot/ldtoa.o): Ditto. (m2/gm2-libs-boot/termios.o): Ditto. (m2/gm2-libs-boot/SysExceptions.o): Ditto. (m2/gm2-libs-boot/SysStorage.o): Ditto. (m2/gm2-compiler-boot/M2GCCDeclare.o): Ditto. (m2/gm2-compiler-boot/M2Error.o): Ditto. (m2/gm2-compiler-boot/%.o): Ditto. (m2/gm2-compiler-boot/$(SRC_PREFIX)%.h): Ditto. (m2/gm2-compiler-boot/m2flex.o): Ditto. (m2/gm2-compiler/m2flex.c): Ditto. (m2/gm2-libiberty/$(SRC_PREFIX)%.h): Ditto. (m2/gm2-compiler/%.o): Ditto. (m2/gm2-compiler/m2flex.o): Ditto. (m2/gm2-compiler/%.o): Ditto. (m2/gm2-libs-iso/%.o): Ditto. (m2/gm2-libs/gm2-libs-host.h): Ditto. ($(objdir)/m2/gm2-libs-min/SYSTEM.def): Ditto. ($(objdir)/m2/gm2-libs/SYSTEM.def): Ditto. ($(objdir)/m2/gm2-libs-iso/SYSTEM.def): Ditto. ($(objdir)/m2/gm2-libs-coroutines/SYSTEM.def): Ditto. (m2/gm2-compiler/gm2.a): Ditto. (m2/gm2-libs-boot/libgm2.a): Ditto. (m2/gm2-compiler-boot/gm2.a): Ditto. (m2/boot-bin/mklink$(exeext)): Ditto. (m2/gm2-compiler-boot/$(SRC_PREFIX)%.h): Ditto. (m2/gm2-compiler/%.mod): Ditto. (m2/gm2-compiler-boot/%.mod): Ditto. (m2/pge-boot/%.o): Ditto. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-02Daily bump.GCC Administrator1-0/+202
2023-02-01Fixup noreturn attributes in modula-2 [PR108551] and [PR108612]Gaius Mulley103-330/+445
PR108612 - m2/gm2-libs-iso/ClientSocket.mod:229:1: error: control reaches end of non-void function [-Werror=return-type] PR108551 - gcc/m2/gm2-libs-pim/Termbase.mod:128:1: error: control reaches end of non-void function [-Werror=return-type] This patch adds missing return values to the procedure functions mentioned in PR108612 and PR108551. It corrects the noreturn attribute to throw and rethrow in the modula2 frontend. The patch also changes HALT, Halt, Raise procedures in the libraries to use the <* noreturn *> attribute. Finally the patch includes rebuilt bootstrap tools mc and pge. gcc/m2/ChangeLog: * Make-lang.in (GM2_FLAGS): Add -fno-return -Wreturn-type. (GM2_ISO_FLAGS): Add -fno-return -Wreturn-type. * Make-maintainer.in (GM2PATH): Split into separate -I components. (MC-LIB-DEFS): Add RTentity.def. (m2/boot-bin/mc-devel$(exeext)): Changed -I$(GM2PATH) to $(GM2PATH). (m2/boot-bin/mc-opt$(exeext)): Separate -I paths. (m2/mc/decl.o): Separate -I paths. (gm2-bootstrap): Separate -I paths. (m2/mc-boot-gen/$(SRC_PREFIX)%.h): Separate -I paths. (m2/mc-boot-gen/$(SRC_PREFIX)decl.c): Separate -I paths. (m2/mc-boot-gen/$(SRC_PREFIX)%.c): Separate -I paths. (gm2.verifyparanoid): Separate -I paths. (gm2.verifystage12): Separate -I paths. * gm2-compiler/M2ALU.mod (GetConstructorElement): Add default Return NulSym. Remove return from the error case. * gm2-compiler/M2Base.mod (ComplexToScalar): Return RType from the error case. (MixMetaTypes): Return MakeError as a default. * gm2-compiler/M2GCCDeclare.mod (GetTypeMin): Return NulSym from the error case. (GetTypeMax): Return NulSym from the error case. * gm2-compiler/M2GenGCC.mod (IsExportedGcc): Replace Assert by InternalError. * gm2-compiler/M2Quads.mod (GetItemPointedTo): Add InternalError. (GetTypeMin): Add InternalError. (GetTypeMax): Add InternalError. * gm2-compiler/M2System.mod (InitSystem): Call PutProcedureNoReturn on Throw. * gm2-gcc/m2except.cc (m2except_InitExceptions): fn_throw_tree declare as noreturn. fn_rethrow_tree declare as noreturn. * gm2-libs-coroutines/Debug.def (Halt): Add noreturn attribute. * gm2-libs-coroutines/SYSTEM.def (THROW): Add noreturn attribute. * gm2-libs-iso/ClientSocket.mod (dorbytes): Add return FALSE. * gm2-libs-iso/EXCEPTIONS.def (RAISE): Add noreturn attribute. * gm2-libs-iso/IOLink.def (RAISEdevException): Add noreturn attribute. * gm2-libs-iso/M2RTS.def (HALT): Add noreturn attribute. (Halt): Ditto. (HaltC): Ditto. (ErrorMessage): Ditto. (AssignmentException): Ditto. (ReturnException): Ditto. (IncException): Ditto. (DecException): Ditto. (InclException): Ditto. (ExclException): Ditto. (ShiftException): Ditto. (RotateException): Ditto. (StaticArraySubscriptException): Ditto. (DynamicArraySubscriptException): Ditto. (ForLoopBeginException): Ditto. (ForLoopToException): Ditto. (ForLoopEndException): Ditto. (PointerNilException): Ditto. (NoReturnException): Ditto. (CaseException): Ditto. (WholeNonPosDivException): Ditto. (WholeNonPosModException): Ditto. (WholeZeroDivException): Ditto. (WholeZeroRemException): Ditto. (WholeValueException): Ditto. (RealValueException): Ditto. (ParameterException): Ditto. (NoException): Ditto. * gm2-libs-iso/SYSTEM.def (THROW): Ditto. * gm2-libs-iso/TermFile.mod (dorbytes): Add default return FALSE. * gm2-libs-min/M2RTS.def: Add noreturn attribute. * gm2-libs/FIO.mod (BufferedRead): Return -1. (getFileName): Return NIL. (getFileNameLength): Return 0. * gm2-libs/M2RTS.def (HaltC): Add noreturn attribute. (AssignmentException): Ditto. (ReturnException): Ditto. (IncException): Ditto. (DecException): Ditto. (InclException): Ditto. (ExclException): Ditto. (ShiftException): Ditto. (RotateException): Ditto. (StaticArraySubscriptException): Ditto. (DynamicArraySubscriptException): Ditto. (ForLoopBeginException): Ditto. (ForLoopToException): Ditto. (ForLoopEndException): Ditto. (PointerNilException): Ditto. (NoReturnException): Ditto. (CaseException): Ditto. (WholeNonPosDivException): Ditto. (WholeNonPosModException): Ditto. (WholeZeroDivException): Ditto. (WholeZeroRemException): Ditto. (WholeValueException): Ditto. (RealValueException): Ditto. (ParameterException): Ditto. (NoException): Ditto. * gm2-libs/RTExceptions.def (Raise): Ditto. * gm2-libs/RTExceptions.mod (InvokeHandler): Ditto. * gm2-libs/SYSTEM.def (THROW): Ditto. * m2.flex (_M2_m2flex_fini): Remamed to... (_M2_m2flex_finish): ...here. * mc-boot-ch/GBuiltins.c (_M2_Builtins_finish): Remamed to... (_M2_Builtins_fini): ...this. * mc-boot-ch/GRTco.c (_M2_RTco_finish): Remamed to... (_M2_RTco_fini): ...this. * mc-boot-ch/GSYSTEM.c (_M2_SYSTEM_finish): Remamed to... (_M2_SYSTEM_fini): ...this. * mc-boot-ch/GSelective.c (_M2_Selective_finish): Remamed to... (_M2_Selective_fini): ...this. * mc-boot-ch/GSysExceptions.c (_M2_SysExceptions_init): Add parameters. (_M2_SysExceptions_finish): Remamed to... (_M2_SysExceptions_fini): ...this. * mc-boot-ch/GUnixArgs.cc (_M2_UnixArgs_finish): Remamed to... (_M2_UnixArgs_fini): ...this. (_M2_UnixArgs_ctor::_M2_UnixArgs_ctor): Change parameter to _M2_UnixArgs_fini. * mc-boot-ch/Gdtoa.c (_M2_dtoa_finish): Remamed to... (_M2_dtoa_fini): ...this. * mc-boot-ch/Gerrno.c (_M2_errno_finish): Remamed to... (_M2_errno_fini): ...this. * mc-boot-ch/Gldtoa.c (_M2_ldtoa_finish): Remamed to... (_M2_ldtoa_fini): ...this. * mc-boot-ch/Gtermios.cc (_M2_termios_init): Add parameters. (_M2_termios_finish): Remamed to... (_M2_termios_fini): ...this. * mc-boot-ch/Gwrapc.c (_M2_wrapc_init): Add parameters. (_M2_wrapc_finish): Remamed to... (_M2_wrapc_fini): ...this. * mc-boot/GASCII.c: Rebuild. * mc-boot/GArgs.c: Rebuild. * mc-boot/GAssertion.c: Rebuild. * mc-boot/GBreak.c: Rebuild. * mc-boot/GCmdArgs.c: Rebuild. * mc-boot/GDebug.c: Rebuild. * mc-boot/GDynamicStrings.c: Rebuild. * mc-boot/GEnvironment.c: Rebuild. * mc-boot/GFIO.c: Rebuild. * mc-boot/GFormatStrings.c: Rebuild. * mc-boot/GFpuIO.c: Rebuild. * mc-boot/GIO.c: Rebuild. * mc-boot/GIndexing.c: Rebuild. * mc-boot/GM2Dependent.c: Rebuild. * mc-boot/GM2EXCEPTION.c: Rebuild. * mc-boot/GM2RTS.c: Rebuild. * mc-boot/GM2RTS.h: Rebuild. * mc-boot/GMemUtils.c: Rebuild. * mc-boot/GNumberIO.c: Rebuild. * mc-boot/GPushBackInput.c: Rebuild. * mc-boot/GRTExceptions.c: Rebuild. * mc-boot/GRTExceptions.h: Rebuild. * mc-boot/GRTco.h: Rebuild. * mc-boot/GRTint.c: Rebuild. * mc-boot/GSArgs.c: Rebuild. * mc-boot/GSFIO.c: Rebuild. * mc-boot/GStdIO.c: Rebuild. * mc-boot/GStorage.c: Rebuild. * mc-boot/GStrCase.c: Rebuild. * mc-boot/GStrIO.c: Rebuild. * mc-boot/GStrLib.c: Rebuild. * mc-boot/GStringConvert.c: Rebuild. * mc-boot/GSysStorage.c: Rebuild. * mc-boot/GTimeString.c: Rebuild. * mc-boot/Galists.c: Rebuild. * mc-boot/Gdecl.c: Rebuild. * mc-boot/Gkeyc.c: Rebuild. * mc-boot/Glists.c: Rebuild. * mc-boot/GmcComment.c: Rebuild. * mc-boot/GmcComp.c: Rebuild. * mc-boot/GmcDebug.c: Rebuild. * mc-boot/GmcError.c: Rebuild. * mc-boot/GmcFileName.c: Rebuild. * mc-boot/GmcLexBuf.c: Rebuild. * mc-boot/GmcMetaError.c: Rebuild. * mc-boot/GmcOptions.c: Rebuild. * mc-boot/GmcPreprocess.c: Rebuild. * mc-boot/GmcPretty.c: Rebuild. * mc-boot/GmcPrintf.c: Rebuild. * mc-boot/GmcQuiet.c: Rebuild. * mc-boot/GmcReserved.c: Rebuild. * mc-boot/GmcSearch.c: Rebuild. * mc-boot/GmcStack.c: Rebuild. * mc-boot/GmcStream.c: Rebuild. * mc-boot/Gmcp1.c: Rebuild. * mc-boot/Gmcp2.c: Rebuild. * mc-boot/Gmcp3.c: Rebuild. * mc-boot/Gmcp4.c: Rebuild. * mc-boot/Gmcp5.c: Rebuild. * mc-boot/GnameKey.c: Rebuild. * mc-boot/GsymbolKey.c: Rebuild. * mc-boot/Gtop.c: Rebuild. * mc-boot/Gvarargs.c: Rebuild. * mc-boot/Gwlists.c: Rebuild. * mc-boot/GRTentity.h: New file. * mc/decl.mod (scaffoldStatic): Change _finish to _fini. * mc/mc.flex (_M2_mcflex_fini): New function. (_M2_mcflex_finish): Remove function. * tools-src/mklink.c (GenerateFinishCalls): Change _finish to _fini. (GeneratePrototypes): Change _finish to _fini. libgm2/ChangeLog: * libm2cor/Makefile.am (libm2cor_la_M2FLAGS): Add -Wreturn-type -fcase. * libm2cor/Makefile.in: Rebuild. * libm2iso/Makefile.am (libm2iso_la_M2FLAGS): Add -Wreturn-type -fcase. * libm2iso/Makefile.in: Rebuild. * libm2log/Makefile.am (libm2log_la_M2FLAGS): Add -Wreturn-type -fcase. * libm2log/Makefile.in: Rebuild. * libm2pim/Makefile.am (libm2pim_la_M2FLAGS): Add -Wreturn-type -fcase. * libm2pim/Makefile.in: Rebuild. PR modula2/108612 PR modula2/108551 Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-02-01Daily bump.GCC Administrator1-0/+107
2023-01-31Modula-2 rename logitech libraries to logGaius Mulley52-1/+1
Rename the gcc/m2/gm2-libs-pim to gcc/m2/gm2-libs-log for consistency. gcc/m2/ChangeLog: * Make-lang.in (gm2-libs.texi-check): Rename m2/gm2-libs-pim to m2/gm2-libs-log. * gm2-libs-pim/BitBlockOps.def: Moved to... * gm2-libs-log/BitBlockOps.def: ...here. * gm2-libs-pim/BitBlockOps.mod: Moved to... * gm2-libs-log/BitBlockOps.mod: ...here. * gm2-libs-pim/BitByteOps.def: Moved to... * gm2-libs-log/BitByteOps.def: ...here. * gm2-libs-pim/BitByteOps.mod: Moved to... * gm2-libs-log/BitByteOps.mod: ...here. * gm2-libs-pim/BitWordOps.def: Moved to... * gm2-libs-log/BitWordOps.def: ...here. * gm2-libs-pim/BitWordOps.mod: Moved to... * gm2-libs-log/BitWordOps.mod: ...here. * gm2-libs-pim/BlockOps.def: Moved to... * gm2-libs-log/BlockOps.def: ...here. * gm2-libs-pim/BlockOps.mod: Moved to... * gm2-libs-log/BlockOps.mod: ...here. * gm2-libs-pim/Break.c: Moved to... * gm2-libs-log/Break.c: ...here. * gm2-libs-pim/Break.def: Moved to... * gm2-libs-log/Break.def: ...here. * gm2-libs-pim/CardinalIO.def: Moved to... * gm2-libs-log/CardinalIO.def: ...here. * gm2-libs-pim/CardinalIO.mod: Moved to... * gm2-libs-log/CardinalIO.mod: ...here. * gm2-libs-pim/Conversions.def: Moved to... * gm2-libs-log/Conversions.def: ...here. * gm2-libs-pim/Conversions.mod: Moved to... * gm2-libs-log/Conversions.mod: ...here. * gm2-libs-pim/DebugPMD.def: Moved to... * gm2-libs-log/DebugPMD.def: ...here. * gm2-libs-pim/DebugPMD.mod: Moved to... * gm2-libs-log/DebugPMD.mod: ...here. * gm2-libs-pim/DebugTrace.def: Moved to... * gm2-libs-log/DebugTrace.def: ...here. * gm2-libs-pim/DebugTrace.mod: Moved to... * gm2-libs-log/DebugTrace.mod: ...here. * gm2-libs-pim/Delay.def: Moved to... * gm2-libs-log/Delay.def: ...here. * gm2-libs-pim/Delay.mod: Moved to... * gm2-libs-log/Delay.mod: ...here. * gm2-libs-pim/Display.def: Moved to... * gm2-libs-log/Display.def: ...here. * gm2-libs-pim/Display.mod: Moved to... * gm2-libs-log/Display.mod: ...here. * gm2-libs-pim/ErrorCode.def: Moved to... * gm2-libs-log/ErrorCode.def: ...here. * gm2-libs-pim/ErrorCode.mod: Moved to... * gm2-libs-log/ErrorCode.mod: ...here. * gm2-libs-pim/FileSystem.def: Moved to... * gm2-libs-log/FileSystem.def: ...here. * gm2-libs-pim/FileSystem.mod: Moved to... * gm2-libs-log/FileSystem.mod: ...here. * gm2-libs-pim/FloatingUtilities.def: Moved to... * gm2-libs-log/FloatingUtilities.def: ...here. * gm2-libs-pim/FloatingUtilities.mod: Moved to... * gm2-libs-log/FloatingUtilities.mod: ...here. * gm2-libs-pim/InOut.def: Moved to... * gm2-libs-log/InOut.def: ...here. * gm2-libs-pim/InOut.mod: Moved to... * gm2-libs-log/InOut.mod: ...here. * gm2-libs-pim/Keyboard.def: Moved to... * gm2-libs-log/Keyboard.def: ...here. * gm2-libs-pim/Keyboard.mod: Moved to... * gm2-libs-log/Keyboard.mod: ...here. * gm2-libs-pim/LongIO.def: Moved to... * gm2-libs-log/LongIO.def: ...here. * gm2-libs-pim/LongIO.mod: Moved to... * gm2-libs-log/LongIO.mod: ...here. * gm2-libs-pim/NumberConversion.def: Moved to... * gm2-libs-log/NumberConversion.def: ...here. * gm2-libs-pim/NumberConversion.mod: Moved to... * gm2-libs-log/NumberConversion.mod: ...here. * gm2-libs-pim/README.texi: Moved to... * gm2-libs-log/README.texi: ...here. * gm2-libs-pim/Random.def: Moved to... * gm2-libs-log/Random.def: ...here. * gm2-libs-pim/Random.mod: Moved to... * gm2-libs-log/Random.mod: ...here. * gm2-libs-pim/RealConversions.def: Moved to... * gm2-libs-log/RealConversions.def: ...here. * gm2-libs-pim/RealConversions.mod: Moved to... * gm2-libs-log/RealConversions.mod: ...here. * gm2-libs-pim/RealInOut.def: Moved to... * gm2-libs-log/RealInOut.def: ...here. * gm2-libs-pim/RealInOut.mod: Moved to... * gm2-libs-log/RealInOut.mod: ...here. * gm2-libs-pim/Strings.def: Moved to... * gm2-libs-log/Strings.def: ...here. * gm2-libs-pim/Strings.mod: Moved to... * gm2-libs-log/Strings.mod: ...here. * gm2-libs-pim/Termbase.def: Moved to... * gm2-libs-log/Termbase.def: ...here. * gm2-libs-pim/Termbase.mod: Moved to... * gm2-libs-log/Termbase.mod: ...here. * gm2-libs-pim/Terminal.def: Moved to... * gm2-libs-log/Terminal.def: ...here. * gm2-libs-pim/Terminal.mod: Moved to... * gm2-libs-log/Terminal.mod: ...here. * gm2-libs-pim/TimeDate.def: Moved to... * gm2-libs-log/TimeDate.def: ...here. * gm2-libs-pim/TimeDate.mod: Moved to... * gm2-libs-log/TimeDate.mod: ...here. libgm2/ChangeLog: * libm2log/Makefile.am (VPATH): Replace gm2-libs-pim with gm2-libs-log. (libm2log_la_M2FLAGS): Replace gm2-libs-pim with gm2-libs-log. (install-data-local): Replace gm2-libs-pim with gm2-libs-log. * libm2log/Makefile.in: Rebuilt. gcc/testsuite/ChangeLog: * lib/gm2.exp (gm2_init_pimx): Replace gm2-libs-pim with gm2-libs-log. (gm2_init_iso): Replace gm2-libs-pim with gm2-libs-log. (gm2_init_ulm): Replace gm2-libs-pim with gm2-libs-log. (gm2_init_log): Replace gm2-libs-pim with gm2-libs-log. (gm2_init_cor): Replace gm2-libs-pim with gm2-libs-log. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-01-29Daily bump.GCC Administrator1-0/+4
2023-01-28Modula-2: Claim Wreturn-type in lang.opt.Iain Sandoe1-0/+4
Modula-2 handles this warning so that we need to claim it in the language options. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/m2/ChangeLog: * lang.opt: Claim Wreturn-type.
2023-01-28Daily bump.GCC Administrator1-0/+36
2023-01-27PR-108557 Stuck compilation for empty fileGaius Mulley2-15/+45
Trying to compile an empty file causes cc1gm2 to hang. The bug occurs when M2LexBuf.mod calls m2flex.GetToken after an eof token has been seen which results in m2flex attempting to read from stdin. The bug fix detects eof per file and blocks subsequent calls to m2flex.GetToken. gcc/m2/ChangeLog: * gm2-compiler/M2Comp.mod: Import MetaString0. (ExamineCompilationUnit): New variable Message. Create and format error string. * gm2-compiler/M2LexBuf.mod: New variable SeenEof. (GetNonEofToken): New procedure. (Init): Set SeenEof to FALSE. (GetToken): Use GetNonEofToken instead of calls to m2flex.GetToken and GetToken. (AddTok): Detect eoftok and set SeenEof. gcc/testsuite/ChangeLog: * gm2/pim/fail/empty.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-01-27Tidy up to declarations allowing files to be built by gm2Gaius Mulley3-9/+11
This patch adds missing declarations in export qualified lists and fixes comparisons of an address type against NIL. These changes allow make m2/stage2/cc1gm2 to succeed when in maintainer mode. gcc/m2/ChangeLog: * gm2-compiler/M2Options.def: Export GetMQ, SetMQ. * gm2-compiler/M2Preprocess.mod: (MakeSaveTempsFileName): Test NewDir against NIL. Test Dumpdir against NIL. Test GetMD () against NIL. Test GetMMD () against NIL. Test GetMQ () against NIL. Test GetObj () against NIL. Test tempfile against NIL. * gm2-compiler/P2SymBuild.def: Export BuildNoReturnAttribute. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>