This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Add testcase for PR tree-optimization/71854
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Jan 2017 16:52:11 +0100
- Subject: [committed] Add testcase for PR tree-optimization/71854
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This PR has been fixed in r244218 aka the PR78997 fix.
I've tested the testcase on x86_64-linux with -m32/-m64 (without/with
the PR78997 fix) and committed to trunk as obvious.
2017-01-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71854
* gcc.dg/vect/pr71854.c: New test.
--- gcc/testsuite/gcc.dg/vect/pr71854.c.jj 2017-01-17 16:46:29.366816678 +0100
+++ gcc/testsuite/gcc.dg/vect/pr71854.c 2017-01-17 16:47:16.442209553 +0100
@@ -0,0 +1,25 @@
+/* PR tree-optimization/71854 */
+/* { dg-do compile } */
+/* { dg-additional-options "-O3 -ftree-loop-if-convert" } */
+
+char a, f = 1;
+int b, c, e[8];
+short d;
+
+short
+foo (short x)
+{
+ return x >= 2 || x >> c ? x : x << c;
+}
+
+int
+main ()
+{
+ while (f)
+ for (d = 0; d <= 7; d++)
+ {
+ f = 7 >> b ? a : a << b;
+ e[d] = foo (f);
+ }
+ return 0;
+}
Jakub