GPC compiler crash

Thomas Schneider <[email protected]>
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
Folks:

I discovered a program that crashes the GPC compiler, attached.

Regards,

Tom

  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Frederick National Laboratory for Cancer Research
  Gene Regulation and Chromosome Biology Laboratory
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  [email protected]
  http://alum.mit.edu/www/toms

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
trimdiana.p (text/plain, 2.5 KB)
program trimdiana (da, output);
(* trimdiana: gpc crash

This Pascal program demonstrates an internal error crash of the Gnu
Pascal Compiler.  The crash occurs when one attempts to compile:

% gpc trimdiana.p
gpc: Internal error: Illegal instruction: 4 (program gpc1)
Please submit a full bug report.
See <URL:http://www.gnu-pascal.de/todo.html> for instructions.

This program is an extensively trimmed version of
http://alum.mit.edu/www/toms/delila/diana.html
setting 'trimax = 8006000' in that program is also sufficient
to cause the problem.

Tom

  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Frederick National Laboratory for Cancer Research
  Gene Regulation and Chromosome Biology Laboratory
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  [email protected]
  http://alum.mit.edu/www/toms

*)

const
   version = 2.17; 

(* THE KEY POINT: if trimax is 25000, gpc compiles ok.
If it is 8006000, gpc gives:

gpc: Internal error: Illegal instruction: 4 (program gpc1)
Please submit a full bug report.
See <URL:http://www.gnu-pascal.de/todo.html> for instructions.

*)
{ compile is ok with this value:
   trimax = 25000; (* the maximum number of data points *)
}
   trimax = 8006000; (* the maximum number of data points *)
   infofield = 6; (* real number field width *)
   infodecim = 5; (* number of decimal points *)

type

   (* define the four nucleotide bases *)
   base = (a,c,g,t);

   (* define a triangular array as a linear one *)
   trianglearray = record
      data: array[0..trimax] of integer;
      lower: integer; (* lower bound on the triangle *)
      upper: integer; (* upper bound on the triangle *)
      side: integer;  (* length of side of the triangle *)
      area: integer;  (* area of the triangle *)
   end;

   (* stores the number of dinucleotides appearing at positions on a sequence *)
   trisquare = array[a..t,a..t] of trianglearray;

var

   da: text; (* output file *)

procedure writeprism(var dianalysis: text; dataprism: trisquare);
begin
   writeln(dianalysis,'* sum of Rcorrelation ... bits');
end;

(* ********************************************************************* *)

procedure themain(var da: text);
var
  dataprism: trisquare;   (* the data structure for diana *)

begin
   writeln(output,' trimdiana -gpc bug',version:4:2);

{ It is necessary to call the procedure with the variable to cause
the gpc compile problem: }

   writeprism(da,dataprism);
end;

begin
   themain(da);
end.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.