Patch by Alexander Monakov <amonakov@ispras.ru>
authorJan Hubicka <hubicka@ucw.cz>
Sat, 1 Jul 2017 07:47:22 +0000 (09:47 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 1 Jul 2017 07:47:22 +0000 (07:47 +0000)
Patch by Alexander Monakov <amonakov@ispras.ru>
* sel-sched-ir.c (compute_succs_info): Handle uninitialized
probabilities consistently.

From-SVN: r249864

gcc/ChangeLog
gcc/sel-sched-ir.c

index 525c2c4b93fcf162658e454e90d44d1eb44cf726..ce144a01b6160ab39ce3ae6b334a6132f40e865e 100644 (file)
@@ -1,5 +1,6 @@
 2017-06-29  Jan Hubicka  <hubicka@ucw.cz>
 
+       Patch by Alexander Monakov <amonakov@ispras.ru>
        * sel-sched-ir.c (compute_succs_info): Handle uninitialized
        probabilities consistently.
 
index e78d30999a8b3015dd0068e29e08b493d4a3abcf..fa88259733bb5867d156ce2f5de49b4042beeb8e 100644 (file)
@@ -4747,9 +4747,11 @@ compute_succs_info (insn_t insn, short flags)
           sinfo->probs_ok.safe_push (
                    /* FIXME: Improve calculation when skipping
                        inner loop to exits.  */
-                    si.bb_end && si.e1->probability.initialized_p ()
-                   ? si.e1->probability.to_reg_br_prob_base ()
-                   : 0);
+                    si.bb_end
+                   ? (si.e1->probability.initialized_p ()
+                       ? si.e1->probability.to_reg_br_prob_base ()
+                       : 0)
+                   : REG_BR_PROB_BASE);
           sinfo->succs_ok_n++;
         }
       else