public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Paul Koning <pkoning@xedia.com>
Cc: egcs@cygnus.com, Linus Torvalds <torvalds@transmeta.com>
Subject: Re: Linux and EGCS
Date: Mon, 15 Dec 1997 07:49:00 -0000	[thread overview]
Message-ID: <28786.882200973@hurl.cygnus.com> (raw)
In-Reply-To: <9712121715.AA19735@kona.>

  In message <9712121715.AA19735@kona.>you write:
  > >>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:
  > 
  >  Jeffrey> Can either of you re-send me a testcase for the problem of
  >  Jeffrey> moving asm statements with no outputs?  I'd like to take a
  >  Jeffrey> look at this proble over the weekend if possible.
  > 
  > Attached is one I concocted out of one of our source files, where I
  > first spotted the problem.  I don't remember if this particular file
  > shows it when compiled for an x86 target (I think it doesn't; I do
  > remember that it definitely does not show the problem on a sparc
  > target).  It WILL show it on a mips64 target (when compiled -O3)
OK.  Thanks.

Interesting, from what I can find, it looks like gcc-2.7 worked correctly
more by accident than by design.  Particularly in the scheduler.

Seems to me the easiest and most correct fix is to set the volatile bit on
an asm which has no outputs.

Can you try this change and let me know if it fixes your problems?  If so
I'd like to include it in egcs-1.0.1.

	* stmt.c (expand_asm_operands): If an ASM has no outputs, then treat
	it as volatile.

Index: stmt.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/stmt.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 stmt.c
*** stmt.c	1997/12/11 16:26:01	1.10
--- stmt.c	1997/12/15 15:44:17
*************** expand_asm_operands (string, outputs, in
*** 1421,1426 ****
--- 1421,1430 ----
    /* The insn we have emitted.  */
    rtx insn;
  
+   /* An ASM with no outputs needs to be treated as volatile.  */
+   if (noutputs == 0)
+     vol = 1;
+ 
    if (output_bytecode)
      {
        error ("`asm' is invalid when generating bytecode");

       reply	other threads:[~1997-12-15  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9712121715.AA19735@kona.>
1997-12-15  7:49 ` Jeffrey A Law [this message]
1997-12-15 12:14   ` Paul Koning
1997-12-15 17:27 Peter Schmid
1997-12-15 18:25 ` Richard Henderson
1997-12-15 22:21 ` Jeffrey A Law
     [not found] <9712101650.AA16396@kona.>
1997-12-10 10:58 ` Linus Torvalds

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=28786.882200973@hurl.cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=pkoning@xedia.com \
    --cc=torvalds@transmeta.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).