PATCH: PR rtl-optimization/47502: Never combine asm statement

H.J. Lu hjl.tools@gmail.com
Sat Mar 19 15:29:00 GMT 2011


On Fri, Mar 18, 2011 at 3:39 PM, Richard Henderson <rth@redhat.com> wrote:
> On 03/18/2011 02:51 PM, H.J. Lu wrote:
>> See analysis in:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47502
>
> You're patching the wrong place.  See can_combine_p,
> which can test for specific sources, rather than
> cant_combine_insn_p which has no access to sources.
>

I can no longer trigger the failure. But I'd like to add those
2 testcases.  OK for trunk?

Thanks.


-- 
H.J.
---
2011-03-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR rtl-optimization/47502
	* gcc.target/i386/pr47502-1.c: New.
	* gcc.target/i386/pr47502-2.c: Likewise.

diff --git a/gcc/testsuite/gcc.target/i386/pr47502-1.c
b/gcc/testsuite/gcc.target/i386/pr47502-1.c
new file mode 100644
index 0000000..727afe9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47502-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void
+foo (const void *xxxxx, void *yyyyy, long y)
+{
+  asm volatile ("" :: "c" ((xxxxx)), "d" ((yyyyy)), "S" (y));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47502-2.c
b/gcc/testsuite/gcc.target/i386/pr47502-2.c
new file mode 100644
index 0000000..1f57ea0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47502-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (int how, const void *set, void *oset)
+{
+  int resultvar;
+  asm volatile (""
+                : "=a" (resultvar)
+                : "0" (14) , "b" (how), "c" ((set)), "d" ((oset)),
"S" (65 / 8) : "memory", "cc");
+  return resultvar;
+}



More information about the Gcc-patches mailing list