public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Lehmann <pcg@goof.com>
To: egcs@cygnus.com
Subject: question regarding asm()
Date: Fri, 03 Oct 1997 18:13:00 -0000	[thread overview]
Message-ID: <E0xHIkw-00014T-00.1997-10-04-03-11-42_pgcc_forever_@cerebro> (raw)

in the info file, this asm is given as an example of specifying registers to
be clobbered:

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

Now I have a question.. is gcc supposed to avoid allocating r9 to %1 ??

in fact, gcc tries to avoid allocating "clobbered" registers for input operands,
but if there are no registers left gcc will nevertheless use them.

So, under register pressure, gcc might use r9 for input operand %1.

There was a problem in the linux kernel because egcs allocated
a register for an input operand that was also in the clobberlist
(and actually was overwritten before the input operand was used).

so whats wrong?

a) the example in the documentation
b) gcc, because it allocates wrong registers for the input operands
c) me, because I'm totally confused tonight..

;?

      -----==-
      ----==-- _
      ---==---(_)__  __ ____  __       Marc Lehmann
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com
      -=====/_/_//_/\_,_/ /_/\_\
    The choice of a GNU generation

             reply	other threads:[~1997-10-03 18:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-03 18:13 Marc Lehmann [this message]
     [not found] <9710040128.AA17540@rios1.watson.ibm.com>
1997-10-04  6:04 ` Marc Lehmann
1997-10-07 23:14 Marc Lehmann
1997-10-09  9:26 ` dtm
1997-10-15 21:03 ` Jeffrey A Law
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
1997-10-28  8:31 Christian Iseli
1997-10-28 10:25 ` Joern Rennecke
1997-10-29  5:13 ` Bernd Schmidt
1997-10-29  2:28 Christian Iseli
1997-10-29  9:17 Christian Iseli
1997-12-09  7:28 Christian Iseli

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=E0xHIkw-00014T-00.1997-10-04-03-11-42_pgcc_forever_@cerebro \
    --to=pcg@goof.com \
    --cc=egcs@cygnus.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).