public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilson at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/43760] [4.6 regression] New test failures
Date: Tue, 20 Apr 2010 01:55:00 -0000	[thread overview]
Message-ID: <20100420015459.2582.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43760-682@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from wilson at codesourcery dot com  2010-04-20 01:54 -------
Subject: Re:  [4.6 regression] New test failures

On Tue, 2010-04-20 at 00:01 +0000, sje at cup dot hp dot com wrote:
> Any ideas on how to fix the compiler?  The best idea I could come up with was
> to check each basic block to see if there are any conditional sets of predicate
> registers in it and add pred.rel.mutex lines for those registers.  If we add
> pred.rel.mutex lines for all used predicate registers we wind up adding a lot
> of unneeded pred.rel.mutex statements.

I haven't had a chance to look at all of the details yet.

I believe that we only need to handle the case when one mutex pair is
used to create another one, e.g. something like
       (p17) cmp.geu p6, p7 = r42, r51
       (p16) cmp.gtu p6, p7 = r42, r51
We also only need to handle the case where we have a call-clobbered
mutex pair, e.g. p6/p7 in this case, and there was a call insn in
between here and any previous set of p6/p7.

Currently, we only insert pred.rel.mutex lines at the beginning of basic
blocks that start with labels.  So now we also need to emit them after
such sequences, or alternatively after calls.

I'm not sure if the assembler is wrong here.  mutex just means that we
will never have both p16 and p17 set at the same time.  So there are 3
possibilities, p16 true, p17 true, neither true.  If p16 is true, then
clearly p6/p7 will be mutex.  Likewise if p17 is true.  But if neither
is true, then p6/p7 will be unmodified, and hence aren't guaranteed to
be mutex unless they were already mutex before these lines.  This is why
it only fails when we have a call-clobbered mutex pair after an
intervening call, as now we don't know anything about the previous
values of p6/p7.

If we know that p16/p17 were set in a simple compare, then we will know
that 1 and only 1 will be true, which is a stronger condition than
mutex, and in this case p6/p7 will be mutex.  There is no
standard .pred.rel syntax for this though, which means that if the
p16/p17 set was in a different basic block, and we have only
the .pred.rel.mutex line inserted by the compiler, then the assembler
can't prove that p6/p7 will be mutex after this point.  I'm not eager to
extend the assembler syntax to fix this, and rewrite the DV code in the
assembler, so I'm hoping that we can fix it in the compiler by emitting
another .pred.rel.mutex line in this case.  This hopefully doesn't
happen too often and isn't too hard.

OK, maybe I have studied it a little, but I need to look at this a bit
more before I'm sure I understand everything that is going on here.

Jim


-- 


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


  parent reply	other threads:[~2010-04-20  1:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 14:08 [Bug middle-end/43760] New: " hjl dot tools at gmail dot com
2010-04-15 14:17 ` [Bug middle-end/43760] " rguenth at gcc dot gnu dot org
2010-04-19 21:31 ` sje at cup dot hp dot com
2010-04-19 23:28 ` wilson at gcc dot gnu dot org
2010-04-20  0:01 ` sje at cup dot hp dot com
2010-04-20  1:55 ` wilson at codesourcery dot com [this message]
2010-04-26 15:47 ` wilson at gcc dot gnu dot org
2010-09-02 10:36 ` rguenth at gcc dot gnu dot org
2010-09-02 18:27 ` sje at cup dot hp dot com
     [not found] <bug-43760-4@http.gcc.gnu.org/bugzilla/>
2010-10-18 21:35 ` sje at gcc dot gnu.org
2010-10-18 21:48 ` sje at cup dot hp.com

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=20100420015459.2582.qmail@sourceware.org \
    --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).