public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101000] New: ICE when trying to import the absl/container/flat_hash_map.h as a header module
@ 2021-06-09 19:17 boris.staletic at gmail dot com
  2021-06-09 19:25 ` [Bug c++/101000] " mpolacek at gcc dot gnu.org
  2024-03-13 18:18 ` ppalka at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: boris.staletic at gmail dot com @ 2021-06-09 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101000
           Summary: ICE when trying to import the
                    absl/container/flat_hash_map.h as a header module
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: boris.staletic at gmail dot com
  Target Milestone: ---

Steps to repro:

0. Install Abseil from https://github.com/abseil/abseil-cpp
1. g++ -std=c++20 -fmodules-ts -xc++-system-header
absl/container/flat_hash_map.h
2. g++ -std=c++20 -fmodules-ts main.cpp

Output:

In file included from /usr/include/c++/11.1.0/functional:54,
                 from /usr/include/c++/11.1.0/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11.1.0/algorithm:74,
                 from /usr/include/absl/algorithm/container.h:43,
                 from /usr/include/absl/container/flat_hash_map.h:38,
of module /usr/include/absl/container/flat_hash_map.h, imported at main.cpp:1:
/usr/include/c++/11.1.0/tuple: In instantiation of ‘constexpr std::pair<_T1,
_T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>,
std::tuple<_Args2 ...>) [with _Args1 = {const int&}; _Args2 = {const int&}; _T1
= std::tuple<const int&>; _T2 = std::tuple<const int&>]’:
/usr/include/absl/container/internal/container_memory.h:182:52:   required from
‘std::pair<std::tuple<F&&>, std::tuple<S&&> >
absl::container_internal::PairArgs(F&&, S&&) [with F = const int&; S = const
int&]’
/usr/include/absl/container/internal/container_memory.h:187:18:   required from
‘std::pair<std::tuple<const F&>, std::tuple<const S&> >
absl::container_internal::PairArgs(const std::pair<_T1, _T2>&) [with F = int; S
= int]’
/usr/include/absl/container/internal/container_memory.h:207:35:   required from
‘decltype
(absl::container_internal::memory_internal::DecomposePairImpl(forward<F>(f),
absl::container_internal::PairArgs((forward<Args>)(absl::container_internal::DecomposePair::args)...)))
absl::container_internal::DecomposePair(F&&, Args&& ...) [with F =
absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::EmplaceDecomposable; Args =
{const std::pair<int, int>&}; decltype
(absl::container_internal::memory_internal::DecomposePairImpl(forward<F>(f),
absl::container_internal::PairArgs((forward<Args>)(absl::container_internal::DecomposePair::args)...)))
=
std::pair<absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::iterator, bool>]’
/usr/include/absl/container/flat_hash_map.h:580:51:   required from ‘static
decltype (absl::container_internal::DecomposePair(declval<F>(),
(declval<Args>)()...)) absl::container_internal::FlatHashMapPolicy<K,
V>::apply(F&&, Args&& ...) [with F =
absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::EmplaceDecomposable; Args =
{const std::pair<int, int>&}; K = int; V = int; decltype
(absl::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) =
std::pair<absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::iterator, bool>]’
/usr/include/absl/container/internal/hash_policy_traits.h:170:20:   required
from ‘static decltype (P::apply(forward<F>(f),
(forward<Ts>)(absl::container_internal::hash_policy_traits<Policy,
<template-parameter-1-2> >::apply::ts)...))
absl::container_internal::hash_policy_traits<Policy, <template-parameter-1-2>
>::apply(F&&, Ts&& ...) [with F =
absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::EmplaceDecomposable; Ts = {const
std::pair<int, int>&}; P = absl::container_internal::FlatHashMapPolicy<int,
int>; Policy = absl::container_internal::FlatHashMapPolicy<int, int>;
<template-parameter-1-2> = void; decltype (P::apply(forward<F>(f),
(forward<Ts>)(absl::container_internal::hash_policy_traits<Policy,
<template-parameter-1-2> >::apply::ts)...)) =
std::pair<absl::container_internal::raw_hash_set<absl::container_internal::FlatHashMapPolicy<int,
int>, absl::hash_internal::Hash<int>, std::equal_to<int>,
std::allocator<std::pair<const int, int> > >::iterator, bool>]’
/usr/include/absl/container/internal/raw_hash_set.h:1129:31:   required from
‘std::pair<absl::container_internal::raw_hash_set<Policy, Hash, Eq,
Alloc>::iterator, bool> absl::container_internal::raw_hash_set<Policy, Hash,
Eq, Alloc>::emplace(Args&& ...) [with Args = {const std::pair<int, int>&};
typename std::enable_if<absl::container_internal::IsDecomposable<void,
absl::container_internal::hash_policy_traits<Policy>, Hash, Eq, Ts ...>::value,
int>::type <anonymous> = 0; Policy =
absl::container_internal::FlatHashMapPolicy<int, int>; Hash =
absl::hash_internal::Hash<int>; Eq = std::equal_to<int>; Alloc =
std::allocator<std::pair<const int, int> >]’
/usr/include/absl/container/internal/raw_hash_set.h:1085:43:   required from
‘void absl::container_internal::raw_hash_set<Policy, Hash, Eq,
Alloc>::insert(InputIt, InputIt) [with InputIt = const std::pair<int, int>*;
Policy = absl::container_internal::FlatHashMapPolicy<int, int>; Hash =
absl::hash_internal::Hash<int>; Eq = std::equal_to<int>; Alloc =
std::allocator<std::pair<const int, int> >]’
/usr/include/absl/container/internal/raw_hash_set.h:817:11:   required from
‘absl::container_internal::raw_hash_set<Policy, Hash, Eq,
Alloc>::raw_hash_set(InputIter, InputIter, size_t, const hasher&, const
key_equal&, const allocator_type&) [with InputIter = const std::pair<int,
int>*; Policy = absl::container_internal::FlatHashMapPolicy<int, int>; Hash =
absl::hash_internal::Hash<int>; Eq = std::equal_to<int>; Alloc =
std::allocator<std::pair<const int, int> >; size_t = long unsigned int;
absl::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::hasher =
absl::hash_internal::Hash<int>; absl::container_internal::raw_hash_set<Policy,
Hash, Eq, Alloc>::key_equal = std::equal_to<int>;
absl::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::allocator_type
= std::allocator<std::pair<const int, int> >]’
/usr/include/absl/container/internal/raw_hash_set.h:864:77:   required from
‘absl::container_internal::raw_hash_set<Policy, Hash, Eq,
Alloc>::raw_hash_set(std::initializer_list<typename
absl::container_internal::hash_policy_traits<Policy>::init_type>, size_t, const
hasher&, const key_equal&, const allocator_type&) [with Policy =
absl::container_internal::FlatHashMapPolicy<int, int>; Hash =
absl::hash_internal::Hash<int>; Eq = std::equal_to<int>; Alloc =
std::allocator<std::pair<const int, int> >; typename
absl::container_internal::hash_policy_traits<Policy>::init_type =
std::pair<int, int>; size_t = long unsigned int;
absl::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::hasher =
absl::hash_internal::Hash<int>; absl::container_internal::raw_hash_set<Policy,
Hash, Eq, Alloc>::key_equal = std::equal_to<int>;
absl::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::allocator_type
= std::allocator<std::pair<const int, int> >]’
/usr/include/absl/container/internal/raw_hash_map.h:62:37:   required from here
/usr/include/c++/11.1.0/tuple:1759:14: internal compiler error: in tsubst_copy,
at cp/pt.c:16660
 1759 |       : pair(__first, __second,
      |              ^~~~~~~
0x1797368 internal_error(char const*, ...)
        ???:0
0x67f8f9 fancy_abort(char const*, int, char const*)
        ???:0
0x7f5421 tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x7ea4ef instantiate_decl(tree_node*, bool, bool)
        ???:0
0x80659b instantiate_pending_templates(int)
        ???:0
0x7136c0 c_parse_final_cleanups()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.

main.cpp:

import <absl/container/flat_hash_map.h>;


int main(int argc, char *argv[]) {
    return absl::flat_hash_map<int, int>{{1,2}}.size();
}


I can also upload the compiled gcm file, but it's 16MB.

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

* [Bug c++/101000] ICE when trying to import the absl/container/flat_hash_map.h as a header module
  2021-06-09 19:17 [Bug c++/101000] New: ICE when trying to import the absl/container/flat_hash_map.h as a header module boris.staletic at gmail dot com
@ 2021-06-09 19:25 ` mpolacek at gcc dot gnu.org
  2024-03-13 18:18 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-06-09 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-06-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
With trunk I see a different ICE:

$ xg++ -std=c++20 -fmodules-ts -xc++-system-header
absl/container/flat_hash_map.h
/usr/include/absl/container/flat_hash_map.h: internal compiler error: in
insert, at cp/module.cc:4797
0xc0c58e trees_out::insert(tree_node*, walk_kind)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:4797
0xc172c9 trees_out::decl_value(tree_node*, depset*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:7548
0xc1aecd trees_out::decl_node(tree_node*, walk_kind)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:8246
0xc1ef87 trees_out::tree_node(tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:9084
0xc3821a module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:14632
0xc40f2f module_state::write(elf_out*, cpp_reader*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:17735
0xc4738a finish_module_processing(cpp_reader*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:19858
0xb823cb c_parse_final_cleanups()
        /home/mpolacek/src/gcc/gcc/cp/decl2.c:5179
0xeb3840 c_common_parse_file()
        /home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1241

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

* [Bug c++/101000] ICE when trying to import the absl/container/flat_hash_map.h as a header module
  2021-06-09 19:17 [Bug c++/101000] New: ICE when trying to import the absl/container/flat_hash_map.h as a header module boris.staletic at gmail dot com
  2021-06-09 19:25 ` [Bug c++/101000] " mpolacek at gcc dot gnu.org
@ 2024-03-13 18:18 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-13 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This seems to work with GCC trunk now.

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

end of thread, other threads:[~2024-03-13 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 19:17 [Bug c++/101000] New: ICE when trying to import the absl/container/flat_hash_map.h as a header module boris.staletic at gmail dot com
2021-06-09 19:25 ` [Bug c++/101000] " mpolacek at gcc dot gnu.org
2024-03-13 18: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).