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: PR 27528: Expanding constant asm operands


> s/"# %0 %1"/""/.  My understanding was that gcc wouldn't try to
> drop operands that don't appear in the template.

That works, but I wouldn't have written it myself! :-)

May I commit this to both mainline and 4.2 branch?


	* gcc.c-torture/compile/pr27528.c: Use empty templates.


-- 
Eric Botcazou
Index: gcc.c-torture/compile/pr27528.c
===================================================================
--- gcc.c-torture/compile/pr27528.c	(revision 119704)
+++ gcc.c-torture/compile/pr27528.c	(working copy)
@@ -6,13 +6,13 @@
 static inline void __attribute__((__always_inline__))
 insn1 (int x)
 {
-  asm volatile ("# %0 %1" :: "n" (x), "i" (x));
+  asm volatile ("" :: "n" (x), "i" (x));
 }
 
 static inline void __attribute__((__always_inline__))
 insn2 (const void *x)
 {
-  asm volatile ("# %0 %1" :: "s" (x), "i" (x));
+  asm volatile ("" :: "s" (x), "i" (x));
 }
 #endif
 
@@ -29,10 +29,10 @@
   insn2 (&x[1]);
   insn2 ("string");
 #endif
-  asm volatile ("# %0 %1" :: "s" (x), "i" (x));
+  asm volatile ("" :: "s" (x), "i" (x));
   /* At the time of writing, &x[1] is decomposed before reaching expand
      when compiling with -O0.  */
-  asm volatile ("# %0 %1" :: "s" ("string"), "i" ("string"));
-  asm volatile ("# %0 %1" :: "s" (__FILE__), "i" (__FILE__));
-  asm volatile ("# %0 %1" :: "s" (__FUNCTION__), "i" (__FUNCTION__));
+  asm volatile ("" :: "s" ("string"), "i" ("string"));
+  asm volatile ("" :: "s" (__FILE__), "i" (__FILE__));
+  asm volatile ("" :: "s" (__FUNCTION__), "i" (__FUNCTION__));
 }

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