Commit d0f2db23 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/88984 (ICE in genericize_switch_stmt, at cp/cp-gimplify.c:377)

	PR c++/88984
	* cp-gimplify.c (genericize_switch_stmt): Move cond genericization
	before the begin_bc_block call.

	* c-c++-common/pr88984.c: New test.

From-SVN: r268187
parent ef192ae1
2019-01-23 Jakub Jelinek <jakub@redhat.com>
PR c++/88984
* cp-gimplify.c (genericize_switch_stmt): Move cond genericization
before the begin_bc_block call.
2019-01-21 Jason Merrill <jason@redhat.com> 2019-01-21 Jason Merrill <jason@redhat.com>
PR c++/87893 - constexpr ctor ICE on ARM. PR c++/87893 - constexpr ctor ICE on ARM.
......
...@@ -356,16 +356,17 @@ genericize_switch_stmt (tree *stmt_p, int *walk_subtrees, void *data) ...@@ -356,16 +356,17 @@ genericize_switch_stmt (tree *stmt_p, int *walk_subtrees, void *data)
tree break_block, body, cond, type; tree break_block, body, cond, type;
location_t stmt_locus = EXPR_LOCATION (stmt); location_t stmt_locus = EXPR_LOCATION (stmt);
break_block = begin_bc_block (bc_break, stmt_locus);
body = SWITCH_STMT_BODY (stmt); body = SWITCH_STMT_BODY (stmt);
if (!body) if (!body)
body = build_empty_stmt (stmt_locus); body = build_empty_stmt (stmt_locus);
cond = SWITCH_STMT_COND (stmt); cond = SWITCH_STMT_COND (stmt);
type = SWITCH_STMT_TYPE (stmt); type = SWITCH_STMT_TYPE (stmt);
cp_walk_tree (&body, cp_genericize_r, data, NULL);
cp_walk_tree (&cond, cp_genericize_r, data, NULL); cp_walk_tree (&cond, cp_genericize_r, data, NULL);
break_block = begin_bc_block (bc_break, stmt_locus);
cp_walk_tree (&body, cp_genericize_r, data, NULL);
cp_walk_tree (&type, cp_genericize_r, data, NULL); cp_walk_tree (&type, cp_genericize_r, data, NULL);
*walk_subtrees = 0; *walk_subtrees = 0;
......
2019-01-23 Jakub Jelinek <jakub@redhat.com>
PR c++/88984
* c-c++-common/pr88984.c: New test.
2019-01-23 Richard Biener <rguenther@suse.de> 2019-01-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/89008 PR tree-optimization/89008
......
/* PR c++/88984 */
/* { dg-do run } */
void
foo (int x, int y)
{
while (x > 0)
switch (({ if (y) break; y; }))
{
case 2: x = 0;
}
}
int
main ()
{
foo (1, 1);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment