This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Avoid extending reg lifetime when cprop_hardreg propagates into DEBUG_INSNs (PR debug/43161)
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 ();
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?