This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77467] Segmentation fault with switch statement in constexpr function
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Sep 2016 18:57:46 +0000
- Subject: [Bug c++/77467] Segmentation fault with switch statement in constexpr function
- Auto-submitted: auto-generated
- References: <bug-77467-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77467
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-09-03
CC| |trippels at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 /tmp % cat constexpr.ii
constexpr int a() {
switch (0) {
case 0:
int b(1);
return b;
}
}
static_assert(a(), "");
markus@x4 /tmp % /var/tmp/gcc_test/usr/local/bin/g++ -std=c++14 -c constexpr.ii
constexpr.ii:8:16: in constexpr expansion of ‘a()’
constexpr.ii:8:23: internal compiler error: tree check: expected
statement_list, have bind_expr in tsi_start, at tree-iterator.h:42
static_assert(a(), "");
^
0x100e0bc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9742
0x5b9f63 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3026
0x5b9f63 tsi_start
../../gcc/gcc/tree-iterator.h:42
0x87e110 tsi_start
../../gcc/gcc/cp/constexpr.c:3457
0x87e110 cxx_eval_statement_list
../../gcc/gcc/cp/constexpr.c:3486
0x8791bb cxx_eval_switch_expr
../../gcc/gcc/cp/constexpr.c:3576
0x8791bb cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4298
0x87891d cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4222
0x87891d cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4222
0x876de4 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1597
0x878c65 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:3766
0x87e25b cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4389
0x8811f4 maybe_constant_value_1
../../gcc/gcc/cp/constexpr.c:4584
0x8811f4 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4608
0x85caf1 cp_fully_fold(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1971
0x7a4983 cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*,
int)
../../gcc/gcc/cp/typeck.c:5196
0x7b1fff ocp_convert(tree_node*, tree_node*, int, int, int)
../../gcc/gcc/cp/cvt.c:800
0x7eb25b finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
../../gcc/gcc/cp/semantics.c:8767
0x76a560 cp_parser_static_assert
../../gcc/gcc/cp/parser.c:13182
0x77f129 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12359