public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@hurl.cygnus.com>
To: "Albert D. Cahalan" <acahalan@cs.uml.edu>
Cc: linux-kernel@vger.rutgers.edu
Subject: Re: egcs 1.0.1 miscompiles Linux 2.0.33
Date: Wed, 04 Mar 1998 17:34:31 -0700	[thread overview]
Message-ID: <3451.889058071@hurl.cygnus.com> (raw)
In-Reply-To: Your message of Wed, 04 Mar 1998 19:21:01 MST. <199803050021.TAA10868@saturn.cs.uml.edu>


  In message <199803050021.TAA10868@saturn.cs.uml.edu>you write:
  > > Any asm which sets up a case where a clobber must match an input
  > > is wrong.  Plain and simple, it is wrong.
  > 
  > OK, this is a user interface issue. It seems most people want to
  > specify clobbered inputs. Why not support it? Just detect the case
  > and convert it to the way gcc wants to do things internally.
Doing this directly violates the GCC asm documentation.  Supporting
this also makes it much more difficult to fix a particular bug in
asm support that shows up on the x86.


  > if is_input and is_clobber then ...
  > 
  > > By claiming its a dummy output the compiler will not
  > > try to use that register to hold any other values across
  > > the asm statement.
  > 
  > Dummy outputs are a way to hack around the problem.
  > Think about it. Doesn't it look gross to you?
Marginally gross, but it describes the situation in such a way
as to make it possible for the compiler to do the right thing.

It also more closely models how machine descriptions are written
which will improve the reliability of your asm constructs.  In
fact this is *exactly* how similar situations are described in
the machine descriptions.

It also will allow for more compile-time checks of your asm statements
instead of letting the compiler silently generate incorrect code
(which is exactly what got this whole discussion started).

It also gives you the capability of allowing the compiler to select
a register which will allow the compiler to generate more efficient
code (assuming of course the asm statements are capable of using
varying registers).

It's also a tiny step in the right direction if we were to ever turn
off the SMALL_REGISTER_CLASSES hack/pessimization that is needed on
the x86 port.

Using a matching constraint and early clobber will work on more
than just the x86 port.  The hack currently used on x86 Linux
isn't likely to work on any port other than the x86.

In fact, in a private message Linus even said using earlyclobbers
with matching constraints was cleaner than showing the same reg
as an input and clobber.


  > > The need for the mechanism is obvious, the mechanism currently
  > > used by Linux is wrong.
  > 
  > Is it legal for any other purpose? If not, then nothing will break
  > when gcc does what most developers seem to expect.
No, the mechanism currently used by Linux is not valid in any
context.  You've been able to get away with it over the years, but
that doesn't make it correct or valid.


jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

       reply	other threads:[~1998-03-05  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199803050021.TAA10868@saturn.cs.uml.edu>
1998-03-05  0:34 ` Jeffrey A Law [this message]
     [not found] <34FE6DB6.4D2CCA22@wtal.de>
1998-03-09  6:27 ` egcs 1.0.1 miscompiles Linux 2.0.33 Jeffrey A Law
     [not found] <34FBCB0C.42D8AD1C@wtal.de>
1998-03-04 18:26 ` Jeffrey A 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=3451.889058071@hurl.cygnus.com \
    --to=law@hurl.cygnus.com \
    --cc=acahalan@cs.uml.edu \
    --cc=law@cygnus.com \
    --cc=linux-kernel@vger.rutgers.edu \
    /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