public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790
@ 2021-11-06 1:24 jonathan.poelen at gmail dot com
2021-11-06 4:49 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template pinskia at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: jonathan.poelen at gmail dot com @ 2021-11-06 1:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Bug ID: 103105
Summary: [11 Regression] ICE iterative_hash_template_arg, at
cp/pt.c:1790
Product: gcc
Version: 11.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jonathan.poelen at gmail dot com
Target Milestone: ---
$ cat test.cpp
template<class...>
struct list
{};
template<bool>
struct wrap_in_list_c
{};
template<class x, class... xs>
using wrap_in_list_if_convertible = wrap_in_list_c<
1 != (... + requires { x() = xs(); })
>;
template<class... xs>
using foo = list<wrap_in_list_if_convertible<xs, xs...>...>;
using L = foo<int,int>;
$ g++ -std=c++20 test.cpp
test.cpp: In substitution of ‘template<class x, class ... xs> using
wrap_in_list_if_convertible = wrap_in_list_c<(1 != (... +requires{x()=
xs();}))> [with x = xs; xs = {xs ...}]’:
test.cpp:15:55: required from here
test.cpp:10:7: internal compiler error: in iterative_hash_template_arg, at
cp/pt.c:1790
10 | using wrap_in_list_if_convertible = wrap_in_list_c<
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
0x1797368 internal_error(char const*, ...)
???:0
0x67f8f9 fancy_abort(char const*, int, char const*)
???:0
0x7d5ec1 iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7d5d8f iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7d5e12 iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7d5d8f iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7d5d8f iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7d5ec1 iterative_hash_template_arg(tree_node*, unsigned int)
???:0
0x7e7d16 tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0x7f227c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
???:0
0x816d4d finish_template_type(tree_node*, tree_node*, int)
???:0
0x7ce2fe c_parse_file()
???:0
0x8a252d c_common_parse_file()
???:0
Works with g++-10: https://godbolt.org/z/KvM31Yq35
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
@ 2021-11-06 4:49 ` pinskia at gcc dot gnu.org
2021-11-06 5:00 ` pinskia at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-06 4:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11 Regression] ICE |[11/12 Regression] ICE
|iterative_hash_template_arg |iterative_hash_template_arg
|, at cp/pt.c:1790 |with concepts and varagrs
| |template
Known to fail| |11.1.0, 12.0
Known to work| |10.3.0
Target Milestone|--- |11.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
2021-11-06 4:49 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template pinskia at gcc dot gnu.org
@ 2021-11-06 5:00 ` pinskia at gcc dot gnu.org
2021-11-06 8:19 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8 marxin at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-06 5:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-11-06
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, reduced testcase even further:
template<bool>class h{};
template<class... xs>
using j = h< 1 != (... + requires { xs(); }) >;
template<class... xs> using foo = j<xs...>;
I tried changing the requires to be something else but it didn't fail.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
2021-11-06 4:49 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template pinskia at gcc dot gnu.org
2021-11-06 5:00 ` pinskia at gcc dot gnu.org
@ 2021-11-06 8:19 ` marxin at gcc dot gnu.org
2021-11-06 14:05 ` ppalka at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-06 8:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12 Regression] ICE |[11/12 Regression] ICE
|iterative_hash_template_arg |iterative_hash_template_arg
|with concepts and varagrs |with concepts and varagrs
|template |template since
| |r11-3261-gb28b621ac67beee8
Keywords|needs-bisection |
CC| |marxin at gcc dot gnu.org,
| |ppalka at gcc dot gnu.org
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-3261-gb28b621ac67beee8.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (2 preceding siblings ...)
2021-11-06 8:19 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8 marxin at gcc dot gnu.org
@ 2021-11-06 14:05 ` ppalka at gcc dot gnu.org
2021-11-08 9:12 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-11-06 14:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (3 preceding siblings ...)
2021-11-06 14:05 ` ppalka at gcc dot gnu.org
@ 2021-11-08 9:12 ` rguenth at gcc dot gnu.org
2022-04-12 16:59 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-08 9:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (4 preceding siblings ...)
2021-11-08 9:12 ` rguenth at gcc dot gnu.org
@ 2022-04-12 16:59 ` cvs-commit at gcc dot gnu.org
2022-04-12 16:59 ` [Bug c++/103105] [11 " ppalka at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-12 16:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:e2c7070ac7740508a7c49bfee9f895e216a272d6
commit r12-8110-ge2c7070ac7740508a7c49bfee9f895e216a272d6
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Apr 12 12:58:18 2022 -0400
c++: requires-expr in pack expansion using pack [PR103105]
Here after dependent substitution of {Ts...} into the alias 'wrap',
since we never partially instantiate a requires-expr, we end up with a
requires-expr whose REQUIRES_EXPR_EXTRA_ARGS contains an
ARGUMENT_PACK_SELECT (which just resolves to the parameter pack Ts).
Then when hashing the resulting dependent specialization of A, we crash
from iterative_hash_template_arg since it deliberately doesn't handle
ARGUMENT_PACK_SELECT.
Like in r12-7102-gdb5f1c17031ad8, it seems the right fix here is to
resolve ARGUMENT_PACK_SELECT arguments before storing them into an
extra args tree (such as REQUIRES_EXPR).
PR c++/103105
gcc/cp/ChangeLog:
* pt.cc (build_extra_args): Call preserve_args.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-requires29.C: New test.
* g++.dg/cpp2a/concepts-requires29a.C: New test.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (5 preceding siblings ...)
2022-04-12 16:59 ` cvs-commit at gcc dot gnu.org
@ 2022-04-12 16:59 ` ppalka at gcc dot gnu.org
2022-04-12 20:24 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-12 16:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |12.0
Known to fail|12.0 |
Summary|[11/12 Regression] ICE |[11 Regression] ICE
|iterative_hash_template_arg |iterative_hash_template_arg
|with concepts and varagrs |with concepts and varagrs
|template since |template since
|r11-3261-gb28b621ac67beee8 |r11-3261-gb28b621ac67beee8
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12 so far.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (6 preceding siblings ...)
2022-04-12 16:59 ` [Bug c++/103105] [11 " ppalka at gcc dot gnu.org
@ 2022-04-12 20:24 ` jason at gcc dot gnu.org
2022-04-12 23:44 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2022-04-12 20:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Bug 103105 depends on bug 104008, which changed state.
Bug 104008 Summary: [11 Regression] New g++ folly compile error since r11-7931-ga2531859bf5bf6cf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (7 preceding siblings ...)
2022-04-12 20:24 ` jason at gcc dot gnu.org
@ 2022-04-12 23:44 ` cvs-commit at gcc dot gnu.org
2022-04-12 23:46 ` ppalka at gcc dot gnu.org
2022-04-12 23:49 ` ppalka at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-12 23:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:051d304ce8e2173bd0cb721ed91d4a1fefa61d87
commit r11-9839-g051d304ce8e2173bd0cb721ed91d4a1fefa61d87
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Apr 12 12:58:18 2022 -0400
c++: requires-expr in pack expansion using pack [PR103105]
Here after dependent substitution of {Ts...} into the alias 'wrap',
since we never partially instantiate a requires-expr, we end up with a
requires-expr whose REQUIRES_EXPR_EXTRA_ARGS contains an
ARGUMENT_PACK_SELECT (which just resolves to the parameter pack Ts).
Then when hashing the resulting dependent specialization of A, we crash
from iterative_hash_template_arg since it deliberately doesn't handle
ARGUMENT_PACK_SELECT.
Like in r12-7102-gdb5f1c17031ad8, it seems the right fix here is to
resolve ARGUMENT_PACK_SELECT arguments before storing them into an
extra args tree (such as REQUIRES_EXPR).
PR c++/103105
gcc/cp/ChangeLog:
* pt.c (build_extra_args): Call preserve_args.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-requires29.C: New test.
* g++.dg/cpp2a/concepts-requires29a.C: New test.
(cherry picked from commit e2c7070ac7740508a7c49bfee9f895e216a272d6)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (8 preceding siblings ...)
2022-04-12 23:44 ` cvs-commit at gcc dot gnu.org
@ 2022-04-12 23:46 ` ppalka at gcc dot gnu.org
2022-04-12 23:49 ` ppalka at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-12 23:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Bug 103105 depends on bug 103706, which changed state.
Bug 103706 Summary: [11 Regression] ICE: tree check: accessed elt 1 of 'tree_vec' with 0 elts in hash, at cp/constraint.cc:2503
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103706
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/103105] [11 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
` (9 preceding siblings ...)
2022-04-12 23:46 ` ppalka at gcc dot gnu.org
@ 2022-04-12 23:49 ` ppalka at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-12 23:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103105
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.3/12.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-04-12 23:49 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 1:24 [Bug c++/103105] New: [11 Regression] ICE iterative_hash_template_arg, at cp/pt.c:1790 jonathan.poelen at gmail dot com
2021-11-06 4:49 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template pinskia at gcc dot gnu.org
2021-11-06 5:00 ` pinskia at gcc dot gnu.org
2021-11-06 8:19 ` [Bug c++/103105] [11/12 Regression] ICE iterative_hash_template_arg with concepts and varagrs template since r11-3261-gb28b621ac67beee8 marxin at gcc dot gnu.org
2021-11-06 14:05 ` ppalka at gcc dot gnu.org
2021-11-08 9:12 ` rguenth at gcc dot gnu.org
2022-04-12 16:59 ` cvs-commit at gcc dot gnu.org
2022-04-12 16:59 ` [Bug c++/103105] [11 " ppalka at gcc dot gnu.org
2022-04-12 20:24 ` jason at gcc dot gnu.org
2022-04-12 23:44 ` cvs-commit at gcc dot gnu.org
2022-04-12 23:46 ` ppalka at gcc dot gnu.org
2022-04-12 23:49 ` 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).