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]

fix c/5609


Shame on me for being so sloppy.


r~


        * stmt.c (resolve_operand_name_1): Take more care with mixed
        named and unnamed operands.

        * gcc.dg/asm-4.c: Add case with an unnamed operand in the middle.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.245
retrieving revision 1.246
diff -c -p -d -r1.245 -r1.246
*** stmt.c	2002/02/04 22:05:09	1.245
--- stmt.c	2002/02/07 01:38:39	1.246
*************** resolve_operand_name_1 (p, outputs, inpu
*** 2149,2163 ****
    /* Resolve the name to a number.  */
    for (op = 0, t = outputs; t ; t = TREE_CHAIN (t), op++)
      {
!       const char *c = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (t)));
!       if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
! 	goto found;
      }
    for (t = inputs; t ; t = TREE_CHAIN (t), op++)
      {
!       const char *c = IDENTIFIER_POINTER (TREE_PURPOSE (TREE_PURPOSE (t)));
!       if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
! 	goto found;
      }
  
    *q = '\0';
--- 2149,2171 ----
    /* Resolve the name to a number.  */
    for (op = 0, t = outputs; t ; t = TREE_CHAIN (t), op++)
      {
!       tree id = TREE_PURPOSE (TREE_PURPOSE (t));
!       if (id)
! 	{
! 	  const char *c = IDENTIFIER_POINTER (id);
! 	  if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
! 	    goto found;
! 	}
      }
    for (t = inputs; t ; t = TREE_CHAIN (t), op++)
      {
!       tree id = TREE_PURPOSE (TREE_PURPOSE (t));
!       if (id)
! 	{
! 	  const char *c = IDENTIFIER_POINTER (id);
! 	  if (strncmp (c, p + 1, len) == 0 && c[len] == '\0')
! 	    goto found;
! 	}
      }
  
    *q = '\0';
Index: testsuite/gcc.dg/asm-4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/asm-4.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -p -d -r1.2 -r1.3
*** asm-4.c	2001/12/24 06:15:31	1.2
--- asm-4.c	2002/02/07 01:38:40	1.3
*************** int main()
*** 8,13 ****
--- 8,14 ----
    asm volatile ("test0 X%0Y%[arg]Z" : [arg] "=g" (x));
    asm volatile ("test1 X%[out]Y%[in]Z" : [out] "=g" (y) : [in] "0"(y));
    asm volatile ("test2 X%a0Y%a[arg]Z" : : [arg] "p" (&z));
+   asm volatile ("test3 %[in]" : [inout] "=g"(x) : "[inout]" (x), [in] "g" (y));
  }
  
  /* ??? Someone explain why the back reference dosn't work.  */


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