Bug 94896 - [10/11 regression] ICE: canonical types differ for identical types
Summary: [10/11 regression] ICE: canonical types differ for identical types
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P1 normal
Target Milestone: 10.0
Assignee: Marek Polacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-30 19:51 UTC by Rainer Orth
Modified: 2020-05-04 14:44 UTC (History)
5 users (show)

See Also:
Host:
Target: sparc-*-* riscv64-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-05-01 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2020-04-30 19:51:00 UTC
Between 20200429 (27594524d8a93cddb197ad8c9d4075c5870f1473) and 20200430 (c416c52bcdb120db5e8c53a51bd78c4360daf79b), two tests regressed on Solaris/SPARC:

+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++14 (internal compiler error)
+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++14 (test for excess errors)
+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++17 (internal compiler error)
+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++17 (test for excess errors)
+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++2a (internal compiler error)
+FAIL: g++.dg/cpp0x/alignas3.C  -std=c++2a (test for excess errors)

  32 and 64-bit sparc

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/g++.dg/cpp0x/alignas3.C:19:55: internal compiler error: canonical types differ for identical types 'Stmt' and 'Stmt'
0x82e6b3 comptypes(tree_node*, tree_node*, int)
        /vol/gcc/src/hg/master/local/gcc/cp/typeck.c:1519
0x80d243 maybe_dummy_object(tree_node*, tree_node**)
        /vol/gcc/src/hg/master/local/gcc/cp/tree.c:4040
0x7ef0d7 finish_non_static_data_member(tree_node*, tree_node*, tree_node*)
        /vol/gcc/src/hg/master/local/gcc/cp/semantics.c:1911
0x7f0673 finish_id_expression_1
        /vol/gcc/src/hg/master/local/gcc/cp/semantics.c:3940
0x7f0a33 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
        /vol/gcc/src/hg/master/local/gcc/cp/semantics.c:4025
0x6fe247 cp_parser_primary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:5757
0x70ca77 cp_parser_postfix_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:7260
0x71925f cp_parser_unary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:8563
0x6e656b cp_parser_cast_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9454
0x6e734b cp_parser_binary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9557
0x6e97f3 cp_parser_assignment_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9862
0x6ed1f3 cp_parser_parenthesized_expression_list
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:7984
0x70d08b cp_parser_postfix_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:7333
0x71925f cp_parser_unary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:8563
0x6e656b cp_parser_cast_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9454
0x6e734b cp_parser_binary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9557
0x6e97f3 cp_parser_assignment_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9862
0x6e9c47 cp_parser_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:10030
0x6edc33 cp_parser_expression_statement
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:11691
0x6fb673 cp_parser_statement
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:11487

+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++14 (internal compiler error)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++14 (test for excess errors)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++17 (internal compiler error)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++17 (test for excess errors)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++2a (internal compiler error)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++2a (test for excess errors)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/template/canon-type-8.C  -std=gnu++98 (test for excess errors)

  64-bit sparc

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/g++.dg/template/canon-type-8.C:37:30: internal compiler error: canonical types differ for identical types 'const chunk_array_stereo_t' {aka 'const chunk_array_t<2>'} and 'const chunk_array_t<2>'
0x82e6b3 comptypes(tree_node*, tree_node*, int)
        /vol/gcc/src/hg/master/local/gcc/cp/typeck.c:1519
0x82d573 structural_comptypes
        /vol/gcc/src/hg/master/local/gcc/cp/typeck.c:1423
0x82e54b structural_comptypes
        /vol/gcc/src/hg/master/local/gcc/cp/typeck.c:1245
0x82e54b comptypes(tree_node*, tree_node*, int)
        /vol/gcc/src/hg/master/local/gcc/cp/typeck.c:1512
0x5346af standard_conversion
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:1286
0x53926f implicit_conversion
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:2013
0x53b163 add_function_candidate
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:2408
0x53cc83 add_candidates
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:5866
0x54a443 add_candidates
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:5768
0x54a443 build_new_method_call_1
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:10220
0x54be7f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int)
        /vol/gcc/src/hg/master/local/gcc/cp/call.c:10429
0x70d767 cp_parser_postfix_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:7439
0x71925f cp_parser_unary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:8563
0x6e656b cp_parser_cast_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9454
0x6e734b cp_parser_binary_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9557
0x6e97f3 cp_parser_assignment_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9862
0x6e7f47 cp_parser_constant_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:10156
0x6e9a17 cp_parser_initializer_clause
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:23219
0x6e9a17 cp_parser_assignment_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:9881
0x6e9c47 cp_parser_expression
        /vol/gcc/src/hg/master/local/gcc/cp/parser.c:10030
Comment 1 Eric Botcazou 2020-05-01 16:29:05 UTC
I have them both on Linux and Solaris.
Comment 2 Eric Botcazou 2020-05-01 16:52:56 UTC
This comes from:

2020-04-30  Marek Polacek  <polacek@redhat.com>

	PR c++/94775
	* tree.c (check_base_type): Return true only if TYPE_USER_ALIGN match.
	(check_aligned_type): Check if TYPE_USER_ALIGN match.

which is a rather risky change so close to a release if you ask me.
Comment 3 Andreas Schwab 2020-05-03 12:07:09 UTC
Same on riscv64.
Comment 4 Richard Biener 2020-05-04 06:20:24 UTC
Marek, can you revert that change then?
Comment 5 Marek Polacek 2020-05-04 14:09:06 UTC
Will revert, sorry about that.
Comment 6 Christophe Lyon 2020-05-04 14:24:12 UTC
For the record, this introduces regressions on arm-linux-gnueabihf too:
    g++.dg/cpp0x/alignas3.C  -std=c++14 (internal compiler error)
    g++.dg/cpp0x/alignas3.C  -std=c++17 (internal compiler error)
    g++.dg/cpp0x/alignas3.C  -std=c++2a (internal compiler error)
    g++.dg/other/pr54300.C  -std=gnu++14 (internal compiler error)
    g++.dg/other/pr54300.C  -std=gnu++17 (internal compiler error)
    g++.dg/other/pr54300.C  -std=gnu++2a (internal compiler error)
    g++.dg/other/pr54300.C  -std=gnu++98 (internal compiler error)
Comment 7 Marek Polacek 2020-05-04 14:44:04 UTC
Patch reverted from 10/11.