https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790

--- Comment #15 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I've looked at this for a while now. I agree that this is a bug in REE that
> needs to be fixed in a manner similar to this patch.

Thanks for looking into it.

> I think ideally we would figure out whether df_live really does have a
> mistake in it, and if so fix it rather than adding another problem.

Its description is very confusing, to say the least.  Quoting df-problems.c:

   LIVE AND MUST-INITIALIZED REGISTERS.

   This problem first computes the IN and OUT bitvectors for the
   must-initialized registers problems, which is a forward problem.
   It gives the set of registers for which we MUST have an available
   definition on any path from the entry block to the entry/exit of
   a basic block.

I think that's incorrect, the correct description would be "it gives the set of
registers for which we MUST have an available definition on at least one path
from the entry block".  That's why it doesn't work for the problem at hand,
which requires the "available definition on any path" thing.

But I'm not sure we can change it because, for example, init-regs uses it to
detect must-uninitialized registers:

/* Check all of the uses of pseudo variables.  If any use that is MUST
   uninitialized, add a store of 0 immediately before it.

              /* A use is MUST uninitialized if it reaches the top of
                 the block from the inside of the block (the lr test)
                 and no def for it reaches the top of the block from
                 outside of the block (the ur test).  */
              if (bitmap_bit_p (lr, regno)
                  && (!bitmap_bit_p (ur, regno)))

that is to say, uses that don't have any available definition.

Reply via email to