re PR tree-optimization/64494 (ICE at -Os and above on x86_64-linux-gnu in duplicate_...
authorJakub Jelinek <jakub@redhat.com>
Mon, 5 Jan 2015 18:53:44 +0000 (19:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 5 Jan 2015 18:53:44 +0000 (19:53 +0100)
PR tree-optimization/64494
* tree-ssa-loop-im.c (move_computations_dom_walker::before_dom): Also
clear SSA_NAME_ANTI_RANGE_P flag.

* gcc.c-torture/compile/pr64494.c: New test.

From-SVN: r219194

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr64494.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c

index e418275b9921a990ebf9789e269f12ad442b1987..2ba1d2bdcf6c71b1d5175d8d13f11d9c25bd79e8 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/64494
+       * tree-ssa-loop-im.c (move_computations_dom_walker::before_dom): Also
+       clear SSA_NAME_ANTI_RANGE_P flag.
+
 2015-01-05  Marek Polacek  <polacek@redhat.com>
 
        * doc/extend.texi (Arrays of Length Zero): Add missing comma.
index ee90726c331880dae60be478ea58e7db40535fe0..90c25a5c2859c90cf2f488a4ae4c20cdf4c1ff41 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/64494
+       * gcc.c-torture/compile/pr64494.c: New test.
+
 2015-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/47674
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr64494.c b/gcc/testsuite/gcc.c-torture/compile/pr64494.c
new file mode 100644 (file)
index 0000000..f6718d3
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR tree-optimization/64494 */
+
+int a, b;
+unsigned char c;
+
+int
+main ()
+{
+  int d;
+  a = 0;
+  for (d = 0; d < 2; d++)
+    {
+      a &= (b >= 1);
+      c = (204 > (((unsigned char) ~0) >> a)) ? 0 : 204 << a;
+      b = 0;
+    }
+  return 0;
+}
index a442146bece15f365704936554cbb9aa2b4a4171..6319eff7a7c6ae47e58174e1e00742902541da9d 100644 (file)
@@ -1236,7 +1236,11 @@ move_computations_dom_walker::before_dom_children (basic_block bb)
          && (!ALWAYS_EXECUTED_IN (bb)
              || (ALWAYS_EXECUTED_IN (bb) != level
                  && !flow_loop_nested_p (ALWAYS_EXECUTED_IN (bb), level))))
-       SSA_NAME_RANGE_INFO (gimple_assign_lhs (new_stmt)) = NULL;
+       {
+         tree lhs = gimple_assign_lhs (new_stmt);
+         SSA_NAME_RANGE_INFO (lhs) = NULL;
+         SSA_NAME_ANTI_RANGE_P (lhs) = 0;
+       }
       gsi_insert_on_edge (loop_preheader_edge (level), new_stmt);
       remove_phi_node (&bsi, false);
     }
@@ -1302,7 +1306,11 @@ move_computations_dom_walker::before_dom_children (basic_block bb)
          && (!ALWAYS_EXECUTED_IN (bb)
              || !(ALWAYS_EXECUTED_IN (bb) == level
                   || flow_loop_nested_p (ALWAYS_EXECUTED_IN (bb), level))))
-       SSA_NAME_RANGE_INFO (gimple_get_lhs (stmt)) = NULL;
+       {
+         tree lhs = gimple_get_lhs (stmt);
+         SSA_NAME_RANGE_INFO (lhs) = NULL;
+         SSA_NAME_ANTI_RANGE_P (lhs) = 0;
+       }
       /* In case this is a stmt that is not unconditionally executed
          when the target loop header is executed and the stmt may
         invoke undefined integer or pointer overflow rewrite it to