public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/114295] New: incorrect error location if attempting to compile implementation module without a definition module
@ 2024-03-10 10:29 gaius at gcc dot gnu.org
2024-03-11 12:11 ` [Bug modula2/114295] " gaius at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-03-10 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114295
Bug ID: 114295
Summary: incorrect error location if attempting to compile
implementation module without a definition module
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: gaius at gcc dot gnu.org
Target Milestone: ---
When attempting to compile an implementation module and the definition module
cannot be found the compiler reports the error in the SYSTEM module:
gm2 -g -c impls/UTF8.mod
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.1/m2/m2cor/SYSTEM.def:27:19:
error: the file containing the definition module ‘UTF8’ cannot be found
27 | DEFINITION MODULE SYSTEM ;
| ^~~~~~
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug modula2/114295] incorrect error location if attempting to compile implementation module without a definition module
2024-03-10 10:29 [Bug modula2/114295] New: incorrect error location if attempting to compile implementation module without a definition module gaius at gcc dot gnu.org
@ 2024-03-11 12:11 ` gaius at gcc dot gnu.org
2024-03-11 15:22 ` cvs-commit at gcc dot gnu.org
2024-03-11 15:22 ` gaius at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-03-11 12:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114295
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2024-03-11
--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug modula2/114295] incorrect error location if attempting to compile implementation module without a definition module
2024-03-10 10:29 [Bug modula2/114295] New: incorrect error location if attempting to compile implementation module without a definition module gaius at gcc dot gnu.org
2024-03-11 12:11 ` [Bug modula2/114295] " gaius at gcc dot gnu.org
@ 2024-03-11 15:22 ` cvs-commit at gcc dot gnu.org
2024-03-11 15:22 ` gaius at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-11 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114295
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:8410402272038aae7e4b2bd76df38607a78cad95
commit r14-9429-g8410402272038aae7e4b2bd76df38607a78cad95
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Mon Mar 11 15:21:42 2024 +0000
PR modula2/114295 Incorrect location if compiling implementation without
definition
This patch fixes a bug which occurred if gm2 was asked to compile an
implementation module and could not find the definition module. The error
location would be set to the SYSTEM module. The bug occurred as the
module sym was created during the peep phase after which the few tokens are
destroyed and recreated during parsing. The bug fix is to call
PutDeclared when the module is encountered during parsing which updates
the tokenno associated with the module.
gcc/m2/ChangeLog:
PR modula2/114295
* gm2-compiler/M2Batch.mod (MakeProgramSource): Call PutDeclared
if the module is known.
(MakeDefinitionSource): Ditto.
(MakeImplementationSource): Ditto.
* gm2-compiler/M2Comp.mod (ExamineHeader): New procedure.
(ExamineCompilationUnit): Rewrite.
(PeepInto): Rewrite.
* gm2-compiler/M2Error.mod (NewError): Remove default call to
GetTokenNo.
* gm2-compiler/M2Quads.mod (callRequestDependant): Push tokno with
Adr.
(BuildStringAdrParam): Ditto.
(doBuildBinaryOp): Push OperatorPos on the bool stack.
(BuildRelOp): Ditto.
* gm2-compiler/P2Build.bnf (SetType): Pass set token pos to
BuildSetType.
(PointerType): Pass pointer token pos to BuildPointerType.
* gm2-compiler/P2SymBuild.def (BuildPointerType): Add parameter
pointerpos.
(BuildSetType): Add parameter setpos.
* gm2-compiler/P2SymBuild.mod (BuildPointerType): Add parameter
pointerpos. Build combined token and use it when creating a
pointer type.
(BuildSetType): Add parameter setpos. Build combined token and
use it when creating a set type.
* gm2-compiler/SymbolTable.mod (DebugUnknownToken): New constant.
(CheckTok): New procedure function.
(MakeProcedure): Call CheckTok.
(MakeRecord): Ditto.
(MakeVarient): Ditto.
(MakeEnumeration): Ditto.
(MakeHiddenType): Ditto.
(MakeConstant): Ditto.
(MakeConstStringCnul): Ditto.
(MakeSubrange): Ditto.
(MakeTemporary): Ditto.
(MakeVariableForParam): Ditto.
(MakeParameterHeapVar): Ditto.
(MakePointer): Ditto.
(MakeSet): Ditto.
(MakeUnbounded): Ditto.
(MakeProcType): Ditto.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug modula2/114295] incorrect error location if attempting to compile implementation module without a definition module
2024-03-10 10:29 [Bug modula2/114295] New: incorrect error location if attempting to compile implementation module without a definition module gaius at gcc dot gnu.org
2024-03-11 12:11 ` [Bug modula2/114295] " gaius at gcc dot gnu.org
2024-03-11 15:22 ` cvs-commit at gcc dot gnu.org
@ 2024-03-11 15:22 ` gaius at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-03-11 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114295
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now the patch has been applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-11 15:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-10 10:29 [Bug modula2/114295] New: incorrect error location if attempting to compile implementation module without a definition module gaius at gcc dot gnu.org
2024-03-11 12:11 ` [Bug modula2/114295] " gaius at gcc dot gnu.org
2024-03-11 15:22 ` cvs-commit at gcc dot gnu.org
2024-03-11 15:22 ` gaius at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).