* [PATCH] Fix rtl_split_edge (PR rtl-optimization/65761)
@ 2015-04-14 12:58 Jakub Jelinek
2015-04-14 13:22 ` Steven Bosscher
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2015-04-14 12:58 UTC (permalink / raw)
To: Richard Biener, Jeff Law, Eric Botcazou, Jan Hubicka; +Cc: gcc-patches
Hi!
On the testcase from the PR (not suitable for testsuite, as it is
-fprofile-use only with *.gcda required and thus hard to reduce),
we ICE because rtl_split_edge decided to insert a new basic block
in between a tablejump instruction and corresponding jump table.
Fixed by using get_last_bb_insn, which skips the jump table and also
in case there are multiple barriers also the extra barriers.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/5.1?
2015-04-14 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/65761
* cfgrtl.c (rtl_split_edge): For EDGE_CROSSING split, use
get_last_bb_insn (after) instead of NEXT_INSN (BB_END (after)).
--- gcc/cfgrtl.c.jj 2015-04-12 21:50:18.000000000 +0200
+++ gcc/cfgrtl.c 2015-04-14 12:45:34.127722958 +0200
@@ -1928,7 +1928,7 @@ rtl_split_edge (edge edge_in)
&& (edge_in->flags & EDGE_CROSSING))
{
after = last_bb_in_partition (edge_in->src);
- before = NEXT_INSN (BB_END (after));
+ before = get_last_bb_insn (after);
/* The instruction following the last bb in partition should
be a barrier, since it cannot end in a fall-through. */
gcc_checking_assert (BARRIER_P (before));
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix rtl_split_edge (PR rtl-optimization/65761)
2015-04-14 12:58 [PATCH] Fix rtl_split_edge (PR rtl-optimization/65761) Jakub Jelinek
@ 2015-04-14 13:22 ` Steven Bosscher
0 siblings, 0 replies; 2+ messages in thread
From: Steven Bosscher @ 2015-04-14 13:22 UTC (permalink / raw)
To: Jakub Jelinek
Cc: Richard Biener, Jeff Law, Eric Botcazou, Jan Hubicka, GCC Patches
On Tue, Apr 14, 2015 at 2:58 PM, Jakub Jelinek wrote:
> PR rtl-optimization/65761
> * cfgrtl.c (rtl_split_edge): For EDGE_CROSSING split, use
> get_last_bb_insn (after) instead of NEXT_INSN (BB_END (after)).
>
> --- gcc/cfgrtl.c.jj 2015-04-12 21:50:18.000000000 +0200
> +++ gcc/cfgrtl.c 2015-04-14 12:45:34.127722958 +0200
> @@ -1928,7 +1928,7 @@ rtl_split_edge (edge edge_in)
> && (edge_in->flags & EDGE_CROSSING))
> {
> after = last_bb_in_partition (edge_in->src);
> - before = NEXT_INSN (BB_END (after));
> + before = get_last_bb_insn (after);
> /* The instruction following the last bb in partition should
> be a barrier, since it cannot end in a fall-through. */
> gcc_checking_assert (BARRIER_P (before));
This is OK.
Ciao!
Steven
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-14 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14 12:58 [PATCH] Fix rtl_split_edge (PR rtl-optimization/65761) Jakub Jelinek
2015-04-14 13:22 ` Steven Bosscher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).