{
typedef auto_vec<std::pair<gphi *, tree>> mapping_vec;
- condition_info (gcond *cond): m_cond (cond), m_bb (gimple_bb (cond)),
- m_forwarder_bb (NULL), m_ranges (), m_true_edge (NULL), m_false_edge (NULL),
- m_true_edge_phi_mapping (), m_false_edge_phi_mapping ()
+ condition_info (gcond *cond, bool has_side_effect): m_cond (cond),
+ m_bb (gimple_bb (cond)), m_forwarder_bb (NULL), m_ranges (),
+ m_true_edge (NULL), m_false_edge (NULL),
+ m_true_edge_phi_mapping (), m_false_edge_phi_mapping (),
+ m_has_side_effect (has_side_effect)
{
m_ranges.create (0);
}
edge m_false_edge;
mapping_vec m_true_edge_phi_mapping;
mapping_vec m_false_edge_phi_mapping;
+ bool m_has_side_effect;
};
/* Recond PHI mapping for an original edge E and save these into vector VEC. */
if (cond == NULL)
return;
- /* An empty conditions_in_bbs indicates we are processing the first
- basic-block then no need check side effect. */
- if (!conditions_in_bbs->is_empty () && !no_side_effect_bb (bb))
- return;
-
tree lhs = gimple_cond_lhs (cond);
tree rhs = gimple_cond_rhs (cond);
tree_code code = gimple_cond_code (cond);
- condition_info *info = new condition_info (cond);
+ condition_info *info = new condition_info (cond, !no_side_effect_bb (bb));
gassign *def;
if (code == NE_EXPR
if ((*info2)->m_false_edge != e)
break;
+ /* Only the first BB in a chain can have a side effect. */
+ if (info->m_has_side_effect)
+ break;
+
chain->m_entries.safe_push (*info2);
bitmap_set_bit (seen_bbs, e->src->index);
info = *info2;
--- /dev/null
+/* PR tree-optimization/106126 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+char *var_1;
+void pool_conda_matchspec() {
+ for (; var_1 && *var_1 &&
+ *var_1 != '<' && *var_1 != '>' &&
+ *var_1 != '!' && *var_1 != '~';)
+ if (*var_1 >= 'A' && *var_1 <= 'Z')
+ *var_1 += 'A';
+}