aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:24:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:24:53 +0000
commit4f498863ce10eb5ee1ae0e0a2d1234f9f2419834 (patch)
tree3f1d44b70def67e70df19ea222c171ca8ec0ac5a /gcc
parent638e18a4f236204b61e6a6e74583f689926ec812 (diff)
downloadgcc-4f498863ce10eb5ee1ae0e0a2d1234f9f2419834.zip
gcc-4f498863ce10eb5ee1ae0e0a2d1234f9f2419834.tar.gz
gcc-4f498863ce10eb5ee1ae0e0a2d1234f9f2419834.tar.bz2
var-tracking.c: Include rtl-iter.h.
gcc/ * var-tracking.c: Include rtl-iter.h. (rtx_debug_expr_p): Turn from being a for_each_rtx callback to being a function that examines each subrtx itself. (use_type): Update accordingly. From-SVN: r214661
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/var-tracking.c19
2 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4a271d5..4ca3224 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+ * var-tracking.c: Include rtl-iter.h.
+ (rtx_debug_expr_p): Turn from being a for_each_rtx callback
+ to being a function that examines each subrtx itself.
+ (use_type): Update accordingly.
+
+2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+
* store-motion.c: Include rtl-iter.h.
(extract_mentioned_regs_1): Delete.
(extract_mentioned_regs): Use FOR_EACH_SUBRTX_VAR rather than
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 931a7f0..1cd2276 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -118,6 +118,7 @@
#include "recog.h"
#include "tm_p.h"
#include "alias.h"
+#include "rtl-iter.h"
/* var-tracking.c assumes that tree code with the same value as VALUE rtx code
has no chance to appear in REG_EXPR/MEM_EXPRs and isn't a decl.
@@ -5366,16 +5367,16 @@ 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. */
+/* Return true if X contains a DEBUG_EXPR. */
-static int
-rtx_debug_expr_p (rtx *x, void *data ATTRIBUTE_UNUSED)
+static bool
+rtx_debug_expr_p (const_rtx x)
{
- rtx loc = *x;
-
- return GET_CODE (loc) == DEBUG_EXPR;
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, x, ALL)
+ if (GET_CODE (*iter) == DEBUG_EXPR)
+ return true;
+ return false;
}
/* Determine what kind of micro operation to choose for a USE. Return
@@ -5465,7 +5466,7 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
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)))
+ || !rtx_debug_expr_p (XEXP (loc, 0))))
return MO_USE;
else
return MO_CLOBBER;