Commit 752ae22f by Richard Sandiford Committed by Richard Sandiford

arc.c (arc_rewrite_small_data_p): Constify argument.

gcc/
	* config/arc/arc.c (arc_rewrite_small_data_p): Constify argument.
	(small_data_pattern_1): Delete.
	(small_data_pattern): Use FOR_EACH_SUBRTX.

From-SVN: r217017
parent 6733978e
2014-11-02 Richard Sandiford <richard.sandiford@arm.com> 2014-11-02 Richard Sandiford <richard.sandiford@arm.com>
* config/arc/arc.c (arc_rewrite_small_data_p): Constify argument.
(small_data_pattern_1): Delete.
(small_data_pattern): Use FOR_EACH_SUBRTX.
2014-11-02 Richard Sandiford <richard.sandiford@arm.com>
* config/arc/arc.c: Include rtl-iter.h. * config/arc/arc.c: Include rtl-iter.h.
(arc_rewrite_small_data_1): Delete. (arc_rewrite_small_data_1): Delete.
(arc_rewrite_small_data): Use FOR_EACH_SUBRTX_PTR. (arc_rewrite_small_data): Use FOR_EACH_SUBRTX_PTR.
...@@ -6355,7 +6355,7 @@ arc_in_small_data_p (const_tree decl) ...@@ -6355,7 +6355,7 @@ arc_in_small_data_p (const_tree decl)
as a gp+symref. */ as a gp+symref. */
static bool static bool
arc_rewrite_small_data_p (rtx x) arc_rewrite_small_data_p (const_rtx x)
{ {
if (GET_CODE (x) == CONST) if (GET_CODE (x) == CONST)
x = XEXP (x, 0); x = XEXP (x, 0);
...@@ -6405,26 +6405,25 @@ arc_rewrite_small_data (rtx op) ...@@ -6405,26 +6405,25 @@ arc_rewrite_small_data (rtx op)
return op; return op;
} }
/* A for_each_rtx callback for small_data_pattern. */
static int
small_data_pattern_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
{
if (GET_CODE (*loc) == PLUS
&& rtx_equal_p (XEXP (*loc, 0), pic_offset_table_rtx))
return -1;
return arc_rewrite_small_data_p (*loc);
}
/* Return true if OP refers to small data symbols directly, not through /* Return true if OP refers to small data symbols directly, not through
a PLUS. */ a PLUS. */
bool bool
small_data_pattern (rtx op, machine_mode) small_data_pattern (rtx op, machine_mode)
{ {
return (GET_CODE (op) != SEQUENCE if (GET_CODE (op) == SEQUENCE)
&& for_each_rtx (&op, small_data_pattern_1, 0)); return false;
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, op, ALL)
{
const_rtx x = *iter;
if (GET_CODE (x) == PLUS
&& rtx_equal_p (XEXP (x, 0), pic_offset_table_rtx))
iter.skip_subrtxes ();
else if (arc_rewrite_small_data_p (x))
return true;
}
return false;
} }
/* Return true if OP is an acceptable memory operand for ARCompact /* Return true if OP is an acceptable memory operand for ARCompact
......
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