From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D8D43858CDA; Sun, 25 Sep 2022 16:08:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D8D43858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664122091; bh=k3z1xUn+wG2shZ27/+46YQHFzgQD5AELbZeWwc8EfR8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R1cy5IuiyfJvuNhb0E9wCtzZSJ/gCmpUWjeQAonrHIRH2tC9BMibF1rpRPOAohLa6 LCfJYdBYcG9pbLtd0FMsQRyh9g/zJDmyj1zasrWg0ksfI+mOGr/EjsXhoiTtbWj4SC yFz4dD16d124Emeu+f5JH9CkJKPwLSv+3N4roCaI= From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107033] [13 Regression] [modules] ICE converting to span Date: Sun, 25 Sep 2022 16:08:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords cf_known_to_fail Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107033 Johel Ernesto Guerrero Pe=C3=B1a changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Known to fail| |11.3.0, 12.2.0 --- Comment #1 from Johel Ernesto Guerrero Pe=C3=B1a --- Simplified. GCC12 only accepts when the span is an lvalue, and otherwise is rejects-valid. GCC11 and GCC13 are ice-on-valid-code with different backtra= ces. GCC11: https://godbolt.org/z/ev5Wb4d3v GCC12: https://godbolt.org/z/bo6f5nT7Y GCC13: https://godbolt.org/z/qGdWq4383 GCC12 lvalue: https://godbolt.org/z/zoz69ener GCC11: ``` In file included from /app/std.hpp:2, of module /app/std.hpp, imported at /app/mod.cpp:2: /opt/compiler-explorer/gcc-11.3.0/include/c++/11.3.0/span: In instantiation= of 'class std::span': mod.cpp:3:51: required from here /opt/compiler-explorer/gcc-11.3.0/include/c++/11.3.0/span:155:9: internal compiler error: Segmentation fault 155 | span(_It __first, size_type __count) | ^~~~ 0x17888c9 internal_error(char const*, ...) ???:0 0x7da897 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0x7f6feb instantiate_class_template(tree_node*) ???:0 0x82a7f3 complete_type(tree_node*) ???:0 0x806c31 finish_compound_literal(tree_node*, tree_node*, int, fcl_t) ???:0 0x7c123b c_parse_file() ???:0 0x894042 c_common_parse_file() ???:0 ``` GCC12: ``` mod.cpp:3:35: error: no match for call to '(const std::ranges::__cust_access::_Begin) (std::span)' 3 | export auto _ =3D std::ranges::begin(std::span{}); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/string_view:50, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/basic_string.h:47, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/string:53, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/locale_classes.h:= 40, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ios_base.h:41, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/streambuf:41, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/streambuf_iterato= r.h:35, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/iterator:66, from /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/ranges:43, from /app/std.hpp:1, of module /app/std.hpp, imported at /app/mod.cpp:2: /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ranges_base.h:114= :9: note: candidate: 'template requires (__maybe_borrowed_range<_Tp= >) && ((is_array_v::type>) || (__member_begin<_Tp>) || (__adl_begin<_Tp>)) constexpr auto std::ranges::__cust_access::_Begin::operator()(_Tp&&) const' 114 | operator()[[nodiscard]](_Tp&& __t) const noexcept(_S_noexcept<_Tp&>()) | ^~~~~~~~ /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ranges_base.h:114= :9: note: template argument deduction/substitution failed: /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ranges_base.h:114= :9: note: constraints not satisfied mod.cpp: In substitution of 'template requires (__maybe_borrowed_range<_Tp>) && ((is_array_v::type>) || (__member_begin<_Tp>) || (__adl_begin<_Tp>)) constexpr auto std::ranges::__cust_access::_Begin::operator()(_Tp&&) const [with _Tp =3D std::span]': mod.cpp:3:35: required from here /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ranges_base.h:83:= 15:=20 required for the satisfaction of '__maybe_borrowed_range<_Tp>' [with _Tp = =3D std::span] /opt/compiler-explorer/gcc-12.2.0/include/c++/12.2.0/bits/ranges_base.h:85:= 11: note: no operand of the disjunction is satisfied 84 | =3D is_lvalue_reference_v<_Tp> | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 85 | || enable_borrowed_range>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: note: set '-fconcepts-diagnostics-depth=3D' to at least 2 for more detail mod.cpp:1:8: warning: not writing module 'mod' due to errors 1 | export module mod; | ^~~~~~ ``` GCC13: ``` mod.cpp:1:8: internal compiler error: Segmentation fault 1 | export module mod; | ^~~~~~ 0x234bd6e internal_error(char const*, ...) ???:0 0xc84cfe walk_specializations(bool, void (*)(bool, spec_entry*, void*), voi= d*) ???:0 0xbead4c depset::hash::add_specializations(bool) ???:0 0xbfb5a8 module_state::write_begin(elf_out*, cpp_reader*, module_state_conf= ig&, unsigned int&) ???:0 0xbfcd45 finish_module_processing(cpp_reader*) ???:0 0xb89d2e c_parse_final_cleanups() ???:0 0xdb0cc8 c_common_parse_file() ???:0 ```=