bt-load.c (migrate_btr_defs): Get the key of a heap entry before removing it, not...
authorSegher Boessenkool <segher@kernel.crashing.org>
Tue, 25 Nov 2014 17:52:21 +0000 (18:52 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Tue, 25 Nov 2014 17:52:21 +0000 (18:52 +0100)
* bt-load.c (migrate_btr_defs): Get the key of a heap entry
before removing it, not after.

From-SVN: r218056

gcc/ChangeLog
gcc/bt-load.c

index add2e7021e8ab64ef5ba124e57d469441058d398..cd9d808fb0dbdd2fa99a2e84de701c4a5b5ed758 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-25  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * bt-load.c (migrate_btr_defs): Get the key of a heap entry
+       before removing it, not after.
+
 2014-11-25  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/mn10300/mn10300.c (mn10300_insert_setlb_lcc): Remove
index 3002b62e8e139f45bb0ccca8404b43e62cb0d28b..53c4db31847bf1bb2e70b197eafd8bc188b002f7 100644 (file)
@@ -1434,8 +1434,8 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
 
   while (!all_btr_defs.empty ())
     {
-      btr_def def = all_btr_defs.extract_min ();
       int min_cost = -all_btr_defs.min_key ();
+      btr_def def = all_btr_defs.extract_min ();
       if (migrate_btr_def (def, min_cost))
        {
          all_btr_defs.insert (-def->cost, def);