Commit 39bc0f01 by Alexandre Oliva Committed by Alexandre Oliva

re PR debug/52983 (internal compiler error: in df_uses_record, at df-scan.c:3243)

PR debug/52983
PR debug/48866
* dce.c (word_dce_process_block): Insert debug temps only if the
insn is not marked.
(dce_process_block): Likewise, and if debug.used is not empty,
and only after iterating over all DEFs that might mark the insn.

From-SVN: r188527
parent 21d01365
2012-06-13 Alexandre Oliva <aoliva@redhat.com> 2012-06-13 Alexandre Oliva <aoliva@redhat.com>
PR debug/52983
PR debug/48866
* dce.c (word_dce_process_block): Insert debug temps only if the
insn is not marked.
(dce_process_block): Likewise, and if debug.used is not empty,
and only after iterating over all DEFs that might mark the insn.
2012-06-13 Alexandre Oliva <aoliva@redhat.com>
* common.opt (ftree-coalesce-inlined-vars): New. * common.opt (ftree-coalesce-inlined-vars): New.
(ftree-coalesce-vars): New. (ftree-coalesce-vars): New.
* doc/invoke.texi: Document them. * doc/invoke.texi: Document them.
......
...@@ -857,8 +857,9 @@ word_dce_process_block (basic_block bb, bool redo_out) ...@@ -857,8 +857,9 @@ word_dce_process_block (basic_block bb, bool redo_out)
anything in local_live. */ anything in local_live. */
if (marked_insn_p (insn)) if (marked_insn_p (insn))
df_word_lr_simulate_uses (insn, local_live); df_word_lr_simulate_uses (insn, local_live);
/* Insert debug temps for dead REGs used in subsequent debug
if (debug.used && !bitmap_empty_p (debug.used)) insns. */
else if (debug.used && !bitmap_empty_p (debug.used))
{ {
df_ref *def_rec; df_ref *def_rec;
...@@ -939,18 +940,13 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) ...@@ -939,18 +940,13 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
/* The insn is needed if there is someone who uses the output. */ /* The insn is needed if there is someone who uses the output. */
if (!needed) if (!needed)
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{ if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec))
dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn, || bitmap_bit_p (au, DF_REF_REGNO (*def_rec)))
DEBUG_TEMP_BEFORE_WITH_VALUE); {
needed = true;
if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec)) mark_insn (insn, true);
|| bitmap_bit_p (au, DF_REF_REGNO (*def_rec))) break;
{ }
needed = true;
mark_insn (insn, true);
break;
}
}
/* No matter if the instruction is needed or not, we remove /* No matter if the instruction is needed or not, we remove
any regno in the defs from the live set. */ any regno in the defs from the live set. */
...@@ -960,6 +956,12 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) ...@@ -960,6 +956,12 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
anything in local_live. */ anything in local_live. */
if (needed) if (needed)
df_simulate_uses (insn, local_live); df_simulate_uses (insn, local_live);
/* Insert debug temps for dead REGs used in subsequent debug
insns. */
else if (debug.used && !bitmap_empty_p (debug.used))
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
dead_debug_insert_temp (&debug, DF_REF_REGNO (*def_rec), insn,
DEBUG_TEMP_BEFORE_WITH_VALUE);
} }
dead_debug_finish (&debug, NULL); dead_debug_finish (&debug, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment