{
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var)
{
+ if (is_gimple_debug (USE_STMT (use_p)))
+ continue;
if (firstuse == NULL)
firstuse = USE_STMT (use_p);
else
/* Find the nearest common dominator of all of the immediate uses in IMM. */
static basic_block
-nearest_common_dominator_of_uses (gimple stmt)
+nearest_common_dominator_of_uses (gimple stmt, bool *debug_stmts)
{
bitmap blocks = BITMAP_ALLOC (NULL);
basic_block commondom;
useblock = gimple_phi_arg_edge (usestmt, idx)->src;
}
+ else if (is_gimple_debug (usestmt))
+ {
+ *debug_stmts = true;
+ continue;
+ }
else
{
useblock = gimple_bb (usestmt);
{
FOR_EACH_IMM_USE_FAST (one_use, imm_iter, def)
{
+ if (is_gimple_debug (USE_STMT (one_use)))
+ continue;
+
break;
}
if (one_use != NULL_USE_OPERAND_P)
that is where insertion would have to take place. */
if (!all_immediate_uses_same_place (stmt))
{
- basic_block commondom = nearest_common_dominator_of_uses (stmt);
+ bool debug_stmts = false;
+ basic_block commondom = nearest_common_dominator_of_uses (stmt,
+ &debug_stmts);
if (commondom == frombb)
return false;
fprintf (dump_file, "Common dominator of all uses is %d\n",
commondom->index);
}
+
*togsi = gsi_after_labels (commondom);
+
+ if (debug_stmts)
+ propagate_defs_into_debug_stmts (stmt, commondom, togsi);
+
return true;
}
return false;
*togsi = gsi_for_stmt (use);
+
+ propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
+
return true;
}
*togsi = gsi_after_labels (sinkbb);
+ propagate_defs_into_debug_stmts (stmt, sinkbb, togsi);
+
return true;
}