public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Bin.Cheng" <amker.cheng@gmail.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>, Jeff Law <law@redhat.com>,
	       Richard Earnshaw <rearnsha@arm.com>,
	Bin Cheng <bin.cheng@arm.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH PR62151]Fix uninitialized register issue caused by distribute_notes in combine pass
Date: Wed, 03 Sep 2014 13:21:00 -0000	[thread overview]
Message-ID: <20140903132057.GA31834@gate.crashing.org> (raw)
In-Reply-To: <CAHFci2-bWoj66MpDmX55xbH7w8B0ajMQPiV1Aun-f5vB_XKm+w@mail.gmail.com>

On Wed, Sep 03, 2014 at 10:34:39AM +0800, Bin.Cheng wrote:
> >> Now I guess this check could be relaxed if somewhere else in combine we'd
> >> recognize the substitution into a clobber and simply omit it in that case.
> >
> > Yeah.
> >
> > In the testcase, combine tries combining 76,77 (77 is that clobbering
> > insn) and refuses it; then it tries 32,76,77 and refuses it; and then
> > it tries 32,76,77,43 and allows it (it doesn't do this check at all,
> > 77 is not i3, combine omits the clobber completely).  Which is inconsistent.
> 
> I guess it makes sense because this way it doesn't introduce any
> invalid instructions.  But yes, how combine handles the clobber in
> this way may help combine the three instructions?

Combine could just throw away all clobbers on i3 and add them back if
wanted by the combined insn.  I think it does things the way it does so
that it creates slightly less garbage RTL and/or it is a little less work.
But it does disallow this case; easily fixed, have patch, will post in a
minute.

That will hide your problem, but not really fix it I think.  Maybe we
need to disallow all combos that set the same register twice in four-insn
combinations.  Or at least when that register does not die.  Why is this
combination tried anyway?  r84 (as set in 77, used in 43) does not die,
so this is just doing a very expensive very limited form of un-cse?


Segher

  reply	other threads:[~2014-09-03 13:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 10:08 Bin Cheng
2014-08-27 10:34 ` Richard Earnshaw
2014-08-28  5:04   ` Bin.Cheng
2014-08-30  5:58     ` Jeff Law
2014-08-31 12:19       ` Segher Boessenkool
2014-09-01  3:36         ` Bin.Cheng
2014-09-01 11:39           ` Segher Boessenkool
2014-09-01 16:52             ` Jeff Law
2014-09-01 17:50               ` Segher Boessenkool
2014-09-02  2:02                 ` Bin.Cheng
2014-09-02 11:40                   ` Segher Boessenkool
2014-09-02  3:35                 ` Jeff Law
2014-09-02 12:10                 ` Ulrich Weigand
2014-09-02 13:41                   ` Segher Boessenkool
2014-09-03  2:36                     ` Bin.Cheng
2014-09-03 13:21                       ` Segher Boessenkool [this message]
2014-09-01 16:52         ` Jeff Law
2014-09-01 19:16           ` Segher Boessenkool
2014-09-02  3:28             ` Jeff Law
2014-09-02  5:18               ` Bin.Cheng
2014-09-05  4:17                 ` Jeff Law
2014-09-02 11:50               ` Segher Boessenkool
2014-09-01  4:18       ` Bin.Cheng
2014-09-02  3:40         ` Jeff Law
2014-09-02  5:15           ` Bin.Cheng
2014-09-05  4:13             ` Jeff Law

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=20140903132057.GA31834@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=amker.cheng@gmail.com \
    --cc=bin.cheng@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rearnsha@arm.com \
    --cc=uweigand@de.ibm.com \
    /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).