tree-ssa-loop-im: simplify casts in comparators
authorAlexander Monakov <amonakov@ispras.ru>
Fri, 2 Aug 2019 13:44:58 +0000 (16:44 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Fri, 2 Aug 2019 13:44:58 +0000 (16:44 +0300)
* tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): Simplify casts
from 'const void *'.
(sort_locs_in_loop_postorder_cmp): Likewise.

From-SVN: r274011

gcc/ChangeLog
gcc/tree-ssa-loop-im.c

index 87877a2580711f88e297d3e83a286a9beed57286..6c1372efde19644a5edc934c1e1af6a8741da844 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-02  Alexander Monakov  <amonakov@ispras.ru>
+
+       * tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): Simplify casts
+       from 'const void *'.
+       (sort_locs_in_loop_postorder_cmp): Likewise.
+
 2019-08-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * doc/invoke.texi (hot-bb-count-fraction): Rework description.
index e194a41a08e04a8c501e7d5dbae7455bd76556e6..c247d7433061e8395e50c0e481d609d530b98615 100644 (file)
@@ -1583,8 +1583,8 @@ sort_bbs_in_loop_postorder_cmp (const void *bb1_, const void *bb2_,
                                void *bb_loop_postorder_)
 {
   unsigned *bb_loop_postorder = (unsigned *)bb_loop_postorder_;
-  basic_block bb1 = *(basic_block *)const_cast<void *>(bb1_);
-  basic_block bb2 = *(basic_block *)const_cast<void *>(bb2_);
+  basic_block bb1 = *(const basic_block *)bb1_;
+  basic_block bb2 = *(const basic_block *)bb2_;
   class loop *loop1 = bb1->loop_father;
   class loop *loop2 = bb2->loop_father;
   if (loop1->num == loop2->num)
@@ -1599,8 +1599,8 @@ sort_locs_in_loop_postorder_cmp (const void *loc1_, const void *loc2_,
                                 void *bb_loop_postorder_)
 {
   unsigned *bb_loop_postorder = (unsigned *)bb_loop_postorder_;
-  mem_ref_loc *loc1 = (mem_ref_loc *)const_cast<void *>(loc1_);
-  mem_ref_loc *loc2 = (mem_ref_loc *)const_cast<void *>(loc2_);
+  const mem_ref_loc *loc1 = (const mem_ref_loc *)loc1_;
+  const mem_ref_loc *loc2 = (const mem_ref_loc *)loc2_;
   class loop *loop1 = gimple_bb (loc1->stmt)->loop_father;
   class loop *loop2 = gimple_bb (loc2->stmt)->loop_father;
   if (loop1->num == loop2->num)