https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119449
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>: https://gcc.gnu.org/g:127a24ede2f82eafecb5eb142e21dbda38d06c18 commit r15-8877-g127a24ede2f82eafecb5eb142e21dbda38d06c18 Author: Gaius Mulley <gaiusm...@gmail.com> Date: Tue Mar 25 02:08:05 2025 +0000 PR modula2/119449 MAX of SYSTEM.REAL64 cause an ICE This bugfix implements MAX(REAL64) and MIN(REAL64) etc for REAL64, REAL96 and REAL128. gcc/m2/ChangeLog: PR modula2/119449 * gm2-compiler/M2GCCDeclare.def (TryDeclareType): Remove tokenno parameter. * gm2-compiler/M2GCCDeclare.mod (TryDeclareType): Ditto. * gm2-compiler/M2GenGCC.mod (FoldTBitsize): Remove op2 and rename op1 as res and op3 as type. (FoldStandardFunction): Call FoldTBitsize omitting op2. * gm2-compiler/M2Quads.mod (GetTypeMin): Rewrite. (GetTypeMinLower): New procedure function. (GetTypeMax): Rewrite. (GetTypeMaxLower): New procedure function. * gm2-compiler/M2Range.mod (CheckCancelled): Comment out. * gm2-compiler/M2System.mod (CreateMinMaxFor): Add realtype parameter. (MapType): Rewrite to use realtype. (CreateType): Ditto. (AttemptToCreateType): Ditto. (MakeFixedSizedTypes): Add realtype boolean. (InitPIMTypes): Ditto. (InitISOTypes): Ditto. (MakeExtraSystemTypes): Ditto. * gm2-gcc/m2pp.cc (m2pp_nop_expr): Remove code. * gm2-gcc/m2type.cc (IsGccRealType): New function. (m2type_GetMinFrom): Rewrite. (m2type_GetMaxFrom): Ditto. (do_min_real): Declare static. (do_max_real): Declare static. gcc/testsuite/ChangeLog: PR modula2/119449 * gm2/pim/pass/minmaxreal.mod: New test. * gm2/pim/pass/minmaxreal2.mod: New test. * gm2/pim/pass/minmaxreal3.mod: New test. Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>