+2011-10-26 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/50826
+ * var-tracking.c (rtx_debug_expr_p): New.
+ (use_type): Don't use debug exprs to track non-VTA variables.
+
2011-10-26 Jeff Law <law@redhat.com>
* doc/invoke.texi (sink-frequency-threshold): Document.
return cselib_subst_to_values (loc, VOIDmode);
}
+/* Return true if *X is a DEBUG_EXPR. Usable as an argument to
+ for_each_rtx to tell whether there are any DEBUG_EXPRs within
+ RTX. */
+
+static int
+rtx_debug_expr_p (rtx *x, void *data ATTRIBUTE_UNUSED)
+{
+ rtx loc = *x;
+
+ return GET_CODE (loc) == DEBUG_EXPR;
+}
+
/* Determine what kind of micro operation to choose for a USE. Return
MO_CLOBBER if no micro operation is to be generated. */
else if (target_for_debug_bind (var_debug_decl (expr)))
return MO_CLOBBER;
else if (track_loc_p (loc, expr, INT_MEM_OFFSET (loc),
- false, modep, NULL))
+ false, modep, NULL)
+ /* Multi-part variables shouldn't refer to one-part
+ variable names such as VALUEs (never happens) or
+ DEBUG_EXPRs (only happens in the presence of debug
+ insns). */
+ && (!MAY_HAVE_DEBUG_INSNS
+ || !for_each_rtx (&XEXP (loc, 0), rtx_debug_expr_p, NULL)))
return MO_USE;
else
return MO_CLOBBER;