[PATCH] Avoid extending reg lifetime when cprop_hardreg propagates into DEBUG_INSNs (PR debug/43161)

Richard Guenther richard.guenther@gmail.com
Wed Feb 24 21:58:00 GMT 2010


On Wed, Feb 24, 2010 at 9:53 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Feb 24, 2010 at 09:18:35PM +0100, Richard Guenther wrote:
>> So is the problem that the df note problem drops _all_ DEBUG_INSNs
>> referencing the hardreg on the floor?  It sounds like you are solving
>> that issue locally in cprop hardreg by avoiding to trigger that logic instead
>> of a more general solution in the df note problem?
>
> The notes problem doesn't track ranges when two hard registers are
> equivalent, unlike the cprop_hardreg pass.
>
> The spot in df-problems.c (df_note_bb_compute) is:
>      if (debug_insn == -1)
>        {
>          /* ??? We could probably do better here, replacing dead
>             registers with their definitions.  */
>          INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC ();
>          df_insn_rescan_debug_internal (insn);
>        }
> Extending lifetime of a hardreg just because of a DEBUG_INSN use wouldn't be just
> a sure way to generate -fcompare-debug differences, but could also actually
> pessimize generated code.  Even if df_note_bb_compute does something
> expensive here to find some equivalent expression still live at that spot,
> it would basically undo what cprop_hardreg pass did in that case, isn't it
> better to not do those changes in the first place?

Of course.  I am concerned by the size of the patch and how many other
RTL optimization passes would need similar treatment.

Thanks,
Richard.



More information about the Gcc-patches mailing list