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/61058] [4.7/4.8/4.9/4.10 Regression] ICE: RTL check: expected elt 3 type 'B', have '0' (rtx barrier) in distance_agu_use_in_bb, at config/i386/i386.c:16740 with __builtin_unreachable()
Date: Mon, 12 May 2014 10:28:00 -0000	[thread overview]
Message-ID: <bug-61058-4-viz9ZVwfPL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61058-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the buggy pass here is:
static unsigned int
cleanup_barriers (void)
{
  rtx insn, next, prev;
  for (insn = get_insns (); insn; insn = next)
    {
      next = NEXT_INSN (insn);
      if (BARRIER_P (insn))
        {
          prev = prev_nonnote_insn (insn);
          if (!prev) 
            continue;
          if (BARRIER_P (prev))
            delete_insn (insn);
          else if (prev != PREV_INSN (insn))
            reorder_insns_nobb (insn, insn, prev);
        }
    }
  return 0;
}

At the start of that pass we have:
(note 3 1 9 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(insn/f 9 3 10 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [0  S8 A8])
        (reg/f:DI 6 bp)) pr61058.c:3 -1
     (nil))
(insn/f 10 9 11 2 (set (reg/f:DI 6 bp)
        (reg/f:DI 7 sp)) pr61058.c:3 -1
     (nil))
(note 11 10 2 2 NOTE_INSN_PROLOGUE_END)
(note 2 11 5 2 NOTE_INSN_FUNCTION_BEG)
(barrier 5 2 8)
(note 8 5 0 NOTE_INSN_DELETED)

where BB_HEAD (bb2) is note 3 and BB_END (bb2) is note 2, note 8 has been added
by LRA (but reload does that too AFAIK), both barrier and note are outside of
the bb 2.
Now, the above reorders the barrier after insn 10, making it part of bb2
because BB_END (bb2) isn't adjusted.

So, either cleanup_barriers should not move anything here (e.g. because prev
doesn't satisfy control_flow_insn_p (prev)), and/or, of it decides to move
something, it has to take care of adjusting the affected basic blocks (but how?
Would we keep the two notes (11 and 2) without basic block).
Do we need the cleanup_barriers pass at all these days?


  parent reply	other threads:[~2014-05-12 10:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-04 19:04 [Bug target/61058] New: " zsojka at seznam dot cz
2014-05-05  9:14 ` [Bug target/61058] " rguenth at gcc dot gnu.org
2014-05-05  9:34 ` ubizjak at gmail dot com
2014-05-05 18:50 ` ubizjak at gmail dot com
2014-05-05 21:06 ` ubizjak at gmail dot com
2014-05-12  9:45 ` [Bug rtl-optimization/61058] " jakub at gcc dot gnu.org
2014-05-12 10:28 ` jakub at gcc dot gnu.org [this message]
2014-05-12 10:48 ` jakub at gcc dot gnu.org
2014-06-12 13:48 ` rguenth at gcc dot gnu.org
2014-12-19 13:42 ` [Bug rtl-optimization/61058] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-01-27  9:22 ` jakub at gcc dot gnu.org
2015-01-27  9:30 ` [Bug rtl-optimization/61058] [4.8/4.9 " jakub at gcc dot gnu.org
2015-02-01 17:37 ` jakub at gcc dot gnu.org
2015-02-01 21:56 ` jakub at gcc dot gnu.org
2015-02-01 21:58 ` jakub 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-61058-4-viz9ZVwfPL@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).