public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108119] New: m2rte Seems like it should not be there at all
@ 2022-12-15  8:04 pinskia at gcc dot gnu.org
  2022-12-15  8:35 ` [Bug modula2/108119] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-15  8:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

            Bug ID: 108119
           Summary: m2rte Seems like it should not be there at all
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

The plugin usage in the gm2 driver is going to break if someone tries to
compile C or fortran code with it. I suspect it will also break using -flto
too.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte Seems like it should not be there at all
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
@ 2022-12-15  8:35 ` rguenth at gcc dot gnu.org
  2022-12-20 12:12 ` gaius at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-15  8:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It looks to me the plugin isn't needed to compile m2 programs, it's merely an
additional tool to diagnose invalid code (that is maybe never be reached at
runtime).  So I'd suggest to put this plugin use behind some driver option.

Alternatively the functionality could be lifted to the middle-end for example
by introducing an __attribute__((diagnose_if_invoked_on_function_entry))
that could then emit

warning: 'error' is always invoked when executing 'foo'

for

void __attribute__((diagnose_if_invoked_on_function_entry)) error ();

void foo ()
{
  error ();
}

but I understand the plugin does some whole-program analysis?  That won't
work with LTO at the point the plugin runs.

That said, the immediate thing to do would be to make the plugin build/run
dependent on plugin support.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte Seems like it should not be there at all
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
  2022-12-15  8:35 ` [Bug modula2/108119] " rguenth at gcc dot gnu.org
@ 2022-12-20 12:12 ` gaius at gcc dot gnu.org
  2022-12-20 12:13 ` gaius at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-12-20 12:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54131
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54131&action=edit
Disable m2plugin by default and add --enable-m2plugin configure

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte Seems like it should not be there at all
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
  2022-12-15  8:35 ` [Bug modula2/108119] " rguenth at gcc dot gnu.org
  2022-12-20 12:12 ` gaius at gcc dot gnu.org
@ 2022-12-20 12:13 ` gaius at gcc dot gnu.org
  2023-08-10  0:46 ` [Bug modula2/108119] m2rte plugin should be disabled by default egallager at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-12-20 12:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Here is a work in progress patch which will by default disable the m2 plugin. 
The plugin can be enabled via --enable-m2plugin if required.  The patch also
checks HAVE_PLUGIN and short circuits some of the testsuite regressions.

I've only tested it on m2 and amd64 currently and so will proceed to check all
languages full bootstrap.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte plugin should be disabled by default
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-12-20 12:13 ` gaius at gcc dot gnu.org
@ 2023-08-10  0:46 ` egallager at gcc dot gnu.org
  2023-08-12  3:48 ` gaius at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-08-10  0:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|m2rte Seems like it should  |m2rte plugin should be
                   |not be there at all         |disabled by default
   Last reconfirmed|                            |2023-08-10
                 CC|                            |egallager at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
m2rte just broke bootstrap for me, so I'm going to confirm this with a slightly
different title, and mark as ASSIGNED since there's an assignee

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte plugin should be disabled by default
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-10  0:46 ` [Bug modula2/108119] m2rte plugin should be disabled by default egallager at gcc dot gnu.org
@ 2023-08-12  3:48 ` gaius at gcc dot gnu.org
  2023-08-12 12:44 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-12  3:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #5 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 55730
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55730&action=edit
Proposed fix v2

Here is version 2 of the patch which disables the plugin by default.  The
testsuite expect scripts have been adjusted to add -fm2-plugin if necessary.
The expect scripts understand ENABLE_PLUGIN and will skip tests if necessary.
By default m2rte is not enabled in the gm2 driver.

Currently bootstrap testing on gcc-14 and gcc-13 for both --enable-plugin and
--disable-plugin.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte plugin should be disabled by default
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-12  3:48 ` gaius at gcc dot gnu.org
@ 2023-08-12 12:44 ` cvs-commit at gcc dot gnu.org
  2023-08-12 12:53 ` cvs-commit at gcc dot gnu.org
  2023-08-12 12:58 ` gaius at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-12 12:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #6 from CVS 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:46905fcde00fd84eb06b6bd1a6e788171d32865b

commit r14-3179-g46905fcde00fd84eb06b6bd1a6e788171d32865b
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Aug 12 13:43:14 2023 +0100

    PR modula2/108119 disable m2rte plugin by default

    This patch disables the m2rte plugin by default.  The driver
    will only append the -fplugin=m2rte command line option for cc1gm2
    if -fm2-plugin is present.  It only enabled providing ENABLE_PLUGIN
    is defined.  gcc/m2/Make-file.in will only build and install m2rte
    if enable_plugin is yes.

    gcc/m2/ChangeLog:

            PR modula2/108119
            * Make-lang.in (M2RTE_PLUGIN_SO): Assigned to
            plugin/m2rte$(exeext).so if enable_plugin is yes.
            (m2.all.cross): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2.all.encap): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2.install-plugin): Add dummy rule when enable_plugin
            is not yes.
            (plugin/m2rte$(exeext).so): Add dummy rule when enable_plugin
            is not yes.
            (m2/stage2/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2/stage1/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            * gm2spec.cc (lang_specific_driver): Set need_plugin to false
            by default.

    gcc/testsuite/ChangeLog:

            PR modula2/108119
            * gm2/iso/check/fail/iso-check-fail.exp (gm2_init_iso): Add
-fm2-plugin.
            * gm2/switches/auto-init/fail/switches-auto-init-fail.exp
            (gm2_init_iso): Add -fm2-plugin.
            * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp
            (gm2_init_pim2): Add -fm2-plugin.
            *
gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp
            (gm2_init_iso): Add -fm2-plugin.
            *
gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp
            (gm2_init_pim2): Add -fm2-plugin.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte plugin should be disabled by default
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-12 12:44 ` cvs-commit at gcc dot gnu.org
@ 2023-08-12 12:53 ` cvs-commit at gcc dot gnu.org
  2023-08-12 12:58 ` gaius at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-12 12:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:131d5ffd42497b84c2a3329b02e075732e4fd6d2

