This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linux and EGCS
- To: Paul Koning <pkoning at xedia dot com>
- Subject: Re: Linux and EGCS
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 15 Dec 1997 08:49:33 -0700
- Cc: egcs at cygnus dot com, Linus Torvalds <torvalds at transmeta dot com>
- Reply-To: egcs at cygnus dot com
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");