public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* expand_asm_operands bug in 2.8.0
@ 1998-02-03  2:08 Bernd Schmidt
  1998-02-05 22:09 ` Jeffrey A Law
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Schmidt @ 1998-02-03  2:08 UTC (permalink / raw)
  To: kenner; +Cc: egcs

There was a change in GCC 2.8.0 to treat assembler statements with no
outputs as volatile. Unfortunately, it causes assembler statements with
exactly one output to be treated as volatile as well. In recent
Linux 2.1.x kernels, this causes rather bad code to be generated at times.

The patch below applies to GCC 2.8.0. For egcs, one part of it already exists
in the source, only the 2.8.0 method has to be deleted.

Bernd

	* stmt.c (expand_asm_operands): Undo change to treat assembler
	statements with no operands as volatile; use a different patch from
	egcs instead.

*** ./stmt.c.orig-1	Mon Feb  2 21:17:53 1998
--- ./stmt.c	Mon Feb  2 21:19:22 1998
*************** 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");
*************** expand_asm_operands (string, outputs, in
*** 1566,1574 ****
  		  TREE_STRING_POINTER (string), "", 0, argvec, constraints,
  		  filename, line);
  
!   /* The only use of BODY is if no outputs are specified, so set
!      it volatile, at least for now.  */
!   MEM_VOLATILE_P (body) = 1;
  
    /* Eval the inputs and put them into ARGVEC.
       Put their constraints into ASM_INPUTs and store in CONSTRAINTS.  */
--- 1570,1576 ----
  		  TREE_STRING_POINTER (string), "", 0, argvec, constraints,
  		  filename, line);
  
!   MEM_VOLATILE_P (body) = vol;
  
    /* Eval the inputs and put them into ARGVEC.
       Put their constraints into ASM_INPUTs and store in CONSTRAINTS.  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: expand_asm_operands bug in 2.8.0
  1998-02-03  2:08 expand_asm_operands bug in 2.8.0 Bernd Schmidt
@ 1998-02-05 22:09 ` Jeffrey A Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 1998-02-05 22:09 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: kenner, egcs

  In message < Pine.SOL.3.90.980203110130.16102H-100000@mccabe.informatik.rwth-aachen.de >you write:
  > There was a change in GCC 2.8.0 to treat assembler statements with no
  > outputs as volatile. Unfortunately, it causes assembler statements with
  > exactly one output to be treated as volatile as well. In recent
  > Linux 2.1.x kernels, this causes rather bad code to be generated at times.
  > 
  > The patch below applies to GCC 2.8.0. For egcs, one part of it already exis
  > ts
  > in the source, only the 2.8.0 method has to be deleted.
  > 
  > Bernd
  > 
  > 	* stmt.c (expand_asm_operands): Undo change to treat assembler
  > 	statements with no operands as volatile; use a different patch from
  > 	egcs instead.
Agreed and installed into egcs.

jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-02-05 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-03  2:08 expand_asm_operands bug in 2.8.0 Bernd Schmidt
1998-02-05 22:09 ` Jeffrey A Law

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).