Commit a09ad347 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/87475 (ICE in patch_jump_insn, at cfgrtl.c:1275)

	PR rtl-optimization/87475
	* cfgrtl.c (patch_jump_insn): Allow redirection failure for
	CROSSING_JUMP_P insns.
	(cfg_layout_redirect_edge_and_branch): Don't ICE if ret is NULL.

	* g++.dg/opt/pr87475.C: New test.

From-SVN: r266219
parent b4183573
2018-11-16 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/87475
* cfgrtl.c (patch_jump_insn): Allow redirection failure for
CROSSING_JUMP_P insns.
(cfg_layout_redirect_edge_and_branch): Don't ICE if ret is NULL.
2018-11-16 Uros Bizjak <ubizjak@gmail.com> 2018-11-16 Uros Bizjak <ubizjak@gmail.com>
PR target/88051 PR target/88051
...@@ -1268,11 +1268,13 @@ patch_jump_insn (rtx_insn *insn, rtx_insn *old_label, basic_block new_bb) ...@@ -1268,11 +1268,13 @@ patch_jump_insn (rtx_insn *insn, rtx_insn *old_label, basic_block new_bb)
/* If the substitution doesn't succeed, die. This can happen /* If the substitution doesn't succeed, die. This can happen
if the back end emitted unrecognizable instructions or if if the back end emitted unrecognizable instructions or if
target is exit block on some arches. */ target is exit block on some arches. Or for crossing
jumps. */
if (!redirect_jump (as_a <rtx_jump_insn *> (insn), if (!redirect_jump (as_a <rtx_jump_insn *> (insn),
block_label (new_bb), 0)) block_label (new_bb), 0))
{ {
gcc_assert (new_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)); gcc_assert (new_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)
|| CROSSING_JUMP_P (insn));
return false; return false;
} }
} }
...@@ -4460,6 +4462,9 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) ...@@ -4460,6 +4462,9 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
else else
ret = redirect_branch_edge (e, dest); ret = redirect_branch_edge (e, dest);
if (!ret)
return NULL;
fixup_partition_crossing (ret); fixup_partition_crossing (ret);
/* We don't want simplejumps in the insn stream during cfglayout. */ /* We don't want simplejumps in the insn stream during cfglayout. */
gcc_assert (!simplejump_p (BB_END (src)) || CROSSING_JUMP_P (BB_END (src))); gcc_assert (!simplejump_p (BB_END (src)) || CROSSING_JUMP_P (BB_END (src)));
......
2018-11-16 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/87475
* g++.dg/opt/pr87475.C: New test.
2018-11-16 Matthew Malcomson <matthew.malcomson@arm.com> 2018-11-16 Matthew Malcomson <matthew.malcomson@arm.com>
* gcc.c-torture/execute/printf-2.c: Skip on wrapped boards. * gcc.c-torture/execute/printf-2.c: Skip on wrapped boards.
......
// PR rtl-optimization/87475
// { dg-do compile { target freorder } }
// { dg-options "-O2 -freorder-blocks-and-partition -fmodulo-sched" }
struct A { A (); ~A (); };
int foo (A, A);
void bar (bool x) { x ? foo (A (), A ()) : 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