public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree
@ 2022-01-25 23:09 nemanjab at amazon dot com
  2023-01-24  3:27 ` [Bug c++/104234] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: nemanjab at amazon dot com @ 2022-01-25 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104234
           Summary: ICE with -fmodules-ts and std::map/_Rb_tree
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nemanjab at amazon dot com
  Target Milestone: ---

Hello,

I found an ICE with -fmodules-ts and reduced it to:

```
template <typename> struct _Node_handle_common {
  template <typename> friend class _Rb_tree;
};
struct _Hashtable {
  using node_type = _Node_handle_common<int>;
  node_type __trans_tmp_1;
};
template <typename> struct _Rb_tree {
  struct _Rb_tree_impl {
    _Rb_tree_impl();
  } _M_impl;
};
_Rb_tree<int> _M_tmap_;
```

gcc version 12.0.1 20220125/master, fails with gcc version 11.2.0 as well:

```
repro.cpp:8:28: internal compiler error: tree check: expected class ‘type’,
have ‘declaration’ (type_decl) in get_originating_module_decl, at
cp/module.cc:18339
    8 | template <typename> struct _Rb_tree {
      |                            ^~~~~~~~
0x90b6a5 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.cc:8752
0x76bfb2 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc/gcc/tree.h:3564
0x76bfb2 get_originating_module_decl(tree_node*)
        ../../gcc/gcc/cp/module.cc:18339
0xb10ea7 get_originating_module(tree_node*, bool)
        ../../gcc/gcc/cp/module.cc:18378
0xae670c maybe_write_module
        ../../gcc/gcc/cp/mangle.cc:901
0xae670c write_name
        ../../gcc/gcc/cp/mangle.cc:969
0xae8f16 write_encoding
        ../../gcc/gcc/cp/mangle.cc:811
0xae96fa mangle_decl_string
        ../../gcc/gcc/cp/mangle.cc:4034
0xae98ea get_mangled_id
        ../../gcc/gcc/cp/mangle.cc:4055
0xae98ea mangle_decl(tree_node*)
        ../../gcc/gcc/cp/mangle.cc:4093
0x14d62cd decl_assembler_name(tree_node*)
        ../../gcc/gcc/tree.cc:715
0x1531f81 notice_global_symbol(tree_node*)
        ../../gcc/gcc/varasm.cc:1801
0xd88b5a cgraph_node::finalize_function(tree_node*, bool)
        ../../gcc/gcc/cgraphunit.cc:453
0xc1677f expand_or_defer_fn(tree_node*)
        ../../gcc/gcc/cp/semantics.cc:4791
0xb498f4 maybe_clone_body(tree_node*)
        ../../gcc/gcc/cp/optimize.cc:700
0xc16495 expand_or_defer_fn_1(tree_node*)
        ../../gcc/gcc/cp/semantics.cc:4755
0xc16758 expand_or_defer_fn(tree_node*)
        ../../gcc/gcc/cp/semantics.cc:4786
0xaf8060 synthesize_method(tree_node*)
        ../../gcc/gcc/cp/method.cc:1840
0xab045d mark_used(tree_node*, int)
        ../../gcc/gcc/cp/decl2.cc:5938
0x9f851a build_over_call
        ../../gcc/gcc/cp/call.cc:9860
```

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

* [Bug c++/104234] ICE with -fmodules-ts and std::map/_Rb_tree
  2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
@ 2023-01-24  3:27 ` pinskia at gcc dot gnu.org
  2023-01-25 12:49 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-24  3:27 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wendellcraigbaker at gmail dot com

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 108488 has been marked as a duplicate of this bug. ***

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

* [Bug c++/104234] ICE with -fmodules-ts and std::map/_Rb_tree
  2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
  2023-01-24  3:27 ` [Bug c++/104234] " pinskia at gcc dot gnu.org
@ 2023-01-25 12:49 ` ppalka at gcc dot gnu.org
  2023-12-11  2:34 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-01-25 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-01-25

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

* [Bug c++/104234] ICE with -fmodules-ts and std::map/_Rb_tree
  2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
  2023-01-24  3:27 ` [Bug c++/104234] " pinskia at gcc dot gnu.org
  2023-01-25 12:49 ` ppalka at gcc dot gnu.org
@ 2023-12-11  2:34 ` cvs-commit at gcc dot gnu.org
  2024-01-09 16:17 ` ppalka at gcc dot gnu.org
  2024-03-06 22:18 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-11  2:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:ab3daffcbf35566d468c3028e48068a481048baf

commit r14-6394-gab3daffcbf35566d468c3028e48068a481048baf
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Thu Nov 23 23:15:19 2023 +1100

    c++: Clear uninstantiated template friend when instantiating [PR104234]

    Otherwise attempting to get the originating module declaration ICEs
    because the DECL_CHAIN of an instantiated friend template is no longer
    its context.

            PR c++/104234
            PR c++/112580

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_template_decl): Clear
            DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr104234.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>

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

* [Bug c++/104234] ICE with -fmodules-ts and std::map/_Rb_tree
  2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
                   ` (2 preceding siblings ...)
  2023-12-11  2:34 ` cvs-commit at gcc dot gnu.org
@ 2024-01-09 16:17 ` ppalka at gcc dot gnu.org
  2024-03-06 22:18 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-01-09 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
           Assignee|ppalka at gcc dot gnu.org          |nathanieloshead at gmail dot com
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Thus fixed for GCC 14, thanks!

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

* [Bug c++/104234] ICE with -fmodules-ts and std::map/_Rb_tree
  2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
                   ` (3 preceding siblings ...)
  2024-01-09 16:17 ` ppalka at gcc dot gnu.org
@ 2024-03-06 22:18 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-06 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john2.718281828459045235360
                   |                            |287 at gmail dot com

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 104956 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2024-03-06 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 23:09 [Bug c++/104234] New: ICE with -fmodules-ts and std::map/_Rb_tree nemanjab at amazon dot com
2023-01-24  3:27 ` [Bug c++/104234] " pinskia at gcc dot gnu.org
2023-01-25 12:49 ` ppalka at gcc dot gnu.org
2023-12-11  2:34 ` cvs-commit at gcc dot gnu.org
2024-01-09 16:17 ` ppalka at gcc dot gnu.org
2024-03-06 22:18 ` ppalka 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).