[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Compiler crash getting maximal exponent of LONGREAL
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Compiler crash getting maximal exponent of LONGREAL |
Date: |
Mon, 30 Nov 2015 12:21:07 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Michael Riedl <address@hidden> writes:
> Hallo Gaius,
>
> the following short sample
>
> MODULE MaxExp;
>
> (* Get maximal decimal exponent of a LONGREAL *)
>
> IMPORT LongMath;
> IMPORT STextIO;
> IMPORT SWholeIO;
>
> VAR nexp : CARDINAL;
>
> BEGIN
> (* Compiler crash *)
> nexp := TRUNC(LongMath.ln(MAX(LONGREAL)) / LongMath.ln(10.0));
>
> STextIO.WriteLn; STextIO.WriteLn;
> STextIO.WriteString("hugest exponent of LONGREAL is = ");
> SWholeIO.WriteCard(nexp,5);
> STextIO.WriteLn; STextIO.WriteLn;
> END MaxExp.
>
> causes gm2 to crash with:
>
> gm2 -c -fiso -flibs=iso -I
> /opt/gm2/lib/gcc/i586-linux-gnu/4.7.4/m2/iso -I
> /opt/gm2/lib/gcc/i586-linux-gnu/4.7.4/m2/pim -L /opt/gm2/libs
> MaxExp.mod
> cc1gm2: internal compiler error: tree check: expected integer_cst,
> have fix_trunc_expr in tree_int_cst_lt, at tree.c:6485
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> make: *** [MaxExp.o] Error 1
>
> You can use "VAL(CARDINAL, ... );" instead of TRUNC( ... );" with the
> same result.
>
> Gruß
>
> Michael
Hi Michael,
thank you for the new test code! Will fix this as well,
regards,
Gaius