[Bug c++/79639] New: [6/7 Regression] ICE with -O and constexpr
reichelt at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 20 20:34:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79639
Bug ID: 79639
Summary: [6/7 Regression] ICE with -O and constexpr
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
Target Milestone: ---
The following valid testcase (compiled with "-std=c++1y -O")
triggers an ICE since GCC 6.1.0:
========================================
struct A
{
void foo() {}
};
constexpr void bar(void (A::*f)())
{
f = 0;
}
void baz()
{
bar(&A::foo);
}
========================================
bug.cc: In function 'void baz()':
bug.cc:13:6: in constexpr expansion of 'bar(&A::foo)'
bug.cc:14:1: internal compiler error: tree check: expected constructor, have
ptrmem_cst in cxx_eval_store_expression, at cp/constexpr.c:3540
}
^
0xffc2ac tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9813
0x83efbb tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3064
0x83efbb cxx_eval_store_expression
../../gcc/gcc/cp/constexpr.c:3540
0x83a118 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4049
0x83b8fa cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4341
0x83a160 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4538
0x83a160 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4538
0x839052 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1641
0x83aca3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:3971
0x840a2e cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4613
0x843c26 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4828
0x81d9cb cp_fold
../../gcc/gcc/cp/cp-gimplify.c:2336
0x81dfee cp_fold_r
../../gcc/gcc/cp/cp-gimplify.c:1014
0x1020f13 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, default_hash_traits<tree_node*> >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set<tree_node*, default_hash_traits<tree_node*> >*))
../../gcc/gcc/tree.c:11796
0x821140 cp_fold_function(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1085
0x639150 finish_function(int)
../../gcc/gcc/cp/decl.c:15598
0x7190fe cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26276
0x719dcd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26182
0x719dcd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19177
0x73dc1c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12795
Please submit a full bug report, [etc.]
The testcase compiles fine with GCC 5.1.0
More information about the Gcc-bugs
mailing list