[PING] [PATCH] Fix ICE with x87 asm operands (PR inline-asm/68843)

Jakub Jelinek jakub@redhat.com
Fri Jun 10 18:42:00 GMT 2016


On Thu, Jun 09, 2016 at 03:10:44PM -0600, Jeff Law wrote:
> On 05/29/2016 08:37 AM, Bernd Edlinger wrote:
> 
> >
> >
> >gcc:
> >2016-05-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> >
> >	PR inline-asm/68843
> >	* reg-stack.c (check_asm_stack_operands): Explicit input arguments
> >	must be grouped on top of stack.  Don't force early clobber
> >	on ordinary reg outputs.
> >
> >testsuite:
> >2016-05-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> >
> >	PR inline-asm/68843
> >	* gcc.target/i386/pr68843-1.c: New test.
> >	* gcc.target/i386/pr68843-2.c: New test.
> OK for the trunk.

The second testcase FAILs on both x86_64 and i686, because it contains
no dg-options, therefore is compiled with -ansi -pedantic and that doesn't
allow GNU inline asm syntax.  While looking at the testcase, I believe you
meant to make it executable, otherwise I don't understand why it has been
added in this form, and while at it, I've also fixed it for -masm=intel.

Tested on x86_64-linux and i686-linux, committed to trunk.

2016-06-10  Jakub Jelinek  <jakub@redhat.com>

	PR inline-asm/68843
	* gcc.target/i386/pr68843-2.c: Add dg-do run and empty dg-options.
	(test): Add -masm=intel alternatives.

--- gcc/testsuite/gcc.target/i386/pr68843-2.c.jj	2016-06-10 20:23:58.000000000 +0200
+++ gcc/testsuite/gcc.target/i386/pr68843-2.c	2016-06-10 20:38:01.336171681 +0200
@@ -1,10 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+
 int
 __attribute__((noinline, noclone))
 test (double y)
 {
   int a, b;
-  asm ("fistpl (%1)\n\t"
-       "movl (%1), %0"
+  asm ("fistp{l (%1)| DWORD PTR [%1]}\n\t"
+       "mov{l (%1), %0| %0, DWORD PTR [%1]}"
        : "=r" (a)
        : "r" (&b), "t" (y)
        : "st");


	Jakub



More information about the Gcc-patches mailing list