public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115020] New: [modules] ICE in import_export_decl for GMF function definition in partition
@ 2024-05-10  2:14 nshead at gcc dot gnu.org
  2024-08-20  7:15 ` [Bug c++/115020] " cvs-commit at gcc dot gnu.org
  2024-08-20  7:17 ` nshead at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-05-10  2:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115020
           Summary: [modules] ICE in import_export_decl for GMF function
                    definition in partition
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nshead at gcc dot gnu.org
            Blocks: 103524
  Target Milestone: ---

The following sample ICEs on trunk:


  // a.cpp
  module;
  class Check { static void assertion(); };
  void Check::assertion() {}
  export module M:a;
  export using ::Check;

  // m.cpp
  module;
  struct Check { static void assertion(); };
  export module M;
  export import :a;
  void foo() { Check::assertion(); }


With 'g++ -fmodules-ts -Wno-global-module -S a.cpp m.cpp':

m.cpp:5:34: internal compiler error: in import_export_decl, at cp/decl2.cc:3430
    5 | void foo() { Check::assertion(); }
      |                                  ^
0xf4c543 import_export_decl(tree_node*)
        ../../gcc/gcc/cp/decl2.cc:3430
0xf5429b c_parse_final_cleanups()
        ../../gcc/gcc/cp/decl2.cc:5325
0x1322ee7 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.cc:1329


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue

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

* [Bug c++/115020] [modules] ICE in import_export_decl for GMF function definition in partition
  2024-05-10  2:14 [Bug c++/115020] New: [modules] ICE in import_export_decl for GMF function definition in partition nshead at gcc dot gnu.org
@ 2024-08-20  7:15 ` cvs-commit at gcc dot gnu.org
  2024-08-20  7:17 ` nshead at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-20  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

https://gcc.gnu.org/g:c1a53d9dcf9ebf0a6b4528a8c3eae48a583f272c

commit r15-3033-gc1a53d9dcf9ebf0a6b4528a8c3eae48a583f272c
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Sat Aug 17 22:37:30 2024 +1000

    c++/modules: Disable streaming definitions of non-vague-linkage GMF decls
[PR115020]

    The error in the linked PR is caused because 'DECL_THIS_STATIC' is true
    for the static member function, causing the streaming code to assume
    that this is an internal linkage GM entity that needs to be explicitly
    streamed, which then on read-in gets marked as a vague linkage function
    (despite being non-inline) causing import_export_decl to complain.

    However, I don't see any reason why we should care about this:
    definitions in the GMF should just be emitted as per usual regardless of
    whether they're internal-linkage or not.  Actually the only thing we
    care about here are header modules, since they have no TU to write
    definitions into.  As such this patch removes these conditions from
    'has_definition' and updates some comments to clarify.

            PR c++/115020

    gcc/cp/ChangeLog:

            * module.cc (has_definition): Only force writing definitions for
            header_module_p.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr115020_a.C: New test.
            * g++.dg/modules/pr115020_b.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
    Reviewed-by: Jason Merrill <jason@redhat.com>

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

* [Bug c++/115020] [modules] ICE in import_export_decl for GMF function definition in partition
  2024-05-10  2:14 [Bug c++/115020] New: [modules] ICE in import_export_decl for GMF function definition in partition nshead at gcc dot gnu.org
  2024-08-20  7:15 ` [Bug c++/115020] " cvs-commit at gcc dot gnu.org
@ 2024-08-20  7:17 ` nshead at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-08-20  7:17 UTC (permalink / raw)
  To: gcc-bugs

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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot gnu.org
   Target Milestone|---                         |15.0
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Fixed for GCC 15.

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

end of thread, other threads:[~2024-08-20  7:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-10  2:14 [Bug c++/115020] New: [modules] ICE in import_export_decl for GMF function definition in partition nshead at gcc dot gnu.org
2024-08-20  7:15 ` [Bug c++/115020] " cvs-commit at gcc dot gnu.org
2024-08-20  7:17 ` nshead 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).