aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:23:04 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:23:04 +0000
commita4ba89ffcaad2f331a0fcc5d236f0b114afde8cc (patch)
treef1e2fc2e30445f13dd67b7d2ee7b4850ece51ec6 /gcc
parentd7111da854bd560e3ea576ef954a8e93151a198c (diff)
downloadgcc-a4ba89ffcaad2f331a0fcc5d236f0b114afde8cc.zip
gcc-a4ba89ffcaad2f331a0fcc5d236f0b114afde8cc.tar.gz
gcc-a4ba89ffcaad2f331a0fcc5d236f0b114afde8cc.tar.bz2
dwarf2out.c: Include rtl-iter.h.
gcc/ * dwarf2out.c: Include rtl-iter.h. (const_ok_for_output_1): Take the rtx instead of a pointer to it. Remove unused data parameter. Return a bool, inverting the result so that 0/false means "not ok". (const_ok_for_output): Update accordingly. Use FOR_EACH_SUBRTX_VAR instead of for_each_rtx. From-SVN: r214636
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/dwarf2out.c37
2 files changed, 29 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ca63ee5..01a7915 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+ * dwarf2out.c: Include rtl-iter.h.
+ (const_ok_for_output_1): Take the rtx instead of a pointer to it.
+ Remove unused data parameter. Return a bool, inverting the result
+ so that 0/false means "not ok".
+ (const_ok_for_output): Update accordingly. Use FOR_EACH_SUBRTX_VAR
+ instead of for_each_rtx.
+
+2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+
* dse.c: Include rtl-iter.h.
(check_mem_read_rtx): Change void * parameter to real type.
Remove return value.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8698e45..6e040f5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -98,6 +98,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "tree-dfa.h"
#include "gdb/gdb-index.h"
+#include "rtl-iter.h"
static void dwarf2out_source_line (unsigned int, const char *, int, bool);
static rtx_insn *last_var_location_insn;
@@ -11413,14 +11414,11 @@ expansion_failed (tree expr, rtx rtl, char const *reason)
}
}
-/* Helper function for const_ok_for_output, called either directly
- or via for_each_rtx. */
+/* Helper function for const_ok_for_output. */
-static int
-const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
+static bool
+const_ok_for_output_1 (rtx rtl)
{
- rtx rtl = *rtlp;
-
if (GET_CODE (rtl) == UNSPEC)
{
/* If delegitimize_address couldn't do anything with the UNSPEC, assume
@@ -11448,14 +11446,14 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
#endif
expansion_failed (NULL_TREE, rtl,
"UNSPEC hasn't been delegitimized.\n");
- return 1;
+ return false;
}
if (targetm.const_not_ok_for_debug_p (rtl))
{
expansion_failed (NULL_TREE, rtl,
"Expression rejected for debug by the backend.\n");
- return 1;
+ return false;
}
/* FIXME: Refer to PR60655. It is possible for simplification
@@ -11466,9 +11464,8 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
if (GET_CODE (rtl) != SYMBOL_REF)
{
if (GET_CODE (rtl) == NOT)
- return 1;
-
- return 0;
+ return false;
+ return true;
}
if (CONSTANT_POOL_ADDRESS_P (rtl))
@@ -11481,12 +11478,12 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
{
expansion_failed (NULL_TREE, rtl,
"Constant was removed from constant pool.\n");
- return 1;
+ return false;
}
}
if (SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
- return 1;
+ return false;
/* Avoid references to external symbols in debug info, on several targets
the linker might even refuse to link when linking a shared library,
@@ -11501,11 +11498,11 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
{
expansion_failed (NULL_TREE, rtl,
"Symbol not defined in current TU.\n");
- return 1;
+ return false;
}
}
- return 0;
+ return true;
}
/* Return true if constant RTL can be emitted in DW_OP_addr or
@@ -11516,10 +11513,16 @@ static bool
const_ok_for_output (rtx rtl)
{
if (GET_CODE (rtl) == SYMBOL_REF)
- return const_ok_for_output_1 (&rtl, NULL) == 0;
+ return const_ok_for_output_1 (rtl);
if (GET_CODE (rtl) == CONST)
- return for_each_rtx (&XEXP (rtl, 0), const_ok_for_output_1, NULL) == 0;
+ {
+ subrtx_var_iterator::array_type array;
+ FOR_EACH_SUBRTX_VAR (iter, array, XEXP (rtl, 0), ALL)
+ if (!const_ok_for_output_1 (*iter))
+ return false;
+ return true;
+ }
return true;
}