Fix thinko (PR tree-optimization/87201).
authorMartin Liska <mliska@suse.cz>
Mon, 3 Sep 2018 13:35:35 +0000 (15:35 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 3 Sep 2018 13:35:35 +0000 (13:35 +0000)
2018-09-03  Martin Liska  <mliska@suse.cz>

PR tree-optimization/87201
* tree-switch-conversion.c (switch_decision_tree::balance_case_nodes):
Fix parenthesis in an expression.

From-SVN: r264058

gcc/ChangeLog
gcc/tree-switch-conversion.c

index cd3c0e8178fc3ec1c2c754d27ccb5fdd9142c0d9..40795e7ad39d8061e79baf6dba25d9ba310d2d78 100644 (file)
@@ -1,3 +1,9 @@
+2018-09-03  Martin Liska  <mliska@suse.cz>
+
+       PR tree-optimization/87201
+       * tree-switch-conversion.c (switch_decision_tree::balance_case_nodes):
+       Fix parenthesis in an expression.
+
 2018-09-03  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87197
index d7d1c3972a063736652d46a1d033548d926df15d..1f543b2ecc8a55329402712a3413a9648125895b 100644 (file)
@@ -1942,8 +1942,8 @@ switch_decision_tree::balance_case_nodes (case_tree_node **head,
              /* Skip nodes while their probability does not reach
                 that amount.  */
              prob -= (*npp)->m_c->m_prob;
-             if (prob.initialized_p ()
-                 && (prob < pivot_prob || ! (*npp)->m_right))
+             if ((prob.initialized_p () && prob < pivot_prob)
+                 || ! (*npp)->m_right)
                break;
              npp = &(*npp)->m_right;
            }