public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/52139] [4.5/4.6/4.7 Regression] ICE: in remove_insn, at emit-rtl.c:3960 with -O -fPIC -fno-tree-dominator-opts -fno-tree-fre
Date: Tue, 07 Feb 2012 11:43:00 -0000	[thread overview]
Message-ID: <bug-52139-4-eTJ5LKI4Qf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52139-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52139

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-07 11:42:35 UTC ---
Created attachment 26602
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26602
gcc47-pr52139.patch

Ugh, this is ugly.  The main problem is that delete_insn/remove_insn refuse to
remove insns with NEXT_INSN (insn) == NULL_RTX (unless they are in the current
sequence or in the sequence stack).  Unfortunately in the cfglayout mode BB_END
or end of bb->il.rtl->{header,footer} often/always have it NULL.

In this testcase, we are merging two bbs where the first bb ends with an
unconditional jump to the second and second bb contains switch table followed
by barrier in its header, then deleted label, then NOTE_INSN_BASIC_BLOCK and
that is the last insn in that bb.  The first problem is that we
delete_insn_chain in the header just all but the last insn, so BB_END (a)
points to a BARRIER.  And the second problem is that when removing the
NOTE_INSN_BASIC_BLOCK note using delete_insn, NEXT_INSN (note) is NULL and thus
remove_insn ICEs.

The following ugly hacks fix it, but am not very happy about them.


  parent reply	other threads:[~2012-02-07 11:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 19:48 [Bug tree-optimization/52139] New: ICE: in remove_insn, at emit-rtl.c:3960 with -O -fPIC -fno-tree-dominator-opts -fno-tree-fre --param case-values-threshold=1 zsojka at seznam dot cz
2012-02-06 19:55 ` [Bug rtl-optimization/52139] " zsojka at seznam dot cz
2012-02-06 20:03 ` [Bug rtl-optimization/52139] [4.5/4.6/4.7 Regression] ICE: in remove_insn, at emit-rtl.c:3960 with -O -fPIC -fno-tree-dominator-opts -fno-tree-fre jakub at gcc dot gnu.org
2012-02-07 11:43 ` jakub at gcc dot gnu.org [this message]
2012-02-07 12:21 ` jakub at gcc dot gnu.org
2012-02-07 13:23 ` jakub at gcc dot gnu.org
2012-02-07 15:47 ` rguenth at gcc dot gnu.org
2012-02-08 12:30 ` jakub at gcc dot gnu.org
2012-02-09 17:33 ` [Bug rtl-optimization/52139] [4.5/4.6 " jakub at gcc dot gnu.org
2012-02-09 21:39 ` [Bug rtl-optimization/52139] [4.5 " jakub at gcc dot gnu.org
2012-02-09 21:50 ` jakub at gcc dot gnu.org
2013-04-11 19:23 ` steven at gcc dot gnu.org
2013-04-11 19:26 ` steven at gcc dot gnu.org
2013-04-13 14:58 ` steven at gcc dot gnu.org
2013-04-16 20:15 ` steven at gcc dot gnu.org

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=bug-52139-4-eTJ5LKI4Qf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).