[Bug c++/70933] New: [7.0 regression] ICE with -Wall on valid code in inchash::add_expr

j.v.dijk at tue dot nl gcc-bugzilla@gcc.gnu.org
Tue May 3 22:02:00 GMT 2016


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

            Bug ID: 70933
           Summary: [7.0 regression] ICE with -Wall on valid code in
                    inchash::add_expr
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: j.v.dijk at tue dot nl
  Target Milestone: ---

The reduced testcase at the end of this report makes rev. 235846 of the
compiler ice with -Wall. Maybe related to PR70906.

> g++ -c -Wall declarations.cpp 
declarations.cpp: In instantiation of ‘void test_declarations() [with T =
unsigned int]’:
declarations.cpp:22:30:   required from here
declarations.cpp:17:5: internal compiler error: in add_expr, at tree.c:7928
  T& param = evaluator.declare_parameter("p1")=T(4);
     ^~~~~
0x1020896 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7928
0x10202f2 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0x101ff75 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0x101ff75 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0x10202f2 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0x101ff75 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0x10202f2 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        ../../gcc-head/gcc/tree.c:7997
0xa9bf68 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc-head/gcc/fold-const.c:2761
0x8ae46a candidate_equal_p
        ../../gcc-head/gcc/c-family/c-common.c:2926
0x8ae4fb candidate_equal_p
        ../../gcc-head/gcc/c-family/c-common.c:2926
0x8ae4fb merge_tlist
        ../../gcc-head/gcc/c-family/c-common.c:2831
0x8b2725 verify_tree
        ../../gcc-head/gcc/c-family/c-common.c:3135
0x8b66aa verify_sequence_points(tree_node*)
        ../../gcc-head/gcc/c-family/c-common.c:3159
0x7fa287 finish_expr_stmt(tree_node*)
        ../../gcc-head/gcc/cp/semantics.c:682
0x699f0d initialize_local_var
        ../../gcc-head/gcc/cp/decl.c:6428
0x699f0d cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc-head/gcc/cp/decl.c:6977
0x6cc84f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-head/gcc/cp/pt.c:15216
0x6c8f24 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-head/gcc/cp/pt.c:15105
0x6c9d27 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-head/gcc/cp/pt.c:15290
0x6c697d instantiate_decl(tree_node*, int, bool)
        ../../gcc-head/gcc/cp/pt.c:22019


jan@linux-pwd6:~/src/gum-cvs/plmathparser/testsuite> cat declarations.cpp 
struct string
{
        string(const char*);
};

template <class T>
struct expression_evaluator
{
        typedef T result_type;
        result_type& declare_parameter(const string& name);
};

template <class T>
void test_declarations()
{
        expression_evaluator<T> evaluator;
        T& param = evaluator.declare_parameter("p1")=T(4);
}

void foo()
{
        test_declarations<unsigned>();
}


More information about the Gcc-bugs mailing list