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"); } ;