aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2017-06-29 12:53:47 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2017-06-29 05:53:47 -0700
commit3c7bb4891238d341dcd1404cf45b041fc1af0720 (patch)
tree4c05a28bbed30d7fc6ad995b4b03291145d0ead6
parent4e3e8a5f8175d06b2de55a6f45491fc484901370 (diff)
downloadgcc-3c7bb4891238d341dcd1404cf45b041fc1af0720.zip
gcc-3c7bb4891238d341dcd1404cf45b041fc1af0720.tar.gz
gcc-3c7bb4891238d341dcd1404cf45b041fc1af0720.tar.bz2
Add a testcase for PR ipa/80565
The testcase in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80565 is passing now. Check in the testcase and resolve it as fixed. PR ipa/80565 * gcc.dg/torture/pr80565.c: New file. From-SVN: r249782
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr80565.c41
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c38422a..ad77af2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ipa/80565
+ * gcc.dg/torture/pr80565.c: New file.
+
2017-06-29 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/81196
diff --git a/gcc/testsuite/gcc.dg/torture/pr80565.c b/gcc/testsuite/gcc.dg/torture/pr80565.c
new file mode 100644
index 0000000..6662065
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr80565.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+
+int a, b, c, e, h, j;
+char d;
+short f, g;
+static short fn2(int p1) {
+ for (;;)
+ for (; g; g++)
+ if (p1)
+ break;
+}
+
+static short fn3(void);
+static char fn4(char p1) {
+ int i;
+ for (; d;)
+ f = 8;
+ for (; f; f = 0)
+ for (; i; i++) {
+ j = 0;
+ for (; j; j++)
+ ;
+ }
+}
+
+static short fn1(short p1) { fn2(b || fn3()); }
+
+short fn3(void) {
+ if (c) {
+ fn4(e);
+ h = 0;
+ for (;; h++)
+ ;
+ }
+}
+
+int main() {
+ for (; a;)
+ fn1(c);
+ return 0;
+}