Skip to content
Snippets Groups Projects
Commit e3632a18 authored by Gaius Mulley's avatar Gaius Mulley
Browse files

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: default avatarGaius Mulley <gaiusmod2@gmail.com>
parent dac34a18
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment