diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-26 13:47:48 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-26 13:47:48 +0000 |
commit | d59975de6b684557150ca30b7ede75174a38db93 (patch) | |
tree | e82c87dcd74f1774911e079c54c2deb258e25ca0 /gcc/var-tracking.c | |
parent | 77ecaaba570facfa8e553215863129442713ccc4 (diff) | |
download | gcc-d59975de6b684557150ca30b7ede75174a38db93.tar.gz |
PR debug/50826
* var-tracking.c (rtx_debug_expr_p): New.
(use_type): Don't use debug exprs to track non-VTA variables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180525 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r-- | gcc/var-tracking.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 8a64000b616..44bab38de00 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -4907,6 +4907,18 @@ replace_expr_with_values (rtx loc) 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. */ @@ -4988,7 +5000,13 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep) 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; |