https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119449

            Bug ID: 119449
           Summary: MAX of SYSTEM.REAL64 cause an ICE
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

Forwarded from the gm2 mailing list:

$ cat num_experiment.mod

MODULE num_experiment;
    IMPORT FpuIO;
    IMPORT NumberIO;
    IMPORT StrIO;
    IMPORT SYSTEM;

    VAR a: REAL;
    VAR b: SYSTEM.REAL64;

 BEGIN
    StrIO.WriteString("REAL: ");
    FpuIO.WriteReal(MAX(REAL), 200, 30);
    StrIO.WriteLn;

    StrIO.WriteString("LONGREAL: ");
    FpuIO.WriteLongReal(MAX(LONGREAL), 200, 30);
    StrIO.WriteLn;
 (*
    StrIO.WriteString("SYSTEM.REAL64: ");
    FpuIO.WriteReal(MAX(SYSTEM.REAL64), 200, 30);
    StrIO.WriteLn;
 *)
    StrIO.WriteString("SYSTEM.REAL64: ");
    FpuIO.WriteLongReal(MAX(SYSTEM.REAL64), 200, 30);
    StrIO.WriteLn;
 END num_experiment.

>> Compile example:

>> $ ninja
>> [1/1] gm2 -g -Wall -fpim -fcase -ffloatvalue -findex -frange
>> -freturn -freport-bug num_experiment.mod -o demo
>> FAILED: demo
>> gm2 -g -Wall -fpim -fcase -ffloatvalue -findex -frange -freturn
>> -freport-bug num_experiment.mod -o demo
>> cc1gm2: internal compiler error: assert failed
>> 0x2663227 internal_error(char const*, ...)
>> ../../gcc-14.2/gcc/diagnostic-global-context.cc:517
>> 0xa0d8a4 m2linemap_internal_error
>> ../../gcc-14.2/gcc/m2/gm2-gcc/m2linemap.cc:254
>> 0xadd628 M2Emit_InternalError
>> m2/gm2-compiler-boot/M2Emit.c:104
>> 0xa39e4b M2Error_InternalError
>> m2/gm2-compiler-boot/M2Error.c:929
>> 0xa37d17 M2Debug_Assert
>> m2/gm2-compiler-boot/M2Debug.c:65
>> 0xa9c6e7 doGetType
>> m2/gm2-compiler-boot/SymbolTable.c:6420
>> 0xa9c898 SymbolTable_GetSType
>> m2/gm2-compiler-boot/SymbolTable.c:12204
>> 0xa66337 BuildMaxFunction
>> m2/gm2-compiler-boot/M2Quads.c:12330
>> 0xa71dd7 BuildPseudoFunctionCall
>> m2/gm2-compiler-boot/M2Quads.c:10366
>> 0xa71dd7 M2Quads_BuildFunctionCall
>> m2/gm2-compiler-boot/M2Quads.c:19110
>> 0xab1d86 SetOrDesignatorOrFunction
>> m2/gm2-compiler-boot/P3Build.c:7011
>> 0xab1d86 Factor
>> m2/gm2-compiler-boot/P3Build.c:6907
>> 0xab1dc9 Term
>> m2/gm2-compiler-boot/P3Build.c:6864
>> 0xab1ed4 UnaryOrTerm
>> m2/gm2-compiler-boot/P3Build.c:6842
>> 0xab1ed4 SimpleExpression
>> m2/gm2-compiler-boot/P3Build.c:6795
>> 0xab20cb Expression
>> m2/gm2-compiler-boot/P3Build.c:6770
>> 0xab21cb ExpList
>> m2/gm2-compiler-boot/P3Build.c:6731
>> 0xab21cb ActualParameters
>> m2/gm2-compiler-boot/P3Build.c:7067
>> 0xab390a AssignmentOrProcedureCall
>> m2/gm2-compiler-boot/P3Build.c:7300
>> 0xab390a Statement
>> m2/gm2-compiler-boot/P3Build.c:7160
>> Please submit a full bug report, with preprocessed source.
>> Please include the complete backtrace with any bug report.

Reply via email to