-
- Downloads
PR modula2/112920 cc1gm2 hangs in the type resolver
This patch contains a fix to gcc/m2/gm2-compiler/M2GCCDeclare.mod.
The fix introduces a group of sets which can be compared. The resolver
will loop until there is no change in all sets within the group.
Since symbols migrate from set to set without ever looping this
will never hang. Previously only the number of elements in a set
were compared which resulted in a infinite spin.
gcc/m2/ChangeLog:
PR modula2/112920
* gm2-compiler/M2GCCDeclare.mod (Group): New declaration.
Import MakeSubrange, MakeConstVar, MakeConstLit and DivTrunc.
(FreeGroup): New declaration.
(GlobalGroup): New declaration.
(ToBeSolvedByQuads): Remove.
(NilTypedArrays): Remove.
(PartiallyDeclared): Remove.
(HeldByAlignment): Remove.
(FinishedAlignment): Remove.
(ToDoList): Remove.
(DebugSet): Re-format.
(DebugNumber): Re-format.
(DebugSetNumbers): Reference sets using GlobalGroup.
(AddSymToWatch): Re-format.
(WatchIncludeList): Reference sets using GlobalGroup.
(WatchRemoveList): Reference sets using GlobalGroup.
(NewGroup): New procedure.
(DisposeGroup): New procedure.
(InitGroup): New procedure.
(KillGroup): New procedure.
(DupGroup): New procedure.
(EqualGroup): New procedure.
(LookupSet): New procedure.
(CanDeclareTypePartially): Reference sets using GlobalGroup.
(CompletelyResolved): Reference sets using GlobalGroup.
(IsNilTypedArrays): Reference sets using GlobalGroup.
(IsFullyDeclared): Reference sets using GlobalGroup.
(IsPartiallyDeclared): Reference sets using GlobalGroup.
(IsPartiallyOrFullyDeclared): Reference sets using GlobalGroup.
(DeclareTypeConstFully): Reference sets using GlobalGroup.
(bodyl): Remove.
(Body): Use bodyt and to lookup the required set.
(ForeachTryDeclare): Remove parameter l. Lookup set instead.
(DeclareOutstandingTypes): Add new rules setarraynul and setfully.
Reference sets using GlobalGroup.
(ActivateWatch): New procedure.
(DeclareTypesConstantsProceduresInRange): Re-written to check
group change.
(DeclareTypesConstantsProcedures): Re-written to check
group change.
(DeclareBoolean): Reference sets using GlobalGroup.
(DeclarePackedBoolean): Ditto.
(DeclareDefaultConstants): Ditto.
(FreeGroup): Initialized.
(GlobalGroup): Ditto.
* gm2-compiler/Sets.def (EqualSet): New procedure function.
Remove export qualified list of identifiers.
* gm2-compiler/Sets.mod (EqualSet): New procedure function.
Signed-off-by:
Gaius Mulley <gaiusmod2@gmail.com>
Loading
Please register or sign in to comment