gimple-ssa-store-merging.c: fix sort_by_bitpos
authorAlexander Monakov <amonakov@gcc.gnu.org>
Thu, 20 Jul 2017 15:13:56 +0000 (18:13 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Thu, 20 Jul 2017 15:13:56 +0000 (18:13 +0300)
* gimple-ssa-store-merging.c (sort_by_bitpos): Return 0 on equal bitpos.

From-SVN: r250394

gcc/ChangeLog
gcc/gimple-ssa-store-merging.c

index d489138e2c20c6788f08c78c4bf69292387554c8..9eb61fe62dee45914fd885fd685b39a869e7f238 100644 (file)
@@ -1,4 +1,8 @@
-2017-07-18  Jan Hubicka  <hubicka@ucw.cz>
+2017-07-20  Alexander Monakov  <amonakov@ispras.ru>
+
+       * gimple-ssa-store-merging.c (sort_by_bitpos): Return 0 on equal bitpos.
+
+2017-07-20  Jan Hubicka  <hubicka@ucw.cz>
 
        * bb-reorder.c (connect_traces): Allow copying of blocks within
        single partition.
index 5e9227314b8641dd524f025d104f4aae12415cc7..ea7dc846c4370aadb1a7f4c1b466c21257631bf8 100644 (file)
@@ -516,12 +516,12 @@ sort_by_bitpos (const void *x, const void *y)
   store_immediate_info *const *tmp = (store_immediate_info * const *) x;
   store_immediate_info *const *tmp2 = (store_immediate_info * const *) y;
 
-  if ((*tmp)->bitpos <= (*tmp2)->bitpos)
+  if ((*tmp)->bitpos < (*tmp2)->bitpos)
     return -1;
   else if ((*tmp)->bitpos > (*tmp2)->bitpos)
     return 1;
-
-  gcc_unreachable ();
+  else
+    return 0;
 }
 
 /* Sorting function for store_immediate_info objects.