]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/70725 (Internal compiler error (ICE) on valid code)
authorMarek Polacek <polacek@redhat.com>
Wed, 20 Apr 2016 09:32:45 +0000 (09:32 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 20 Apr 2016 09:32:45 +0000 (09:32 +0000)
PR tree-optimization/70725
* tree-if-conv.c (is_false_predicate): New function.
(predicate_mem_writes): Use it.

* gcc.dg/pr70725.c: New test.

From-SVN: r235250

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr70725.c [new file with mode: 0644]
gcc/tree-if-conv.c

index 6e92dde027e973c77f83efc43cb94f77bc42f3b5..576560a817ae9193b4677b03fb1bc3c24f861b3f 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-20  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/70725
+       * tree-if-conv.c (is_false_predicate): New function.
+       (predicate_mem_writes): Use it.
+
 2016-04-20  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/70726
index db98dd3f9d51117d68f769abc7976d0b72ee2f46..b73790e183230295d58fdfb9368696877eb03719 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-20  Marek Polacek  <polacek@redhat.com>
+
+       PR tree-optimization/70725
+       * gcc.dg/pr70725.c: New test.
+
 2016-04-20  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/70726
diff --git a/gcc/testsuite/gcc.dg/pr70725.c b/gcc/testsuite/gcc.dg/pr70725.c
new file mode 100644 (file)
index 0000000..fc7b674
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR tree-optimization/70725 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-march=skylake-avx512" { target { i?86-*-* x86_64-*-* } } } */
+
+extern short a;
+extern int b, d;
+extern int c[100];
+extern int e;
+extern int f;
+
+void
+fn1 ()
+{
+  for (; e < 2; e = e + 1)
+    d = a;
+  for (;;)
+    for (int g = 0; g < 5; g = g + 1)
+      for (int h = 0; h < 2; h = h + 1)
+       for (int i = 0; i < 3; i = i + 1)
+         c[f + i] = a && b;
+}
index 9e305c7ccaecd63d23a06923bcc4069d6a56aec8..a9fbab94a19319c7bc0c6156f5d79ec3c3fefaa4 100644 (file)
@@ -262,6 +262,16 @@ ifc_temp_var (tree type, tree expr, gimple_stmt_iterator *gsi)
   return new_name;
 }
 
+/* Return true when COND is a false predicate.  */
+
+static inline bool
+is_false_predicate (tree cond)
+{
+  return (cond == NULL_TREE
+         || cond == boolean_false_node
+         || integer_zerop (cond));
+}
+
 /* Return true when COND is a true predicate.  */
 
 static inline bool
@@ -1988,7 +1998,7 @@ predicate_mem_writes (loop_p loop)
       gimple *stmt;
       int index;
 
-      if (is_true_predicate (cond))
+      if (is_true_predicate (cond) || is_false_predicate (cond))
        continue;
 
       swap = false;
This page took 0.101257 seconds and 5 git commands to generate.