re PR middle-end/86864 (ICE in commit_one_edge_insertion on switch construct)

PR middle-end/86864
	* cfgexpand.c (expand_gimple_basic_block): Be prepared for a BARRIER
	before and after a JUMP_TABLE_DATA.

From-SVN: r264342
This commit is contained in:
Eric Botcazou 2018-09-15 09:21:09 +00:00 committed by Eric Botcazou
parent 19d6277cdf
commit ae486e6281
4 changed files with 39 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2018-09-15 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/86864
* cfgexpand.c (expand_gimple_basic_block): Be prepared for a BARRIER
before and after a JUMP_TABLE_DATA.
2018-09-14 John David Anglin <danglin@gcc.gnu.org>
PR middle-end/87188

View file

@ -5817,6 +5817,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
last = PREV_INSN (last);
if (JUMP_TABLE_DATA_P (last))
last = PREV_INSN (PREV_INSN (last));
if (BARRIER_P (last))
last = PREV_INSN (last);
BB_END (bb) = last;
update_bb_for_insn (bb);

View file

@ -1,3 +1,7 @@
2018-09-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20180915-1.c: New test.
2018-09-14 David Malcolm <dmalcolm@redhat.com>
PR c/82967

View file

@ -0,0 +1,27 @@
/* PR middle-end/86864 */
/* Testcase by Serge Belyshev <belyshev@depni.sinp.msu.ru> */
long a;
void f ();
void g (int b, int c, int d)
{
switch (b)
{
case 42:
case 29:
case 48:
case 40:
case 32:
c = 2;
break;
case 0:
c = 1;
break;
default:
__builtin_unreachable ();
}
if (d || a)
f ();
if (c == 1)
f ();
}