[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guidance requested on narrowing down internal compiler error
From: |
Gaius Mulley |
Subject: |
Re: Guidance requested on narrowing down internal compiler error |
Date: |
Thu, 28 Mar 2024 18:10:51 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
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