public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "abel at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/55889] [4.8 Regression] ICE: in move_op_ascend, at sel-sched.c:6153 with -fschedule-insns -fselective-scheduling
Date: Wed, 23 Jan 2013 11:11:00 -0000	[thread overview]
Message-ID: <bug-55889-4-1hjLETEOH5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55889-4@http.gcc.gnu.org/bugzilla/>


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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

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

--- Comment #21 from Andrey Belevantsev <abel at gcc dot gnu.org> 2013-01-23 11:11:22 UTC ---
Thanks again folks, it's much simpler with gdb.  So the reason of the
difference that shows up in the ICE is the ira_implicitly_set_insn_hard_regs
function.  Recall that we have insns 23 and 24 like this:

   23: r148:SI=[unspec[`*LC..2',%2:SI] 44]
   24: %3:SI=[unspec[`*LCM..2',%2:SI] 44]

and insn 17 like this:

   17: {%3:SI=unspec[%3:SI,%4:SI] 25;clobber %0:SI;clobber %4:SI;clobber
%5:SI;clobber %11:SI;clobber %0:CC;clobber lr:SI;}

The dependency between insns 23 and 17 is because insn 17 clobbers reg 65 (I
guess it is lr in the dump).  When analyzing insn 23,
ira_implicitly_set_insn_hard_regs is called and it notices we have a pseudo-reg
148.  The function attempts to restrict the insn movement by marking the
registers that might be required by the "strict" alternatives of the insn as
implicit clobbers.  For insn 23 it marks reg 65 from LINK_REGS ('l' constraint)
and reg 66 from CTR_REGS ('c' constraint AFAIR).  Now we have an
anti-dependency via clobbering reg 65 with insn 17.

Insn 24 already has the hard register assigned (%3), so the above logic does
not apply and we don't get the implicit clobbers on this insn and thus a
dependency with insn 17.

In short, the implicit clobbers thing disagrees with the assumption sel-sched
mades: that renaming a hard register to a pseudo is always possible given that
the resulting insn is recognized and will never create extra dependencies.

So the choices we have are as follows:

1) make the if (! reload_completed) at sched-deps.c:2805 also conditional on
-fsched-pressure and make sel-sched incompatible with -fsched-pressure by
disallowing to specify both options at the same time. That is,
-fselective-scheduling will disable -fsched-pressure with a note to the user.

2) make the selective scheduler account for the situation when renaming a hard
register to a pseudo register before reload with sched-pressure enabled might
create extra dependencies, then insn 24 will never be considered for renaming
and the problem will be fixed.

I can do either 1 or 2, no problem with any of those given enough time until
4.8.

Thoughts?


  parent reply	other threads:[~2013-01-23 11:11 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06 18:55 [Bug middle-end/55889] New: " dje at gcc dot gnu.org
2013-01-06 18:56 ` [Bug middle-end/55889] " dje at gcc dot gnu.org
2013-01-07 15:55 ` rguenth at gcc dot gnu.org
2013-01-08 12:19 ` jakub at gcc dot gnu.org
2013-01-08 21:56 ` dje at gcc dot gnu.org
2013-01-09  2:53 ` dje at gcc dot gnu.org
2013-01-09 14:26 ` abel at gcc dot gnu.org
2013-01-11 14:24 ` abel at gcc dot gnu.org
2013-01-11 14:38 ` dje at gcc dot gnu.org
2013-01-18 11:09 ` abel at gcc dot gnu.org
2013-01-18 16:49 ` dje at gcc dot gnu.org
2013-01-18 16:57 ` dje at gcc dot gnu.org
2013-01-21 10:16 ` abel at gcc dot gnu.org
2013-01-21 12:53 ` jakub at gcc dot gnu.org
2013-01-21 13:24 ` abel at gcc dot gnu.org
2013-01-21 15:14 ` dje at gcc dot gnu.org
2013-01-21 15:16 ` dje at gcc dot gnu.org
2013-01-21 15:25 ` jakub at gcc dot gnu.org
2013-01-21 15:38 ` dje at gcc dot gnu.org
2013-01-21 15:42 ` dje at gcc dot gnu.org
2013-01-21 15:54 ` jakub at gcc dot gnu.org
2013-01-21 17:32 ` abel at gcc dot gnu.org
2013-01-23 11:11 ` abel at gcc dot gnu.org [this message]
2013-01-24  2:36 ` dje at gcc dot gnu.org
2013-01-24 13:37 ` abel at gcc dot gnu.org
2013-01-24 16:37 ` dje at gcc dot gnu.org
2013-01-31 17:50 ` dje at gcc dot gnu.org
2013-02-01 12:22 ` abel at gcc dot gnu.org
2013-02-06 21:38 ` vmakarov at gcc dot gnu.org
2013-02-14  6:11 ` abel at gcc dot gnu.org
2013-02-14 16:48 ` vmakarov at redhat dot com
2013-02-15 13:48 ` abel at gcc dot gnu.org
2013-02-15 16:15 ` dje at gcc dot gnu.org
2013-02-19 13:51 ` abel at gcc dot gnu.org
2013-02-19 13:55 ` abel 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-55889-4-1hjLETEOH5@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).