aboutsummaryrefslogtreecommitdiff
path: root/gcc/df-problems.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2012-06-25 14:20:19 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2012-06-25 14:20:19 +0000
commitf0bb2c2aa031199919b649593fed07e1670774de (patch)
treeba82af97f9762d145f560b6e3fa670263a013bbd /gcc/df-problems.c
parentb7b3e6e22b8d92abb12833b2a2a07f4b37b14c3b (diff)
PR debug/53740
* df.h, df-problems.c, dce.c: Revert last patch. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@188935 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r--gcc/df-problems.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 2a698d4d5e2..a020e28ad27 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -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. */
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);
@@ -3179,7 +3179,7 @@ dead_debug_add (struct dead_debug *debug, df_ref use)
if (!debug->used)
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
@@ -3201,7 +3201,6 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
rtx breg;
rtx dval;
rtx bind;
- rtx cur_reg;
if (!debug->used || !bitmap_clear_bit (debug->used, uregno))
return 0;
@@ -3210,8 +3209,7 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
the widest referenced mode. */
while ((cur = *tailp))
{
- cur_reg = *DF_REF_REAL_LOC (cur->use);
- if (REGNO (cur_reg) == uregno)
+ if (DF_REF_REGNO (cur->use) == uregno)
{
*usesp = cur;
usesp = &cur->next;
@@ -3219,13 +3217,21 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
cur->next = NULL;
if (!reg
|| (GET_MODE_BITSIZE (GET_MODE (reg))
- < GET_MODE_BITSIZE (GET_MODE (cur_reg))))
- reg = cur_reg;
+ < GET_MODE_BITSIZE (GET_MODE (*DF_REF_REAL_LOC (cur->use)))))
+ reg = *DF_REF_REAL_LOC (cur->use);
}
else
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);
breg = reg;
@@ -3334,21 +3340,15 @@ dead_debug_insert_temp (struct dead_debug *debug, unsigned int uregno,
/* Adjust all uses. */
while ((cur = uses))
{
- /* If the reference spans multiple hard registers, we'll have
- a use for each one. Only change each reference once. */
- cur_reg = *DF_REF_REAL_LOC (cur->use);
- if (REG_P (cur_reg))
- {
- if (GET_MODE (cur_reg) == GET_MODE (reg))
- *DF_REF_REAL_LOC (cur->use) = dval;
- else
- *DF_REF_REAL_LOC (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)));
- }
+ if (GET_MODE (*DF_REF_REAL_LOC (cur->use)) == GET_MODE (reg))
+ *DF_REF_REAL_LOC (cur->use) = dval;
+ else
+ *DF_REF_REAL_LOC (cur->use)
+ = gen_lowpart_SUBREG (GET_MODE (*DF_REF_REAL_LOC (cur->use)), 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;
XDELETE (cur);
}
@@ -3547,7 +3547,7 @@ df_note_bb_compute (unsigned int bb_index,
debug insns either. */
if (!bitmap_bit_p (artificial_uses, uregno)
&& !df_ignore_stack_reg (uregno))
- dead_debug_add (&debug, use);
+ dead_debug_add (&debug, use, uregno);
continue;
}
break;