+2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/spu/spu.c: Include rtl-iter.h
+ (ea_symbol_ref): Replace with...
+ (ea_symbol_ref_p): ...this new function.
+ (spu_legitimate_address_p): Update call accordingly.
+ (spu_legitimate_constant_p): Likewise. Use FOR_EACH_SUBRTX.
+
2014-10-27 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey <tromey@redhat.com>
#include "dumpfile.h"
#include "cfgloop.h"
#include "builtins.h"
+#include "rtl-iter.h"
/* Builtin types, data and prototypes. */
/* Return true if X is a SYMBOL_REF to an __ea qualified variable. */
-static int
-ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED)
+static bool
+ea_symbol_ref_p (const_rtx x)
{
- rtx x = *px;
tree decl;
if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
bool
spu_legitimate_constant_p (enum machine_mode mode, rtx x)
{
+ subrtx_iterator::array_type array;
if (GET_CODE (x) == HIGH)
x = XEXP (x, 0);
/* Reject any __ea qualified reference. These can't appear in
instructions but must be forced to the constant pool. */
- if (for_each_rtx (&x, ea_symbol_ref, 0))
- return 0;
+ FOR_EACH_SUBRTX (iter, array, x, ALL)
+ if (ea_symbol_ref_p (*iter))
+ return 0;
/* V4SI with all identical symbols is valid. */
if (!flag_pic
case CONST:
/* Keep __ea references until reload so that spu_expand_mov can see them
in MEMs. */
- if (ea_symbol_ref (&x, 0))
+ if (ea_symbol_ref_p (x))
return !reload_in_progress && !reload_completed;
return !TARGET_LARGE_MEM;