public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>, Jeff Law <law@redhat.com>,
	       Eric Botcazou <ebotcazou@adacore.com>,
	Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix rtl_split_edge (PR rtl-optimization/65761)
Date: Tue, 14 Apr 2015 12:58:00 -0000	[thread overview]
Message-ID: <20150414125835.GK1725@tucnak.redhat.com> (raw)

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

             reply	other threads:[~2015-04-14 12:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 12:58 Jakub Jelinek [this message]
2015-04-14 13:22 ` Steven Bosscher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150414125835.GK1725@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=law@redhat.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).