On 16 August 2011 16:24, Richard Sandiford <richard.sandif...@linaro.org> wrote:
> Ramana Radhakrishnan <ramana.radhakrish...@linaro.org> writes:
>> I can't see how it is right to construct essentially 2 chains for the
>> same register that have overlapping live ranges without an intervening
>> conditional branch and since regrename sort of works inside a bb .
>> Ideally the chain for 122 should have been terminated at the end of
>> 123 rather than allowing this to remain open and have the use in insn
>> 141 available for use in both chains starting at 122 and 140 . What
>> I'm not sure is which part of regrename makes sure that this part of
>> the comment for Stage 5 is ensured.
>>
>>             `and earlier
>>            chains they would overlap with must have been closed at
>>            the previous insn at the latest, as such operands cannot
>>            possibly overlap with any input operands.  */'
>
> Just to summarise on-list what we talked about on IRC: this is supposed
> to happen through REG_DEAD notes.  The bug in this case appears to be
> that the required note is missing.
>
> The patch below seems to fix things.  If it's right, I'm very surprised
> we hadn't noticed until now.  There must be something else going on...


I've been digging a bit yesterday afternoon and reading the code it appears
as though if you are to check for multiword-register uses you do need
to check the macro DF_MWS_REG_USE_P (mws). I suspect if you don't look
at that you really aren't looking at what multiword-registers an
instruction really uses.

Interestingly your patch managed to survive a bootstrap and testrun on
x86 with no regressions.

Ramana



>
> Richard
>
>
> Index: gcc/df-problems.c
> ===================================================================
> --- gcc/df-problems.c   2011-07-11 12:21:33.000000000 +0100
> +++ gcc/df-problems.c   2011-08-16 16:18:52.333237669 +0100
> @@ -3376,7 +3376,7 @@ df_note_bb_compute (unsigned int bb_inde
>       while (*mws_rec)
>        {
>          struct df_mw_hardreg *mws = *mws_rec;
> -         if ((DF_MWS_REG_DEF_P (mws))
> +         if ((DF_MWS_REG_USE_P (mws))
>              && !df_ignore_stack_reg (mws->start_regno))
>            {
>              bool really_add_notes = debug_insn != 0;
>

Reply via email to