This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
expand_asm_operands bug in 2.8.0
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: expand_asm_operands bug in 2.8.0
- From: Bernd Schmidt <crux at pool dot informatik dot rwth-aachen dot de>
- Date: Tue, 3 Feb 1998 11:05:39 +0100 (MET)
- cc: egcs at cygnus dot com
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. */