On 10/07/2016 09:20 AM, Richard Biener wrote:
Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c (revision 240829)
+++ gcc/sched-deps.c (working copy)
@@ -3992,8 +3992,14 @@ remove_from_deps (struct deps_desc *deps
removed = remove_from_dependence_list (insn,
&deps->last_pending_memory_flush);
deps->pending_flush_length -= removed;
+ unsigned to_clear = -1U;
EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i, rsi)
{
+ if (to_clear != -1U)
+ {
+ CLEAR_REGNO_REG_SET (&deps->reg_last_in_use, to_clear);
+ to_clear = -1U;
+ }
struct deps_reg *reg_last = &deps->reg_last[i];
if (reg_last->uses)
remove_from_dependence_list (insn, ®_last->uses);
@@ -4005,8 +4011,10 @@ remove_from_deps (struct deps_desc *deps
remove_from_dependence_list (insn, ®_last->clobbers);
if (!reg_last->uses && !reg_last->sets && !reg_last->implicit_sets
&& !reg_last->clobbers)
- CLEAR_REGNO_REG_SET (&deps->reg_last_in_use, i);
+ to_clear = i;
}
+ if (to_clear != -1U)
+ CLEAR_REGNO_REG_SET (&deps->reg_last_in_use, to_clear);
That looks pretty bad. What's the issue, we can't clear the current bit
while iterating over a bitmap? Is that fixable - it seems like something
people are likely to want to do?
Here, if necessary I'd prefer we create a to_clear bitmap and perform an
and_compl operation after the loop.
Bernd