From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 42323385EC54; Wed, 29 Jul 2020 16:50:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42323385EC54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596041412; bh=Fy9/EUvdqibPWUB0yDVCFuj11fhqBViqbfCkpC29wxw=; h=From:To:Subject:Date:From; b=PmAZCOzm0sKJCqeW37AV5VoRi5SNsPioHkH9hikylCdTydMbDkpt5OC2LSTnKGGtF csQdEBGEwCRc2Ilq2Ou/RDYDlxOQW+xtZHy/KmXns+TfU9hU1KyMDlQXNk4rm9CW4U L7VMjyFqqmSsIL50nE3+FoTatQhegNT/7+xdjRTE= From: "haoxintu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96380] New: [10/11 Regression] ICE in tree check: expected integer_cst, have view_convert_expr in get_len, at tree.h:5954 Date: Wed, 29 Jul 2020 16:50:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: haoxintu 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 16:50:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96380 Bug ID: 96380 Summary: [10/11 Regression] ICE in tree check: expected integer_cst, have view_convert_expr in get_len, at tree.h:5954 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi, all. This invalid code makes GCC-trunk and GCC-10.2 ICE, and GCC-10 downwards versions compile it well without ICE. Input: //small.cc const int a; const long b; enum struct c; template enum struct c : union enum class c { e =3D b, f =3D a };=20 enum class c {}; Command: g++ -fermissive -w small.cc Output: small.cc:5:15: internal compiler error: tree check: expected integer_cst, h= ave view_convert_expr in get_len, at tree.h:5954 5 | enum class c {}; | ^ 0x7eb991 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/tree.c:9687 0x8aeffa tree_check(tree_node const*, char const*, int, char const*, tree_c= ode) ../../gcc/tree.h:3559 0x8aeffa wi::extended_tree<192>::get_len() const ../../gcc/tree.h:5954 0x8aeffa wi::int_traits > >::decompose(long*, unsigned int, generic_wide_int > const&) ../../gcc/wide-int.h:985 0x8aeffa wide_int_ref_storage::wide_int_ref_storage > >(generic_wide_int > const&, unsigned int) ../../gcc/wide-int.h:1034 0x8aeffa generic_wide_int >::generic_wide_int > >(generic_wide_int > const&, unsigned int) ../../gcc/wide-int.h:790 0x8aeffa bool wi::lts_p >, generic_wide_int > >(generic_wide_int > const&, generic_wide_int > const&) ../../gcc/wide-int.h:1901 0x93bc08 wi::binary_traits >, generic_wide_int >, wi::int_traits > >::precision_type, wi::int_traits > >::precision_type>::signed_predicate_result operator< >, generic_wide_int > >(generic_wide_int > const&, generic_wide_int > const&) ../../gcc/wide-int.h:3248 0x93bc08 tree_int_cst_lt(tree_node const*, tree_node const*) ../../gcc/tree.h:6110 0x93bc08 finish_enum_value_list(tree_node*) ../../gcc/cp/decl.c:15573 0x9cc89b cp_parser_enum_specifier ../../gcc/cp/parser.c:19483 0x9cc89b cp_parser_type_specifier ../../gcc/cp/parser.c:17769 0x9cd17e cp_parser_decl_specifier_seq ../../gcc/cp/parser.c:14436 0x9cdf31 cp_parser_simple_declaration ../../gcc/cp/parser.c:13690 0x9f929e cp_parser_declaration ../../gcc/cp/parser.c:13510 0x9f998b cp_parser_translation_unit ../../gcc/cp/parser.c:4793 0x9f998b c_parse_file() ../../gcc/cp/parser.c:44081 0xb144fd c_common_parse_file() ../../gcc/c-family/c-opts.c:1188 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Reproduced in Godbolt : https://godbolt.org/z/YGPxsj Thanks, Haoxin=