Patchwork Fix up guality/sra-1.c (PR middle-end/45663)

login
register
mail settings
Submitter Jakub Jelinek
Date Sept. 15, 2010, 1:15 p.m.
Message ID <20100915131515.GL1269@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/64813/
State New
Headers show

Comments

Jakub Jelinek - Sept. 15, 2010, 1:15 p.m.
Hi!

On some targets scheduling moves away the first insn belonging to
the line with first bar call ahead of the a.j++ insns (and a$j DEBUG_INSN).
By testing the values on the second bar call line the chances are higher
that it will be after that.

Regtested on x86_64-linux and i686-linux, ok for trunk?

2010-09-15  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/45663
	* gcc.dg/guality/sra-1.c: Move all gdb-test lines to the second bar invocation
	instead of first.


	Jakub

Patch

--- gcc/testsuite/gcc.dg/guality/sra-1.c.jj	2010-06-11 11:00:35.000000000 +0200
+++ gcc/testsuite/gcc.dg/guality/sra-1.c	2010-09-14 13:12:28.820377723 +0200
@@ -17,8 +17,8 @@  f1 (int k)
   struct A a = { 4, k + 6 };
   asm ("" : "+r" (a.i));
   a.j++;
-  bar (a.i);		/* { dg-final { gdb-test 20 "a.i" "4" } } */
-  bar (a.j);		/* { dg-final { gdb-test 20 "a.j" "14" } } */
+  bar (a.i);		/* { dg-final { gdb-test 21 "a.i" "4" } } */
+  bar (a.j);		/* { dg-final { gdb-test 21 "a.j" "14" } } */
   return a.i + a.j;
 }
 
@@ -28,8 +28,8 @@  f2 (int k)
   int a[2] = { 4, k + 6 };
   asm ("" : "+r" (a[0]));
   a[1]++;
-  bar (a[0]);		/* { dg-final { gdb-test 31 "a\[0\]" "4" } } */
-  bar (a[1]);		/* { dg-final { gdb-test 31 "a\[1\]" "14" } } */
+  bar (a[0]);		/* { dg-final { gdb-test 32 "a\[0\]" "4" } } */
+  bar (a[1]);		/* { dg-final { gdb-test 32 "a\[1\]" "14" } } */
   return a[0] + a[1];
 }
 
@@ -39,8 +39,8 @@  f3 (int k)
   struct B a = { 4, k + 6 };
   asm ("" : "+r" (a.i));
   a.j++;
-  bar (a.i);		/* { dg-final { gdb-test 42 "a.i" "4" } } */
-  bar (a.j);		/* { dg-final { gdb-test 42 "a.j" "14" } } */
+  bar (a.i);		/* { dg-final { gdb-test 43 "a.i" "4" } } */
+  bar (a.j);		/* { dg-final { gdb-test 43 "a.j" "14" } } */
   return a.i + a.j;
 }