gm2
[Top][All Lists]
Advanced

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

Re: Guidance requested on narrowing down internal compiler error


From: john o goyo
Subject: Re: Guidance requested on narrowing down internal compiler error
Date: Sat, 30 Mar 2024 14:56:13 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

Greetings, Gaius.

On 2024-03-28 14:10, Gaius Mulley wrote:
john o goyo <jog37@riddermarkfarm.ca> writes:

Greetings, Gaius.

Compiling a legacy module gave me the following error.

cc1gm2: internal compiler error: not implemented yet
0x6d267f m2linemap_internal_error
/home/build/opt/gcc/src/gcc-git/gcc/m2/gm2-gcc/m2linemap.cc:253
[...]
0x772a9b Type
         m2/gm2-compiler-boot/P2Build.c:4179
0x775293 Definition
         m2/gm2-compiler-boot/P2Build.c:7145
Please submit a full bug report, with preprocessed source (by using
-freport-bug).

The problem is that no line number is reported.  Is there a gm2 option
that allows me to narrow it done?  (The module is 300 lines long.)

Sincerely,
john
Hi John,

there isn't an option - but this is a good idea to introduce one.  If
you are stuck - you could try:

$ gm2 -fdebug-function-line-numbers hello.mod

after you've added the following patch:

=================================================
diff --git a/gcc/m2/gm2-compiler/P2Build.bnf b/gcc/m2/gm2-compiler/P2Build.bnf
index d69ce2cf17e..ed094d86313 100644
--- a/gcc/m2/gm2-compiler/P2Build.bnf
+++ b/gcc/m2/gm2-compiler/P2Build.bnf
@@ -52,6 +52,7 @@ FROM M2Reserved IMPORT tokToTok, toktype, NulTok, ImportTok, 
ExportTok, Qualifie
  FROM DynamicStrings IMPORT String, InitString, KillString, Mark, ConCat, 
ConCatChar ;
  FROM M2Printf IMPORT printf0 ;
  FROM M2Debug IMPORT Assert ;
+FROM M2Options IMPORT DebugFunctionLineNumbers ;
FROM M2Quads IMPORT PushT, PopT, PushTF, PopTF, PopNothing, OperandT, PushTFA, Top, Annotate,
                      PushTFtok, PopTFtok, PushTFAtok, PopTtok, PushTtok,
@@ -365,6 +366,10 @@ BEGIN
        IF Pass1
        THEN
           PeepToken(stopset0, stopset1, stopset2)
+      END ;
+      IF DebugFunctionLineNumbers
+      THEN
+         ErrorArray ('{%O}pass 2 trace')
        END
     ELSE
        MissingToken(t)
=================================================

$ rm build/gcc/m2/gm2-compiler-boot/P2Build.*
$ make && make install

This will generate a trace of each token during pass 2

regards,
Gaius

The patch does not quite work as I expected.

Here is Test.mod:

MODULE Test;

IMPORT SYSTEM;

BEGIN
END Test.

Here is the output from "gm2-git -fdebug-function-line-numbers  -c Test.mod" :


/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:27:12: note: In definition module â: pass 2 trace
   27 | DEFINITION MODULE SYSTEM ;
      |            ^~~~~~
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:27:19: note: In definition module â: pass 2 trace
   27 | DEFINITION MODULE SYSTEM ;
      |                   ^~~~~~
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:27:26: note: pass 2 trace
   27 | DEFINITION MODULE SYSTEM ;
      |                          ^
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:34:1: note: pass 2 trace
   34 | FROM COROUTINES IMPORT PROTECTION ;
[...]
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:306:47: note: pass 2 trace
  306 |                        RotateCount: CARDINAL) ;
      |                                               ^
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:309:1: note: In definition module â: pass 2 trace
  309 | END SYSTEM.
      | ^~~
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:309:5: note: pass 2 trace
  309 | END SYSTEM.
      |     ^~~~~~
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:309:11: note: pass 2 trace
  309 | END SYSTEM.
      |           ^
/home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:310:1: note: In definition module â: pass 2 trace /home/build/gcc/git/lib/gcc/sparc-sun-solaris2.11/14.0.1/m2/m2cor/SYSTEM.def:310:1: error: compilation failed


However, "gm2-git -c Test.mod" compiles without complaint.

Sincerely,
john




reply via email to

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