Bug 90170 - [11/12/13/14 Regression] ICE in unify, at cp/pt.c:22209
Summary: [11/12/13/14 Regression] ICE in unify, at cp/pt.c:22209
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 9.0
: P4 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2019-04-19 03:49 UTC by Arseny Solokha
Modified: 2023-07-07 10:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-06-18 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2019-04-19 03:49:39 UTC
g++-9.0.0-alpha20190414 snapshot (r270355) ICEs when compiling the following testcase extracted from test/SemaTemplate/temp_arg_nontype.cpp from the clang 8.0.0 test suite w/ -std=c++17:

namespace partial_order_different_types {
  template<int, int, typename T, typename, T> struct A;

  // FIXME: It appears that this partial specialization should be ill-formed as
  // it is not more specialized than the primary template. V is not deducible
  // because it does not have the same type as the corresponding parameter.
  template<int N, typename T, typename U, U V> struct A<0, N, T, U, V> {}; // expected-note {{matches}}
}

% g++-9.0.0-alpha20190414 -std=c++17 -c zaccgjmf.cpp
zaccgjmf.cpp:7:55: internal compiler error: in unify, at cp/pt.c:22209
    7 |   template<int N, typename T, typename U, U V> struct A<0, N, T, U, V> {}; // expected-note {{matches}}
      |                                                       ^~~~~~~~~~~~~~~~
0x620a62 unify
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22209
0x9d05a8 unify
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22391
0x9d0116 unify
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22553
0x9d15ff get_partial_spec_bindings
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:23366
0x9f98fa process_partial_specialization
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:4883
0x9f9c45 push_template_decl_real(tree_node*, bool)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5619
0x9fbeb7 push_template_decl_real(tree_node*, bool)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5846
0x9fbeb7 push_template_decl(tree_node*)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5848
0x9fbeb7 push_template_decl(tree_node*)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5846
0x9fbeb7 maybe_process_partial_specialization(tree_node*)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:1014
0x98d054 cp_parser_class_head
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:24021
0x98d054 cp_parser_class_specifier_1
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:23362
0x98d9d8 cp_parser_class_specifier
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:23686
0x98d9d8 cp_parser_type_specifier
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:17431
0x98e944 cp_parser_decl_specifier_seq
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:14124
0x9b0ba8 cp_parser_single_declaration
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28177
0x9b0f3d cp_parser_template_declaration_after_parameters
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:27860
0x9b188e cp_parser_explicit_template_declaration
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28106
0x9b188e cp_parser_template_declaration_after_export
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28125
0x9b4459 cp_parser_declaration
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:13187

It may be a duplicate of PR89480, though.
Comment 1 Marek Polacek 2019-06-18 19:44:05 UTC
Confirmed.
Comment 2 Richard Biener 2019-11-14 07:52:48 UTC
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
Comment 3 Jakub Jelinek 2020-03-04 09:45:36 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 4 Jakub Jelinek 2021-05-14 09:51:30 UTC
GCC 8 branch is being closed.
Comment 5 Richard Biener 2021-06-01 08:13:46 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 6 Richard Biener 2022-05-27 09:40:36 UTC
GCC 9 branch is being closed
Comment 7 Jakub Jelinek 2022-06-28 10:37:08 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 8 Richard Biener 2023-07-07 10:35:14 UTC
GCC 10 branch is being closed.