[PATCH] PR modula2/120117: ICE when attempting to obtain the MAX of an aliased set type

The ICE occurred because of a bug in M2GenGCC.mod:FoldBecomes which
attempted to remove the same quadruple twice.  Thereafter cc1gm2
generated an erroneous error type error as PCSymBuild did not skip
an aliased set type.  The type of the const was set incorrectly
(as a set type) rather than the type of the set element.

gcc/m2/ChangeLog:

	PR modula2/120117
	* gm2-compiler/M2GenGCC.mod (FoldBecomes): Remove the call to
	RemoveQuad since this is performed by TypeCheckBecomes.
	* gm2-compiler/PCSymBuild.mod (buildConstFunction): Rewrite
	header comment.
	Check for a set or a type aliased set and appropriately
	skip type equivalences and obtain the element type.
	* gm2-compiler/SymbolTable.mod (PutConst): Add call to
	CheckBreak.

gcc/testsuite/ChangeLog:

	PR modula2/120117
	* gm2/pim/pass/highbit.mod: New test.
	* gm2/pim/pass/highbit2.mod: New test.

(cherry picked from commit bb83283e5c5c55eab7493a58c5e415aa56f5940c)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
5 files changed