Commit 0951ac86 by Richard Sandiford Committed by Richard Sandiford

re PR debug/53740 (--enable-checking=yes,rtl bootstrap failure with ada)

	PR debug/53740
	* df.h, df-problems.c, dce.c: Revert last patch.

From-SVN: r188935
parent ecf706e5
2012-06-25 Richard Sandiford <rdsandiford@googlemail.com>
PR debug/53740
* df.h, df-problems.c, dce.c: Revert last patch.
2012-06-25 Iain Sandoe <iain@codesourcery.com> 2012-06-25 Iain Sandoe <iain@codesourcery.com>
* MAINTAINERS (Write After Approval): Update my email address. * MAINTAINERS (Write After Approval): Update my email address.
......
...@@ -848,7 +848,7 @@ word_dce_process_block (basic_block bb, bool redo_out) ...@@ -848,7 +848,7 @@ word_dce_process_block (basic_block bb, bool redo_out)
== 2 * UNITS_PER_WORD) == 2 * UNITS_PER_WORD)
&& !bitmap_bit_p (local_live, 2 * DF_REF_REGNO (*use_rec)) && !bitmap_bit_p (local_live, 2 * DF_REF_REGNO (*use_rec))
&& !bitmap_bit_p (local_live, 2 * DF_REF_REGNO (*use_rec) + 1)) && !bitmap_bit_p (local_live, 2 * DF_REF_REGNO (*use_rec) + 1))
dead_debug_add (&debug, *use_rec); dead_debug_add (&debug, *use_rec, DF_REF_REGNO (*use_rec));
} }
else if (INSN_P (insn)) else if (INSN_P (insn))
{ {
...@@ -938,7 +938,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) ...@@ -938,7 +938,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++) for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++)
if (!bitmap_bit_p (local_live, DF_REF_REGNO (*use_rec)) if (!bitmap_bit_p (local_live, DF_REF_REGNO (*use_rec))
&& !bitmap_bit_p (au, DF_REF_REGNO (*use_rec))) && !bitmap_bit_p (au, DF_REF_REGNO (*use_rec)))
dead_debug_add (&debug, *use_rec); dead_debug_add (&debug, *use_rec, DF_REF_REGNO (*use_rec));
} }
else if (INSN_P (insn)) else if (INSN_P (insn))
{ {
......
...@@ -3165,10 +3165,10 @@ dead_debug_finish (struct dead_debug *debug, bitmap used) ...@@ -3165,10 +3165,10 @@ dead_debug_finish (struct dead_debug *debug, bitmap used)
} }
} }
/* Add USE to DEBUG. It must be a dead reference to a register in a debug /* Add USE to DEBUG. It must be a dead reference to UREGNO in a debug
insn. Create a bitmap for DEBUG as needed. */ insn. Create a bitmap for DEBUG as needed. */
void void
dead_debug_add (struct dead_debug *debug, df_ref use) dead_debug_add (struct dead_debug *debug, df_ref use, unsigned int uregno)
{ {
struct dead_debug_use *newddu = XNEW (struct dead_debug_use); struct dead_debug_use *newddu = XNEW (struct dead_debug_use);
...@@ -3179,7 +3179,7 @@ dead_debug_add (struct dead_debug *debug, df_ref use) ...@@ -3179,7 +3179,7 @@ dead_debug_add (struct dead_debug *debug, df_ref use)
if (!debug->used) if (!debug->used)
debug->used = BITMAP_ALLOC (NULL); debug->used = BITMAP_ALLOC (NULL);
bitmap_set_bit (debug->used, REGNO (*DF_REF_REAL_LOC (use))); bitmap_set_bit (debug->used, uregno);
} }
/* If UREGNO is referenced by any entry in DEBUG, emit a debug insn /* If UREGNO is referenced by any entry in DEBUG, emit a debug insn
...@@ -3201,7 +3201,6 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno, ...@@ -3201,7 +3201,6 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
rtx breg; rtx breg;
rtx dval; rtx dval;
rtx bind; rtx bind;
rtx cur_reg;
if (!debug->used || !bitmap_clear_bit (debug->used, uregno)) if (!debug->used || !bitmap_clear_bit (debug->used, uregno))
return 0; return 0;
...@@ -3210,8 +3209,7 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno, ...@@ -3210,8 +3209,7 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
the widest referenced mode. */ the widest referenced mode. */
while ((cur = *tailp)) while ((cur = *tailp))
{ {
cur_reg = *DF_REF_REAL_LOC (cur->use); if (DF_REF_REGNO (cur->use) == uregno)
if (REGNO (cur_reg) == uregno)
{ {
*usesp = cur; *usesp = cur;
usesp = &cur->next; usesp = &cur->next;
...@@ -3219,13 +3217,21 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno, ...@@ -3219,13 +3217,21 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
cur->next = NULL; cur->next = NULL;
if (!reg if (!reg
|| (GET_MODE_BITSIZE (GET_MODE (reg)) || (GET_MODE_BITSIZE (GET_MODE (reg))
< GET_MODE_BITSIZE (GET_MODE (cur_reg)))) < GET_MODE_BITSIZE (GET_MODE (*DF_REF_REAL_LOC (cur->use)))))
reg = cur_reg; reg = *DF_REF_REAL_LOC (cur->use);
} }
else else
tailp = &(*tailp)->next; tailp = &(*tailp)->next;
} }
/* We may have dangling bits in debug->used for registers that were part
of a multi-register use, one component of which has been reset. */
if (reg == NULL)
{
gcc_checking_assert (!uses);
return 0;
}
gcc_checking_assert (uses); gcc_checking_assert (uses);
breg = reg; breg = reg;
...@@ -3334,21 +3340,15 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno, ...@@ -3334,21 +3340,15 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
/* Adjust all uses. */ /* Adjust all uses. */
while ((cur = uses)) while ((cur = uses))
{ {
/* If the reference spans multiple hard registers, we'll have if (GET_MODE (*DF_REF_REAL_LOC (cur->use)) == GET_MODE (reg))
a use for each one. Only change each reference once. */ *DF_REF_REAL_LOC (cur->use) = dval;
cur_reg = *DF_REF_REAL_LOC (cur->use); else
if (REG_P (cur_reg)) *DF_REF_REAL_LOC (cur->use)
{ = gen_lowpart_SUBREG (GET_MODE (*DF_REF_REAL_LOC (cur->use)), dval);
if (GET_MODE (cur_reg) == GET_MODE (reg)) /* ??? Should we simplify subreg of subreg? */
*DF_REF_REAL_LOC (cur->use) = dval; if (debug->to_rescan == NULL)
else debug->to_rescan = BITMAP_ALLOC (NULL);
*DF_REF_REAL_LOC (cur->use) bitmap_set_bit (debug->to_rescan, INSN_UID (DF_REF_INSN (cur->use)));
= gen_lowpart_SUBREG (GET_MODE (cur_reg), dval);
/* ??? Should we simplify subreg of subreg? */
if (debug->to_rescan == NULL)
debug->to_rescan = BITMAP_ALLOC (NULL);
bitmap_set_bit (debug->to_rescan, INSN_UID (DF_REF_INSN (cur->use)));
}
uses = cur->next; uses = cur->next;
XDELETE (cur); XDELETE (cur);
} }
...@@ -3547,7 +3547,7 @@ df_note_bb_compute (unsigned int bb_index, ...@@ -3547,7 +3547,7 @@ df_note_bb_compute (unsigned int bb_index,
debug insns either. */ debug insns either. */
if (!bitmap_bit_p (artificial_uses, uregno) if (!bitmap_bit_p (artificial_uses, uregno)
&& !df_ignore_stack_reg (uregno)) && !df_ignore_stack_reg (uregno))
dead_debug_add (&debug, use); dead_debug_add (&debug, use, uregno);
continue; continue;
} }
break; break;
......
...@@ -1138,7 +1138,7 @@ enum debug_temp_where ...@@ -1138,7 +1138,7 @@ enum debug_temp_where
extern void dead_debug_init (struct dead_debug *, bitmap); extern void dead_debug_init (struct dead_debug *, bitmap);
extern void dead_debug_finish (struct dead_debug *, bitmap); extern void dead_debug_finish (struct dead_debug *, bitmap);
extern void dead_debug_add (struct dead_debug *, df_ref); extern void dead_debug_add (struct dead_debug *, df_ref, unsigned int);
extern int dead_debug_insert_temp (struct dead_debug *, extern int dead_debug_insert_temp (struct dead_debug *,
unsigned int uregno, rtx insn, unsigned int uregno, rtx insn,
enum debug_temp_where); enum debug_temp_where);
......
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