public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/102343] gm2/cpp/pass/subaddr.mod FAILs for non-default multilib Date: Wed, 25 Jan 2023 15:24:25 +0000 [thread overview] Message-ID: <bug-102343-4-SbsRtsx4er@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102343-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102343 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>: https://gcc.gnu.org/g:80cf2c5e8f496bed9c6facf55f9ae31d0d90fd28 commit r13-5373-g80cf2c5e8f496bed9c6facf55f9ae31d0d90fd28 Author: Iain Sandoe <iain@sandoe.co.uk> Date: Mon Jan 16 14:07:20 2023 +0000 modula-2: Fixes for preprocessing [PR102343, PR108182]. Modula-2 uses the C preprocessor to implement handling for conditional code and macros. However, this is not done directly, because the process is applied recursively to imported definitions and modules. The cc1gm2 executable records the parameters as a template command line needed to create a composite 'cc1 -E' for each file to be preprocessed starting with the main file from the original command line. This patch fixes the capture of the C preprocessor template to include the target information needed for correct multilib operation. In order to match the existing semantics of '-E, -M and -MM' these have to be handled as a 'pre-processor only' job (i.e. the recursion is omitted and only the main file is processed). Whereas C-family front ends always pre-process, Modula-2 only does so when specifically requested (via the -fcpp option). '-MD, -MMD and -MQ' also require special handling, since (in principle) these options can be applied to any command line (with -fcpp) providing dependency information as a by-product. TODO: the preprocessor is not able to determine def and mod dependencies for Modula-2 and so the output of this only shows the object to module dep. We should be able to append the .def and .mod dependencies. The patch amends save-temps handling to cater for the preprocessor recursion and to avoid writing saved files into the source directories. The patch changes the extension for Modula-2 preprocessed source to .m2i to avoid clashes with .i. The main driver code is amended to add default handlers for .mod and .m2i so that a useful error message will be emitted if the Modula-2 compiler is not built-in. The compiler will now also handle code generation from a .m2i preprocessed source. TODO: We should not need to pass the '-c' option to the compiler to alter the processing of init code. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR modula2/102343 PR modula2/108182 gcc/ChangeLog: * gcc.cc: Provide default specs for Modula-2 so that when the language is not built-in better diagnostics are emitted for attempts to use .mod or .m2i file extensions. gcc/m2/ChangeLog: * gm2-compiler/M2Comp.mod: Early exit for pre-processor-only jobs. * gm2-compiler/M2Options.def (SetPPOnly, GetPPOnly, SetMD, GetMD, SetMMD, GetMMD, SetMQ, GetMQ, SetObj, GetObj, SetDumpDir, GetDumpDir):New. * gm2-compiler/M2Options.mod:(SetPPOnly, GetPPOnly, SetMD, GetMD, SetMMD, GetMMD, SetMQ, GetMQ, SetObj, GetObj, SetDumpDir, GetDumpDir):New. * gm2-compiler/M2Preprocess.def (PreprocessModule): Add flag to indicate the main file. * gm2-compiler/M2Preprocess.mod: Handle Preprocess-only jobs, handle MD, MMD and MQ options. * gm2-gcc/m2options.h (M2Options_SetPPOnly, M2Options_GetPPOnly, M2Options_SetDumpDir, M2Options_SetMD, M2Options_GetMD, M2Options_SetMMD, M2Options_GetMMD, M2Options_SetMQ, M2Options_GetMQ, M2Options_SetObj, M2Options_GetObj): New. * gm2-gcc/m2type.cc (m2type_InitBaseTypes): Early exit for pre- processor-only jobs. * gm2-lang.cc (gm2_langhook_init): Handle preprocess-only commands. (gm2_langhook_option_lang_mask): Claim C and Driver options so that we can intercept them for building pre-processor commands. (gm2_langhook_init_options): Collect the preprocessor line here. Save options that have different actions for preprocessor and compile commands. (gm2_langhook_handle_option): Only handle the modula-2 options here. (gm2_langhook_post_options): Do not create a back-end for pre- processor-only jobs. * gm2spec.cc (lang_specific_driver): Ignore PCH options, append a scaffold-main for cases where we are building a main module with -c. * lang-specs.h: Revise to handle preprocessor-only jobs and to consume pre-processed files. * lang.opt: Remove Driver and C options copies (we claim these separately).
next prev parent reply other threads:[~2023-01-25 15:24 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-15 11:15 [Bug modula2/102343] New: " ro at gcc dot gnu.org 2023-01-17 15:18 ` [Bug modula2/102343] " iains at gcc dot gnu.org 2023-01-17 16:52 ` iains at gcc dot gnu.org 2023-01-22 0:22 ` iains at gcc dot gnu.org 2023-01-25 15:24 ` cvs-commit at gcc dot gnu.org [this message] 2023-01-25 15:45 ` iains at gcc dot gnu.org 2023-01-27 8:48 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-102343-4-SbsRtsx4er@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).