gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Internal error on simple program


From: Waldek Hebisch
Subject: [Gm2] Internal error on simple program
Date: Sat, 22 Nov 2003 16:22:11 +0100 (MET)

The following simple program:
MODULE tst2;
PROCEDURE tst1;
TYPE ind0 = [-100..100];
CONST low = ind0(-100);
BEGIN
END tst1;

BEGIN
  tst1
END tst2
.

Couses internal error in gm2:
hebisch$ ../gm2-lin/gcc/xgm2 -v -c --save-temps -O2 -B../gm2-lin/gcc tst2.mod
Reading specs from ../gm2-lin/gcc/specs
Configured with: ../gcc-3.3.1/configure --enable-checking 
--enable-languages=c,gm2
Thread model: posix
gcc version 3.3.1
 ../gm2-lin/gcc/cc1gm2 -quiet -dumpbase tst2.mod -auxbase tst2 -O2 -version 
-I/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/gm2/pim:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/gm2/iso
 tst2.mod -o tst2.s
GNU Modula-2 version 3.3.1 (i686-pc-linux-gnu)
        compiled by GNU C version 2.95.4 20011002 (Debian prerelease).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129147
gm2  [0.40b (address@hidden)] [Tue Oct 14 02:26:46 2003]
../../gcc-3.3.1/gcc/gm2/gm2-compiler/M2GenGCC.mod:1336:*** internal error *** 
expecting symbol to be resolved

I compiled gm2 from `gm2-cvs-20031013.tar.gz' snapshot. 
By the way, the following variant:
MODULE tst5;
TYPE ind0 = [-100..100];
CONST low = ind0(-100);
CONST high = ind0(100);
TYPE ind = [low..high];
VAR a : ARRAY [0..100] OF INTEGER;
VAR b : ARRAY ind OF INTEGER;
BEGIN
END tst5
.

is rejected by gm2 with error message:
tst5.mod:5:circular dependancy found when trying to resolve symbol ind

Note that both programs were actually attempts to break the compiler.
I wanted array indices to have lower precision then machine words. I
have noticed that gm2 promotes variables (in `default_conversion'), but
leaves constants alone, so I have tried to make constants of lower 
precision.
 
-- 
                              Waldek Hebisch
address@hidden 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]