aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-11-26 12:52:11 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-11-26 12:52:11 +0100
commit9d465067af7432a99b7d20a80a44e4e791863ba3 (patch)
tree84b8bf2a4a198a3c2626ae1421c21129ba7dd27d /gcc
parentd0470103a9e3432d0ed1a726369b8311631dcfe1 (diff)
downloadgcc-9d465067af7432a99b7d20a80a44e4e791863ba3.zip
gcc-9d465067af7432a99b7d20a80a44e4e791863ba3.tar.gz
gcc-9d465067af7432a99b7d20a80a44e4e791863ba3.tar.bz2
re PR rtl-optimization/68249 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
PR rtl-optimization/68249 PR rtl-optimization/68321 * gcc.c-torture/execute/pr68249.c: New test. * gcc.c-torture/execute/pr68321.c: New test. From-SVN: r230939
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68249.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68321.c38
3 files changed, 81 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6f6cc20..612fd97 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68249
+ PR rtl-optimization/68321
+ * gcc.c-torture/execute/pr68249.c: New test.
+ * gcc.c-torture/execute/pr68321.c: New test.
+
2015-11-26 Ilya Enkovich <enkovich.gnu@gmail.com>
PR target/68416
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68249.c b/gcc/testsuite/gcc.c-torture/execute/pr68249.c
new file mode 100644
index 0000000..9ef4802
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68249.c
@@ -0,0 +1,36 @@
+/* PR rtl-optimization/68249 */
+
+int a, b, c, g, k, l, m, n;
+char h;
+
+void
+fn1 ()
+{
+ for (; k; k++)
+ {
+ m = b || c < 0 || c > 1 ? : c;
+ g = l = n || m < 0 || (m > 1) > 1 >> m ? : 1 << m;
+ }
+ l = b + 1;
+ for (; b < 1; b++)
+ h = a + 1;
+}
+
+int
+main ()
+{
+ char j;
+ for (; a < 1; a++)
+ {
+ fn1 ();
+ if (h)
+ j = h;
+ if (j > c)
+ g = 0;
+ }
+
+ if (h != 1)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68321.c b/gcc/testsuite/gcc.c-torture/execute/pr68321.c
new file mode 100644
index 0000000..d255103
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68321.c
@@ -0,0 +1,38 @@
+/* PR rtl-optimization/68321 */
+
+int e = 1, u = 5, t2, t5, i, k;
+int a[1], b, m;
+char n, t;
+
+int
+fn1 (int p1)
+{
+ int g[1];
+ for (;;)
+ {
+ if (p1 / 3)
+ for (; t5;)
+ u || n;
+ t2 = p1 & 4;
+ if (b + 1)
+ return 0;
+ u = g[0];
+ }
+}
+
+int
+main ()
+{
+ for (; e >= 0; e--)
+ {
+ char c;
+ if (!m)
+ c = t;
+ fn1 (c);
+ }
+
+ if (a[t2] != 0)
+ __builtin_abort ();
+
+ return 0;
+}