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

            Bug ID: 105529
           Summary: [13 Regression] cxx_eval_store_expression, at
                    cp/constexpr.cc:5928 since r13-160-g967cdbe6629653
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu
            Target: arm-linux-eabi

The following crashes with the given cross compiler:

$ cat sstream-inst.ii
struct allocator {
  constexpr ~allocator() {}
};
struct Trans_NS___cxx11_basic_string {
  Trans_NS___cxx11_basic_string(int, int, allocator = allocator());
};
void to_string() { Trans_NS___cxx11_basic_string(0, '\0'); }

$ ./xg++ -B. sstream-inst.ii -c -std=gnu++20 -O
sstream-inst.ii: In function ‘void to_string()’:
sstream-inst.ii:7:60:   in ‘constexpr’ expansion of
‘<anonymous>.allocator::~allocator()’
sstream-inst.ii:7:60: internal compiler error: in cxx_eval_store_expression, at
cp/constexpr.cc:5928
    7 | void to_string() { Trans_NS___cxx11_basic_string(0, '\0'); }
      |                                                            ^
0xb8412a cxx_eval_store_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:5928
0xb87c46 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:6848
0xb87d41 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:6860
0xb8503f cxx_eval_statement_list
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:6178
0xb8a158 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:7407
0xb87f45 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:6906
0xb76e4c cxx_eval_call_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:2855
0xb87084 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:6719
0xb8c200 cxx_eval_outermost_constant_expr
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:7824
0xb8d06e maybe_constant_value(tree_node*, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/constexpr.cc:8102
0xbcff2b cp_fold
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.cc:2880
0xbcddd2 cp_fold
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.cc:2467
0xbc6c66 cp_fold_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.cc:1011
0x1b91df5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.cc:11199
0x1b9278f walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.cc:11334
0x1b9278f walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.cc:11334
0xbc73f9 cp_fold_function(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.cc:1114
0xc42ff8 finish_function(bool)
        /home/marxin/Programming/gcc/gcc/cp/decl.cc:17967
0xda2a1f cp_parser_function_definition_after_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.cc:31331
0xda283b cp_parser_function_definition_from_specifiers_and_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.cc:31244
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to