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]

adjust asm lvalue warning


We were warning for "m"(*p++) because the queued address
isn't recognizable.  I think just looking to see that we
have a MEM is sufficient at this stage.


r~


        * stmt.c (expand_asm_operands): Don't warn for memories with
        queued addresses.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.305
diff -c -p -d -u -r1.305 stmt.c
--- stmt.c	9 Jun 2003 21:28:21 -0000	1.305
+++ stmt.c	12 Jun 2003 00:56:50 -0000
@@ -1765,10 +1765,11 @@ expand_asm_operands (string, outputs, in
 	  else if (!allows_mem)
 	    warning ("asm operand %d probably doesn't match constraints",
 		     i + noutputs);
-	  else if (GET_CODE (op) == MEM && MEM_VOLATILE_P (op))
+	  else if (GET_CODE (op) == MEM)
 	    {
-	      /* We won't recognize volatile memory as available a
-		 memory_operand at this point.  Ignore it.  */
+	      /* We won't recognize either volatile memory or memory
+		 with a queued address as available a memory_operand
+		 at this point.  Ignore it: clearly this *is* a memory.  */
 	    }
 	  else
 	    {
Index: testsuite/gcc.dg/asm-7.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/asm-7.c,v
retrieving revision 1.2
diff -c -p -d -u -r1.2 asm-7.c
--- testsuite/gcc.dg/asm-7.c	10 Jun 2003 16:14:08 -0000	1.2
+++ testsuite/gcc.dg/asm-7.c	12 Jun 2003 00:59:15 -0000
@@ -7,12 +7,14 @@ void test(void)
   register int r2;
   int i;
   static int m;
+  int *p;
 
   __asm__ ("" : : "m"(r));	/* { dg-warning "address of register" } */
   __asm__ ("" : : "m"(i));
   __asm__ ("" : : "m"(m));
   __asm__ ("" : : "m"(0));	/* { dg-warning "input without lvalue" } */
   __asm__ ("" : : "m"(i+1));	/* { dg-warning "input without lvalue" } */
+  __asm__ ("" : : "m"(*p++));
 
   __asm__ ("" : : "g"(r));
   __asm__ ("" : : "g"(i));


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