This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Test cases for PR77937
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Oct 2016 14:53:07 -0500
- Subject: [PATCH] Test cases for PR77937
- Authentication-results: sourceware.org; auth=none
Here are torture test cases for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937. Markus Trippelsdorf
kindly provided the source for the tests and verified the correct
dejagnu options on x86_64-pc-linux-gnu. Committed.
Thanks,
Bill
2016-10-13 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/77937
* gcc.dg/torture/pr77937-1.c: New.
* gcc.dg/torture/pr77937-2.c: New.
Index: gcc/testsuite/gcc.dg/torture/pr77937-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr77937-1.c (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr77937-1.c (working copy)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */
+
+int *a;
+int b, c, d;
+void fn1(char *p1, int p2) {
+ int x;
+ while (1) {
+ x = 0;
+ for (; x < 8; x++)
+ p1[0] = -a[0] * d + p1[0] * c + 1 >> b >> 1;
+ p1 += p2;
+ }
+}
Index: gcc/testsuite/gcc.dg/torture/pr77937-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr77937-2.c (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr77937-2.c (working copy)
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */
+
+extern int fn2(int);
+extern int fn3(int);
+int a, b, c;
+void fn1(long p1) {
+ char *d;
+ for (;; d += p1) {
+ d[0] = fn2(1 >> a);
+ fn3(0);
+ fn3(c >> a);
+ d[1] = fn3(d[1] * b + c >> a);
+ d[4] = fn3(d[4] * b + c >> a);
+ d[5] = fn3(d[5] * b + c >> a);
+ }
+}