mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-10 22:07:37 +08:00
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
This commit is contained in:
parent
ef192ae1b6
commit
d0f2db2316
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
PR c++/87893 - constexpr ctor ICE on ARM.
|
||||
|
@ -356,16 +356,17 @@ genericize_switch_stmt (tree *stmt_p, int *walk_subtrees, void *data)
|
||||
tree break_block, body, cond, type;
|
||||
location_t stmt_locus = EXPR_LOCATION (stmt);
|
||||
|
||||
break_block = begin_bc_block (bc_break, stmt_locus);
|
||||
|
||||
body = SWITCH_STMT_BODY (stmt);
|
||||
if (!body)
|
||||
body = build_empty_stmt (stmt_locus);
|
||||
cond = SWITCH_STMT_COND (stmt);
|
||||
type = SWITCH_STMT_TYPE (stmt);
|
||||
|
||||
cp_walk_tree (&body, 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);
|
||||
*walk_subtrees = 0;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR tree-optimization/89008
|
||||
|
19
gcc/testsuite/c-c++-common/pr88984.c
Normal file
19
gcc/testsuite/c-c++-common/pr88984.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user