[testsuite] : Add testcase for PR42295

Submitted by Uros Bizjak on Sept. 2, 2012, 7:11 a.m.

Details

Message ID CAFULd4YvW=25PnqqjAqJAmLetYuc_msSSrx27DUkR4kr+m2Mcw@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Sept. 2, 2012, 7:11 a.m.
Hello!

The testcase failed to compile with 4.5 with spill failure, but
compiles OK with 4.6+. Attached patch adds the test to gcc testsuite,
so the bug can be closed.

2012-09-02  Uros Bizjak  <ubizjak@gmail.com>

	PR target/42295
	* g++.dg/opt/pr42295.C: New test.

Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Uros.

Patch hide | download patch | download mbox

Index: g++.dg/opt/pr42295.C
===================================================================
--- g++.dg/opt/pr42295.C	(revision 0)
+++ g++.dg/opt/pr42295.C	(working copy)
@@ -0,0 +1,18 @@ 
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O1 -fschedule-insns -fselective-scheduling" }
+
+extern int f (...);
+
+int
+testsum (void *a, int k, int n)
+{
+  int i, j;
+
+  f (n / 2);
+  for (i = 0; i < n; i += 8)
+    for (j = 0; j < n; j += 8)
+      while (k < n)
+	k += 8;
+
+  return k;
+}