commit r13-7715-g131d5ffd42497b84c2a3329b02e075732e4fd6d2
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Aug 12 13:53:32 2023 +0100

    PR modula2/108119 disable m2rte plugin by default

    This patch disables the m2rte plugin by default.  The driver
    will only append the -fplugin=m2rte command line option for cc1gm2
    if -fm2-plugin is present.  It only enabled providing ENABLE_PLUGIN
    is defined.  gcc/m2/Make-file.in will only build and install m2rte
    if enable_plugin is yes.

    gcc/m2/ChangeLog:

            PR modula2/108119
            * Make-lang.in (M2RTE_PLUGIN_SO): Assigned to
            plugin/m2rte$(exeext).so if enable_plugin is yes.
            (m2.all.cross): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2.all.encap): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2.install-plugin): Add dummy rule when enable_plugin
            is not yes.
            (plugin/m2rte$(exeext).so): Add dummy rule when enable_plugin
            is not yes.
            (m2/stage2/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            (m2/stage1/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
            $(M2RTE_PLUGIN_SO).
            * gm2spec.cc (lang_specific_driver): Set need_plugin to false
            by default.

    gcc/testsuite/ChangeLog:

            PR modula2/108119
            * gm2/iso/check/fail/iso-check-fail.exp (gm2_init_iso): Add
-fm2-plugin.
            * gm2/switches/auto-init/fail/switches-auto-init-fail.exp
            (gm2_init_iso): Add -fm2-plugin.
            * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp
            (gm2_init_pim2): Add -fm2-plugin.
            *
gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp
            (gm2_init_iso): Add -fm2-plugin.
            *
gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp
            (gm2_init_pim2): Add -fm2-plugin.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug modula2/108119] m2rte plugin should be disabled by default
  2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-08-12 12:53 ` cvs-commit at gcc dot gnu.org
@ 2023-08-12 12:58 ` gaius at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-12 12:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now that the patch has been applied on gcc-13 and bootstrapped
successfully on ppc64le.  Patch also applied to gcc-14 and bootstrapped on
x86_64 and aarch64 successfully.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-12 12:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15  8:04 [Bug modula2/108119] New: m2rte Seems like it should not be there at all pinskia at gcc dot gnu.org
2022-12-15  8:35 ` [Bug modula2/108119] " rguenth at gcc dot gnu.org
2022-12-20 12:12 ` gaius at gcc dot gnu.org
2022-12-20 12:13 ` gaius at gcc dot gnu.org
2023-08-10  0:46 ` [Bug modula2/108119] m2rte plugin should be disabled by default egallager at gcc dot gnu.org
2023-08-12  3:48 ` gaius at gcc dot gnu.org
2023-08-12 12:44 ` cvs-commit at gcc dot gnu.org
2023-08-12 12:53 ` cvs-commit at gcc dot gnu.org
2023-08-12 12:58 ` 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).