diff mbox

Testcase for PR61801

Message ID alpine.LSU.2.11.1407280949580.3531@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener July 28, 2014, 7:50 a.m. UTC
Tested on x86_64-unknown-linux-gnu, applied to trunk and branches.

Richard.

2014-07-28  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/61801
	* gcc.target/i386/pr61801.c: New testcase.

Comments

Jakub Jelinek July 28, 2014, 8:44 a.m. UTC | #1
On Mon, Jul 28, 2014 at 09:50:24AM +0200, Richard Biener wrote:
> --- gcc/testsuite/gcc.target/i386/pr61801.c	(revision 0)
> +++ gcc/testsuite/gcc.target/i386/pr61801.c	(working copy)
> @@ -0,0 +1,22 @@
> +/* { dg-do compile } */
> +/* { dg-options "-Os -fcompare-debug" } */
> +
> +int a, b, c;
> +void fn1 ()
> +{
> +  int d;
> +  if (fn2 () && !0)
> +    {
> +      b = (
> +	   {
> +	   int e;
> +	   fn3 ();
> +	   switch (0)
> +	   default:
> +	   asm volatile("" : "=a"(e) : "0"(a), ""(0));

How do we reload ""(0)?  I'm surprised that we accept it...

	Jakub
Jakub Jelinek July 28, 2014, 8:53 a.m. UTC | #2
On Mon, Jul 28, 2014 at 10:44:15AM +0200, Jakub Jelinek wrote:
> On Mon, Jul 28, 2014 at 09:50:24AM +0200, Richard Biener wrote:
> > --- gcc/testsuite/gcc.target/i386/pr61801.c	(revision 0)
> > +++ gcc/testsuite/gcc.target/i386/pr61801.c	(working copy)
> > @@ -0,0 +1,22 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-Os -fcompare-debug" } */
> > +
> > +int a, b, c;
> > +void fn1 ()
> > +{
> > +  int d;
> > +  if (fn2 () && !0)
> > +    {
> > +      b = (
> > +	   {
> > +	   int e;
> > +	   fn3 ();
> > +	   switch (0)
> > +	   default:
> > +	   asm volatile("" : "=a"(e) : "0"(a), ""(0));
> 
> How do we reload ""(0)?  I'm surprised that we accept it...

Seems we fail with -fcompare-debug before the fix even with
"i"(0), so my strong preference would be to use that.

	Jakub
Markus Trippelsdorf July 28, 2014, 8:58 a.m. UTC | #3
On 2014.07.28 at 10:53 +0200, Jakub Jelinek wrote:
> On Mon, Jul 28, 2014 at 10:44:15AM +0200, Jakub Jelinek wrote:
> > On Mon, Jul 28, 2014 at 09:50:24AM +0200, Richard Biener wrote:
> > > --- gcc/testsuite/gcc.target/i386/pr61801.c	(revision 0)
> > > +++ gcc/testsuite/gcc.target/i386/pr61801.c	(working copy)
> > > @@ -0,0 +1,22 @@
> > > +/* { dg-do compile } */
> > > +/* { dg-options "-Os -fcompare-debug" } */
> > > +
> > > +int a, b, c;
> > > +void fn1 ()
> > > +{
> > > +  int d;
> > > +  if (fn2 () && !0)
> > > +    {
> > > +      b = (
> > > +	   {
> > > +	   int e;
> > > +	   fn3 ();
> > > +	   switch (0)
> > > +	   default:
> > > +	   asm volatile("" : "=a"(e) : "0"(a), ""(0));
> > 
> > How do we reload ""(0)?  I'm surprised that we accept it...
> 
> Seems we fail with -fcompare-debug before the fix even with
> "i"(0), so my strong preference would be to use that.

Yes. It was just Creduce going wild. Feel free to fix.
diff mbox

Patch

Index: gcc/testsuite/gcc.target/i386/pr61801.c
===================================================================
--- gcc/testsuite/gcc.target/i386/pr61801.c	(revision 0)
+++ gcc/testsuite/gcc.target/i386/pr61801.c	(working copy)
@@ -0,0 +1,22 @@ 
+/* { dg-do compile } */
+/* { dg-options "-Os -fcompare-debug" } */
+
+int a, b, c;
+void fn1 ()
+{
+  int d;
+  if (fn2 () && !0)
+    {
+      b = (
+	   {
+	   int e;
+	   fn3 ();
+	   switch (0)
+	   default:
+	   asm volatile("" : "=a"(e) : "0"(a), ""(0));
+	   e;
+	   });
+      d = b;
+    }
+  c = d;
+}