public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Marc Lehmann <pcg@goof.com>
Cc: egcs@cygnus.com
Subject: Re: question regarding asm()
Date: Wed, 15 Oct 1997 21:03:00 -0000	[thread overview]
Message-ID: <13876.876974734@hurl.cygnus.com> (raw)
In-Reply-To: <E0xIhvT-00067k-00.1997-10-08-00-16-23_pgcc_forever@cerebro>

  In message < E0xIhvT-00067k-00.1997-10-08-00-16-23_pgcc_forever@cerebro >you write:
  > David Edelsohn wrote:
  > >	Clobber just means that GCC cannot make assumptions about the
  > >register after the call, not before.
  > 
  > That's what I expected, but the docs seems to sugest otherwise..
Why do you think that?  I've always thought the same as David Edelsohn
about clobbers.

Given this asm:

     asm ("movl %0,r9;movl %1,r10;call _foo"
          : /* no outputs */
          : "g" (from), "g" (to)
          : "r9", "r10");

GCC should avoid allocating any of the inputs to the clobbered registers.

However, on some ports, when there aren't enough registers, GCC can't do
this, and in some cases it can't even tell you that it did something
wrong.  This is especially important on machines with weird register
sets like the x86.

This is _precisely_ why I've told folks in the past to avoid sucking
up all the registers for asms -- particularly Linux folk who seem to
write bigger asms than anyone.


jeff

  parent reply	other threads:[~1997-10-15 21:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-07 23:14 Marc Lehmann
1997-10-09  9:26 ` dtm
1997-10-15 21:03 ` Jeffrey A Law [this message]
1997-10-16  8:31   ` Richard Henderson
1997-10-16 15:19     ` Jeffrey A Law
1997-10-17  1:22       ` Bernd Schmidt
1997-10-17 12:44         ` Jeffrey A Law
1997-10-17 12:53         ` Michael Meissner
1997-10-20  4:29           ` Bernd Schmidt
  -- strict thread matches above, loose matches on Subject: below --
1997-12-09  7:28 Christian Iseli
1997-10-29  9:17 Christian Iseli
1997-10-29  2:28 Christian Iseli
1997-10-28  8:31 Christian Iseli
1997-10-28 10:25 ` Joern Rennecke
1997-10-29  5:13 ` Bernd Schmidt
     [not found] <9710040128.AA17540@rios1.watson.ibm.com>
1997-10-04  6:04 ` Marc Lehmann
1997-10-03 18:13 Marc Lehmann

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=13876.876974734@hurl.cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=pcg@goof.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).