This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: output # <srcline> between #APP and #NO_APP, for asm statements


On Mar  9, 2007, Andreas Schwab <schwab@suse.de> wrote:

> No mixed declarations and code.

Ugh, thanks.  Fixed thusly.  (Only compile-checked).

Shouldn't bootstrap somehow check this, at least for the C front-end?

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* recog.c (decode_asm_operands): No mixed declarations and code.

Index: gcc/recog.c
===================================================================
--- gcc/recog.c.orig	2007-03-09 04:24:37.000000000 -0300
+++ gcc/recog.c	2007-03-09 07:36:36.000000000 -0300
@@ -1,6 +1,7 @@
 /* Subroutines used by or related to instruction recognition.
    Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1554,11 +1555,13 @@ decode_asm_operands (rtx body, rtx *oper
 	   && GET_CODE (XVECEXP (body, 0, 0)) == SET
 	   && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) == ASM_OPERANDS)
     {
-      asmop = SET_SRC (XVECEXP (body, 0, 0));
       int nparallel = XVECLEN (body, 0); /* Includes CLOBBERs.  */
-      int nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
+      int nin;
       int nout = 0;		/* Does not include CLOBBERs.  */
 
+      asmop = SET_SRC (XVECEXP (body, 0, 0));
+      nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
+
       /* At least one output, plus some CLOBBERs.  */
 
       /* The outputs are in the SETs.
@@ -1596,8 +1599,10 @@ decode_asm_operands (rtx body, rtx *oper
     {
       /* No outputs, but some CLOBBERs.  */
 
+      int nin;
+
       asmop = XVECEXP (body, 0, 0);
-      int nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
+      nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
 
       for (i = 0; i < nin; i++)
 	{
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]