REVISION -- Note: I included the lister.i file as a zip because it is over 11,000 lines long.
Hello. I am attempting to compile a program named lister.p, that does some genomic work. I can compile some programs in this suite while others always generate an error. I'm not much of a pascal programmer, it's been 15 years since I actually wrote anything in it, but a group of researchers here would like to get this working. Any help will be very much appreciated!
Thanks! Todd
I am compiling on Mac OS X. Here are my specs.
$ uname -a Darwin seed.cmh.edu 7.6.0 Darwin Kernel Version 7.6.0: Sun Oct 10 12:05:27 PDT 2004; root:xnu/xnu-517.9.4.obj~1/RELEASE_PPC Power Macintosh powerpc
$ gcc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs Thread model: posix gcc version 3.3 20030304 (Apple Computer, Inc. build 1666)
$ gpc -v
Reading specs from /Developer/Pascal/gpc332d1/lib/gcc-lib/powerpc-apple-darwin/3.3.2/specs Configured with: ../gpc-332d1/configure --enable-languages=pascal,c --prefix=/Developer/Pascal/gpc332d1 --enable-threads=posix --target=powerpc-apple-darwin Thread model: posix gpc version 20030830, based on gcc-3.3.2
I ran gpc with the following command line:
gpc -x Pascal -save-temps lister.p -o lister
lister.p: In procedure `showpiece': lister.p:7730: internal compiler error: in find_function_data, at function.c:317 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions.
Fiedler, Todd, A wrote:
lister.p: In procedure `showpiece': lister.p:7730: internal compiler error: in find_function_data, at function.c:317 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions.
Reproducable with the latest gpc sources on Mac OS X.
Regards,
Adriaan van Os
Fiedler, Todd, A wrote:
I ran gpc with the following command line:
gpc -x Pascal -save-temps lister.p -o lister
lister.p: In procedure `showpiece': lister.p:7730: internal compiler error: in find_function_data, at function.c:317 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions.
The problem is that GPC lost track of variables. More precisely, the line (in procedure printfeature):
with f^, f^.definition^ do begin
confused GPC. As a workaround you may replace it by:
with f^ do with f^.definition^ do begin
The following patch should fix the problem (note that to re-compile GPC with this patch you need bison-1.875c, eariler versions do not work).
--- p.bb/parse.y 2004-10-20 01:54:16.000000000 +0200 +++ p/parse.y 2004-12-02 07:29:19.429053896 +0100 @@ -1625,11 +1625,11 @@ with_list: with_variable | with_list ',' with_variable - { $$ = chainon ($1, $3); yyerrok; } + { $$ = chainon ($3, $1); yyerrok; } | error { $$ = NULL_TREE; } | with_list error with_variable - { $$ = chainon ($1, $3); error ("missing comma"); yyerrok; } + { $$ = chainon ($3, $1); error ("missing comma"); yyerrok; } | with_list ',' error { error ("extra comma"); } ;
Waldek Hebisch wrote:
Fiedler, Todd, A wrote:
I ran gpc with the following command line:
gpc -x Pascal -save-temps lister.p -o lister
lister.p: In procedure `showpiece': lister.p:7730: internal compiler error: in find_function_data, at function.c:317 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions.
The problem is that GPC lost track of variables. More precisely, the line (in procedure printfeature):
with f^, f^.definition^ do begin
confused GPC. As a workaround you may replace it by:
with f^ do with f^.definition^ do begin
Why not write simply:
WITH f^, definition^ DO BEGIN
or, for completely positive usage, use:
WITH f^ DO WITH definition^ DO BEGIN ... END; ...