This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 27528: Expanding constant asm operands
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Richard Sandiford <richard at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>
- Date: Mon, 11 Dec 2006 23:42:46 +0100
- Subject: Re: PR 27528: Expanding constant asm operands
- References: <874pt9vuax.fsf@talisman.home> <200612112317.59261.ebotcazou@libertysurf.fr> <87y7pe6pk9.fsf@firetop.home>
> 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__));
}