[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

haoxintu at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 29 16:50:12 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96380

            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 <class> enum struct c : union enum class c { e = b, f = a }; 
enum class c {};

Command:
g++ -fermissive -w small.cc

Output:
small.cc:5:15: internal compiler error: tree check: expected integer_cst, have
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_code)
        ../../gcc/tree.h:3559
0x8aeffa wi::extended_tree<192>::get_len() const
        ../../gcc/tree.h:5954
0x8aeffa wi::int_traits<generic_wide_int<wi::extended_tree<192> >
>::decompose(long*, unsigned int, generic_wide_int<wi::extended_tree<192> >
const&)
        ../../gcc/wide-int.h:985
0x8aeffa wide_int_ref_storage<true,
false>::wide_int_ref_storage<generic_wide_int<wi::extended_tree<192> >
>(generic_wide_int<wi::extended_tree<192> > const&, unsigned int)
        ../../gcc/wide-int.h:1034
0x8aeffa generic_wide_int<wide_int_ref_storage<true, false>
>::generic_wide_int<generic_wide_int<wi::extended_tree<192> >
>(generic_wide_int<wi::extended_tree<192> > const&, unsigned int)
        ../../gcc/wide-int.h:790
0x8aeffa bool wi::lts_p<generic_wide_int<wi::extended_tree<192> >,
generic_wide_int<wi::extended_tree<192> >
>(generic_wide_int<wi::extended_tree<192> > const&,
generic_wide_int<wi::extended_tree<192> > const&)
        ../../gcc/wide-int.h:1901
0x93bc08 wi::binary_traits<generic_wide_int<wi::extended_tree<192> >,
generic_wide_int<wi::extended_tree<192> >,
wi::int_traits<generic_wide_int<wi::extended_tree<192> > >::precision_type,
wi::int_traits<generic_wide_int<wi::extended_tree<192> >
>::precision_type>::signed_predicate_result operator<
<generic_wide_int<wi::extended_tree<192> >,
generic_wide_int<wi::extended_tree<192> >
>(generic_wide_int<wi::extended_tree<192> > const&,
generic_wide_int<wi::extended_tree<192> > 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 <https://gcc.gnu.org/bugs/> for instructions.

Reproduced in Godbolt : https://godbolt.org/z/YGPxsj

Thanks,
Haoxin


More information about the Gcc-bugs mailing list