aboutsummaryrefslogtreecommitdiff
path: root/gcc/df-problems.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2012-10-02 20:06:08 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2012-10-02 20:06:08 +0000
commite9f950ba0d521f1a3c0599eebab1f62466b9d218 (patch)
treec5ddc0d1a51185fc60b47f6189eb5c1a1153d6a4 /gcc/df-problems.c
parent58b88be9de291c59e070fa090bc56b975c693062 (diff)
downloadgcc-e9f950ba0d521f1a3c0599eebab1f62466b9d218.zip
gcc-e9f950ba0d521f1a3c0599eebab1f62466b9d218.tar.gz
gcc-e9f950ba0d521f1a3c0599eebab1f62466b9d218.tar.bz2
re PR debug/54551 (DF resets some DEBUG_INSNs unnecessarily)
gcc/ChangeLog: PR debug/54551 * Makefile.in (VALTRACK_H): Add hash-table.h. * valtrack.h: Include hash-table.h. (struct dead_debug_global_entry): New. (struct dead_debug_hash_descr): New. (struct dead_debug_global): New. (struct dead_debug): Rename to... (struct dead_debug_local): ... this. Adjust all uses. (dead_debug_global_init, dead_debug_global_finish): New. (dead_debug_init): Rename to... (dead_debug_local_init): ... this. Adjust all callers. (dead_debug_finish): Rename to... (dead_debug_local_finish): ... this. Adjust all callers. * valtrack.c (dead_debug_global_init): New. (dead_debug_init): Rename to... (dead_debug_local_init): ... this. Take global parameter. Save it and initialize used bitmap from it. (dead_debug_global_find, dead_debug_global_insert): New. (dead_debug_global_replace_temp): New. (dead_debug_promote_uses): New. (dead_debug_finish): Rename to... (dead_debug_local_finish): ... this. Promote remaining uses. (dead_debug_global_finish): New. (dead_debug_add): Try to replace global temps first. (dead_debug_insert_temp): Support global replacements. * dce.c (word_dce_process_block, dce_process_block): Add global_debug parameter. Pass it on. (fast_dce): Initialize, pass on and finalize global_debug. * df-problems.c (df_set_unused_notes_for_mw): Adjusted. (df_create_unused_notes, df_note_bb_compute): Likewise. (df_note_compute): Justify local-only dead debug analysis. gcc/testsuite/ChangeLog: PR debug/54551 * gcc.dg/guality/pr54551.c: New. From-SVN: r192001
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r--gcc/df-problems.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index abeb118..a1a0e71 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -2892,7 +2892,7 @@ static void
df_set_unused_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen,
bitmap artificial_uses,
- struct dead_debug *debug)
+ struct dead_debug_local *debug)
{
unsigned int r;
@@ -3021,7 +3021,7 @@ df_set_dead_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
static void
df_create_unused_note (rtx insn, df_ref def,
bitmap live, bitmap artificial_uses,
- struct dead_debug *debug)
+ struct dead_debug_local *debug)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -3060,9 +3060,9 @@ df_note_bb_compute (unsigned int bb_index,
rtx insn;
df_ref *def_rec;
df_ref *use_rec;
- struct dead_debug debug;
+ struct dead_debug_local debug;
- dead_debug_init (&debug, NULL);
+ dead_debug_local_init (&debug, NULL, NULL);
bitmap_copy (live, df_get_live_out (bb));
bitmap_clear (artificial_uses);
@@ -3268,7 +3268,7 @@ df_note_bb_compute (unsigned int bb_index,
}
}
- dead_debug_finish (&debug, NULL);
+ dead_debug_local_finish (&debug, NULL);
}
@@ -3286,6 +3286,11 @@ df_note_compute (bitmap all_blocks)
EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
{
+ /* ??? Unlike fast DCE, we don't use global_debug for uses of dead
+ pseudos in debug insns because we don't always (re)visit blocks
+ with death points after visiting dead uses. Even changing this
+ loop to postorder would still leave room for visiting a death
+ point before visiting a subsequent debug use. */
df_note_bb_compute (bb_index, &live, &do_not_gen, &artificial_uses);
}