From 3dfc96ea690917c6d15775c1189140922dd35bca Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 27 Oct 2014 18:40:13 +0000 Subject: [PATCH] spu.c: Include rtl-iter.h gcc/ * 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. From-SVN: r216752 --- gcc/ChangeLog | 8 ++++++++ gcc/config/spu/spu.c | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f588f032841..b5dc7f2f6e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-10-27 Richard Sandiford + + * 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 Tom Tromey diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 56186360cae..ef1ccef0b94 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -77,6 +77,7 @@ #include "dumpfile.h" #include "cfgloop.h" #include "builtins.h" +#include "rtl-iter.h" /* Builtin types, data and prototypes. */ @@ -3474,10 +3475,9 @@ exp2_immediate_p (rtx op, enum machine_mode mode, int low, int high) /* 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) @@ -3504,13 +3504,15 @@ ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED) 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 @@ -3556,7 +3558,7 @@ spu_legitimate_address_p (enum machine_mode mode, 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; -- 2.30.2