From: Alexander Monakov Date: Fri, 2 Aug 2019 13:44:58 +0000 (+0300) Subject: tree-ssa-loop-im: simplify casts in comparators X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06b4c6d2732c76d8660af53d52c0092505e87ea7;p=gcc.git tree-ssa-loop-im: simplify casts in comparators * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87877a25807..6c1372efde1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-08-02 Alexander Monakov + + * 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 * doc/invoke.texi (hot-bb-count-fraction): Rework description. diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index e194a41a08e..c247d743306 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -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(bb1_); - basic_block bb2 = *(basic_block *)const_cast(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(loc1_); - mem_ref_loc *loc2 = (mem_ref_loc *)const_cast(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)