On 1/22/19 5:25 PM, Jakub Jelinek wrote:
Hi!
The following testcase ICEs, because we assert that if during parsing we
haven't found any break; stmts in SWITCH_STMT_BODY, the switch statement
break label will not be used. It is used in this case though, because
while during parsing we expect break stmts only from switch body to go to
the switch's break label and break stmts from the condition to go to
whatever outer construct supports break (if any, otherwise error),
during genericization we actually genericize it as break in condition
(possible only with statement expressions in there, so GNU extension)
jumping to the switch stmt break label.
Fixed thusly. This patch makes C++ also behave like C on this testcase.
Bootstrapped/regtested on {x86_64,i686,powerpc64{,le}}-linux, ok for trunk?
2019-01-22 Jakub Jelinek <ja...@redhat.com>
PR c++/88984
* cp-gimplify.c (genericize_switch_stmt): Move cond genericization
before the begin_bc_block call.
OK.
Jason