summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-27 16:36:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-27 16:36:57 +0000
commitbf262632f9e4c5afee5f8cf4a06b2fc1f874497b (patch)
tree8a4270718d3d004cf539ed6d9f74c79c31c4ebcc /gcc
parent7547883d18dd46ad4718913b72d449076ab76c27 (diff)
downloadgcc-bf262632f9e4c5afee5f8cf4a06b2fc1f874497b.tar.gz
PR debug/42861
* var-tracking.c (val_store): Add modified argument, obey it. Adjust callers. (count_uses): Move down logging of main. (compute_bb_dataflow): Use val_store for MO_VAL_USEs that don't need resolution. (emit_notes_in_bb): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156292 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/var-tracking.c34
2 files changed, 33 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 41f7bad4b13..1ab9b18e1d7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-27 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/42861
+ * var-tracking.c (val_store): Add modified argument, obey it.
+ Adjust callers.
+ (count_uses): Move down logging of main.
+ (compute_bb_dataflow): Use val_store for MO_VAL_USEs that
+ don't need resolution.
+ (emit_notes_in_bb): Likewise.
+
2010-01-27 Richard Guenther <rguenther@suse.de>
PR middle-end/42878
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 79e8d560895..58a11c1031b 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -1518,10 +1518,12 @@ var_mem_delete (dataflow_set *set, rtx loc, bool clobber)
delete_variable_part (set, loc, dv_from_decl (decl), offset);
}
-/* Map a value to a location it was just stored in. */
+/* Bind a value to a location it was just stored in. If MODIFIED
+ holds, assume the location was modified, detaching it from any
+ values bound to it. */
static void
-val_store (dataflow_set *set, rtx val, rtx loc, rtx insn)
+val_store (dataflow_set *set, rtx val, rtx loc, rtx insn, bool modified)
{
cselib_val *v = CSELIB_VAL_PTR (val);
@@ -1547,7 +1549,8 @@ val_store (dataflow_set *set, rtx val, rtx loc, rtx insn)
if (REG_P (loc))
{
- var_regno_delete (set, REGNO (loc));
+ if (modified)
+ var_regno_delete (set, REGNO (loc));
var_reg_decl_set (set, loc, VAR_INIT_STATUS_INITIALIZED,
dv_from_value (val), 0, NULL_RTX, INSERT);
}
@@ -4530,11 +4533,6 @@ count_uses (rtx *ploc, void *cuip)
cselib_val *val;
enum machine_mode mode = GET_MODE (loc);
- VTI (cui->bb)->n_mos++;
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- log_op_type (loc, cui->bb, cui->insn, mopt, dump_file);
-
switch (mopt)
{
case MO_VAL_LOC:
@@ -4550,12 +4548,15 @@ count_uses (rtx *ploc, void *cuip)
{
enum machine_mode address_mode
= targetm.addr_space.address_mode (MEM_ADDR_SPACE (loc));
- val = cselib_lookup (XEXP (loc, 0), address_mode, false);
+ val = cselib_lookup (XEXP (loc, 0), address_mode, 0);
if (val && !cselib_preserved_value_p (val))
{
VTI (cui->bb)->n_mos++;
cselib_preserve_value (val);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (XEXP (loc, 0), cui->bb, cui->insn,
+ MO_VAL_USE, dump_file);
}
}
@@ -4578,6 +4579,9 @@ count_uses (rtx *ploc, void *cuip)
{
VTI (cui->bb)->n_mos++;
cselib_preserve_value (oval);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (loc, cui->bb, cui->insn,
+ MO_VAL_USE, dump_file);
}
}
@@ -4592,6 +4596,10 @@ count_uses (rtx *ploc, void *cuip)
default:
break;
}
+
+ VTI (cui->bb)->n_mos++;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ log_op_type (loc, cui->bb, cui->insn, mopt, dump_file);
}
return 0;
@@ -5331,6 +5339,8 @@ compute_bb_dataflow (basic_block bb)
if (VAL_NEEDS_RESOLUTION (loc))
val_resolve (out, val, vloc, insn);
+ else
+ val_store (out, val, uloc, insn, false);
if (VAL_HOLDS_TRACK_EXPR (loc))
{
@@ -5422,7 +5432,7 @@ compute_bb_dataflow (basic_block bb)
else if (REG_P (uloc))
var_regno_delete (out, REGNO (uloc));
- val_store (out, val, vloc, insn);
+ val_store (out, val, vloc, insn, true);
}
break;
@@ -6951,6 +6961,8 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set)
if (VAL_NEEDS_RESOLUTION (loc))
val_resolve (set, val, vloc, insn);
+ else
+ val_store (set, val, uloc, insn, false);
if (VAL_HOLDS_TRACK_EXPR (loc))
{
@@ -7038,7 +7050,7 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set)
else if (REG_P (uloc))
var_regno_delete (set, REGNO (uloc));
- val_store (set, val, vloc, insn);
+ val_store (set, val, vloc, insn, true);
emit_notes_for_changes (NEXT_INSN (insn), EMIT_NOTE_BEFORE_INSN,
set->vars);