Commit f0ac02c0 by Richard Sandiford Committed by Richard Sandiford

mep.c: Include rtl-iter.h.

gcc/
	* config/mep/mep.c: Include rtl-iter.h.
	(global_reg_mentioned_p_1): Take a const_rtx and return a bool.
	(xtensa_tls_referenced_p): Return a bool.  Use FOR_EACH_SUBRTX.

From-SVN: r216704
parent 2f36a994
2014-10-26 Richard Sandiford <richard.sandiford@arm.com> 2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
* config/mep/mep.c: Include rtl-iter.h.
(global_reg_mentioned_p_1): Take a const_rtx and return a bool.
(xtensa_tls_referenced_p): Return a bool. Use FOR_EACH_SUBRTX.
2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
* config/xtensa/xtensa.c: Include rtl-iter.h. * config/xtensa/xtensa.c: Include rtl-iter.h.
(xtensa_tls_referenced_p_1): Delete. (xtensa_tls_referenced_p_1): Delete.
(xtensa_tls_referenced_p): Use FOR_EACH_SUBRTX. (xtensa_tls_referenced_p): Use FOR_EACH_SUBRTX.
...@@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h" #include "opts.h"
#include "dumpfile.h" #include "dumpfile.h"
#include "builtins.h" #include "builtins.h"
#include "rtl-iter.h"
/* Structure of this file: /* Structure of this file:
...@@ -6367,14 +6368,10 @@ mep_vector_mode_supported_p (enum machine_mode mode ATTRIBUTE_UNUSED) ...@@ -6367,14 +6368,10 @@ mep_vector_mode_supported_p (enum machine_mode mode ATTRIBUTE_UNUSED)
/* A subroutine of global_reg_mentioned_p, returns 1 if *LOC mentions /* A subroutine of global_reg_mentioned_p, returns 1 if *LOC mentions
a global register. */ a global register. */
static int static bool
global_reg_mentioned_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) global_reg_mentioned_p_1 (const_rtx x)
{ {
int regno; int regno;
rtx x = *loc;
if (! x)
return 0;
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
...@@ -6383,40 +6380,31 @@ global_reg_mentioned_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) ...@@ -6383,40 +6380,31 @@ global_reg_mentioned_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
{ {
if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
&& global_regs[subreg_regno (x)]) && global_regs[subreg_regno (x)])
return 1; return true;
return 0; return false;
} }
break; break;
case REG: case REG:
regno = REGNO (x); regno = REGNO (x);
if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno]) if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno])
return 1; return true;
return 0; return false;
case SCRATCH:
case PC:
case CC0:
case CONST_INT:
case CONST_DOUBLE:
case CONST:
case LABEL_REF:
return 0;
case CALL: case CALL:
/* A non-constant call might use a global register. */ /* A non-constant call might use a global register. */
return 1; return true;
default: default:
break; break;
} }
return 0; return false;
} }
/* Returns nonzero if X mentions a global register. */ /* Returns nonzero if X mentions a global register. */
static int static bool
global_reg_mentioned_p (rtx x) global_reg_mentioned_p (rtx x)
{ {
if (INSN_P (x)) if (INSN_P (x))
...@@ -6424,16 +6412,20 @@ global_reg_mentioned_p (rtx x) ...@@ -6424,16 +6412,20 @@ global_reg_mentioned_p (rtx x)
if (CALL_P (x)) if (CALL_P (x))
{ {
if (! RTL_CONST_OR_PURE_CALL_P (x)) if (! RTL_CONST_OR_PURE_CALL_P (x))
return 1; return true;
x = CALL_INSN_FUNCTION_USAGE (x); x = CALL_INSN_FUNCTION_USAGE (x);
if (x == 0) if (x == 0)
return 0; return false;
} }
else else
x = PATTERN (x); x = PATTERN (x);
} }
return for_each_rtx (&x, global_reg_mentioned_p_1, NULL); subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, x, NONCONST)
if (global_reg_mentioned_p_1 (*iter))
return true;
return false;
} }
/* Scheduling hooks for VLIW mode. /* Scheduling hooks for VLIW mode.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment