public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Geoffrey KEATING <geoffk@discus.anu.edu.au>
Cc: egcs@cygnus.com
Subject: Re: asm clobbers, !SMALL_REGISTER_CLASSES patch.
Date: Fri, 13 Feb 1998 02:28:00 -0000	[thread overview]
Message-ID: <25345.887357311@hurl.cygnus.com> (raw)
In-Reply-To: <9802130410.AA27074@rios1.watson.ibm.com>

  In message < 9802130410.AA27074@rios1.watson.ibm.com > David Edelsohn wrote:
  >         * stmt.c (expand_asm_operands): When an asm statement
  >         clobbers a register that is in a class of its own, and there
  >         is space remaining for an extra output, turn the clobber into
  >         an output to a dummy pseudo.  At present, don't do this if
  >         there are constraints that have alternatives.
  > 
  > 	This is a good effort and I am glad that you are continuing to
  > pursue this needed feature, but I am curious why you are choosing to
  > implement it this way instead of as a match_scratch of the appropriate
  > register class?  I think that the correct solution is to turn the clobber
  > of a named register into the equivalent that GCC uses internally for
  > machine description files: match_scratch.  This patch probably works to
  > some extent, but it simply lies to GCC by transforming the clobber -- and
  > lying to GCC always causes problems in the long run.
David's approach sounds cleaner, but I haven't thought too much about
where to "hook in" and do this.

Also, with your patch you could end up introducing new aborts.

Basically, if you had two asms which clobbered "r1" (assume that it is
in a class by itself) and you were only able to "fix" one of them
with your trick, then you can lose.

Basically you end up with r1 appearing explicitly in the unfixed asm, and
appearing via a pseudo which must be allocated to r1 in the fixed asm.
At some point this will cause reload to abort -- it might take a million
lines of code to trigger it, but it will eventually bite you.

If you fix one, you need to fix them all.

Note the same applies to David's approach.  In fact, we may have a fundamental
problem -- if the register appeared as an explicit inout/output to one
asm, but was turned into a max_scratch for another asm because it was a 
clobber, then we run into the same problem.  So it seems that we have to
fix the inputs, outputs, and clobbers.  Yuck.  Sorry I didn't think of this
earlier.

jeff


  parent reply	other threads:[~1998-02-13  2:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-12 19:36 Geoffrey KEATING
1998-02-12 20:24 ` David Edelsohn
1998-02-12 20:24   ` Geoffrey KEATING
1998-02-13  2:28   ` Jeffrey A Law [this message]
1998-02-13  2:28     ` Geoffrey KEATING
1998-02-14  0:32       ` Jeffrey A Law
1998-02-14 21:14         ` Geoffrey KEATING
1998-02-15 11:33           ` Jeffrey A Law
1998-02-15 18:47             ` David Edelsohn
1998-02-13  2:28   ` Richard Henderson
1998-02-13 10:34     ` David Edelsohn
1998-02-13 10:58       ` Richard Henderson
1998-02-13 10:58         ` David Edelsohn
1998-02-14 20:23         ` Geoffrey KEATING

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=25345.887357311@hurl.cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=geoffk@discus.anu.edu.au \
    /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).