aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-08-27 20:40:05 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-08-27 20:40:05 +0000
commit2f33ff0a9d2192cf69aac8c057d74fd5217e1619 (patch)
tree8edc6c42e4f961da3fe3275dcc079fe22dacc1f3
parent0f4783c7f7c01596686da28e6fe86e0b69a43f3e (diff)
downloadgcc-2f33ff0a9d2192cf69aac8c057d74fd5217e1619.zip
gcc-2f33ff0a9d2192cf69aac8c057d74fd5217e1619.tar.gz
gcc-2f33ff0a9d2192cf69aac8c057d74fd5217e1619.tar.bz2
Use rtx_expr_list in various places
gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
-rw-r--r--gcc/ChangeLog37
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/lists.c16
-rw-r--r--gcc/loop-iv.c13
-rw-r--r--gcc/reload.h2
-rw-r--r--gcc/rtl.h6
-rw-r--r--gcc/sched-deps.c8
-rw-r--r--gcc/sched-int.h4
-rw-r--r--gcc/sched-rgn.c15
-rw-r--r--gcc/var-tracking.c6
10 files changed, 74 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9fbf522..11fba83 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,42 @@
2014-08-27 David Malcolm <dmalcolm@redhat.com>
+ * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to
+ rtx_expr_list **.
+ (alloc_EXPR_LIST): Strengthen return type from rtx to
+ rtx_expr_list *.
+ (remove_free_EXPR_LIST_node): Likewise for param.
+ * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list"
+ from rtx to rtx_expr_list *.
+ * sched-int.h (struct deps_desc): Strengthen fields
+ "pending_read_mems" and "pending_write_mems" from rtx to
+ rtx_expr_list *.
+
+ * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from
+ rtx to rtx_expr_list *.
+ * lists.c (alloc_INSN_LIST): Likewise, also for local "r".
+ (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to
+ rtx_expr_list **.
+ (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node"
+ from rtx to rtx_expr_list *.
+ * loop-iv.c (simplify_using_initial_values): Strengthen local
+ "cond_list" from rtx to rtx_expr_list *, and locals "pnode",
+ "pnote_next" from rtx * to rtx_expr_list **.
+ * sched-deps.c (remove_from_both_dependence_lists): Strengthen
+ param "exprp" from rtx * to rtx_expr_list **.
+ (add_insn_mem_dependence): Strengthen local "mem_list" from
+ rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx
+ to rtx_expr_list *.
+ * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems"
+ and local "new_mems" from rtx to rtx_expr_list *. Strengthen
+ param "old_mems_p" from rtx * to rtx_expr_list **.
+ * var-tracking.c (struct adjust_mem_data): Strengthen field
+ "side_effects" from rtx to rtx_expr_list *.
+ (adjust_insn): Replace NULL_RTX with NULL when assigning to
+ rtx_expr_list *.
+ (prepare_call_arguments): Likewise.
+
+2014-08-27 David Malcolm <dmalcolm@redhat.com>
+
* function.h (struct rtl_data): Strengthen field
"x_stack_slot_list" from rtx to rtx_expr_list *.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index fb01732..8698e45 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5024,7 +5024,7 @@ decl_piece_varloc_ptr (rtx piece)
/* Create an EXPR_LIST for location note LOC_NOTE covering BITSIZE bits.
Next is the chain of following piece nodes. */
-static rtx
+static rtx_expr_list *
decl_piece_node (rtx loc_note, HOST_WIDE_INT bitsize, rtx next)
{
if (bitsize <= (int) MAX_MACHINE_MODE)
diff --git a/gcc/lists.c b/gcc/lists.c
index 5e07880..78556be 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -125,14 +125,14 @@ alloc_INSN_LIST (rtx val, rtx next)
/* This call is used in place of a gen_rtx_EXPR_LIST. If there is a cached
node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST
is made. */
-rtx
+rtx_expr_list *
alloc_EXPR_LIST (int kind, rtx val, rtx next)
{
- rtx r;
+ rtx_expr_list *r;
if (unused_expr_list)
{
- r = unused_expr_list;
+ r = as_a <rtx_expr_list *> (unused_expr_list);
unused_expr_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
@@ -146,11 +146,11 @@ alloc_EXPR_LIST (int kind, rtx val, rtx next)
/* This function will free up an entire list of EXPR_LIST nodes. */
void
-free_EXPR_LIST_list (rtx *listp)
+free_EXPR_LIST_list (rtx_expr_list **listp)
{
if (*listp == 0)
return;
- free_list (listp, &unused_expr_list);
+ free_list ((rtx *)listp, &unused_expr_list);
}
/* This function will free up an entire list of INSN_LIST nodes. */
@@ -233,12 +233,12 @@ remove_free_INSN_LIST_node (rtx_insn_list **listp)
/* Remove and free the first node in the EXPR_LIST pointed to by LISTP. */
rtx
-remove_free_EXPR_LIST_node (rtx *listp)
+remove_free_EXPR_LIST_node (rtx_expr_list **listp)
{
- rtx node = *listp;
+ rtx_expr_list *node = *listp;
rtx elem = XEXP (node, 0);
- remove_list_node (listp);
+ remove_list_node ((rtx *)listp);
free_EXPR_LIST_node (node);
return elem;
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index b83f8f8..eb3fd47 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1873,7 +1873,8 @@ static void
simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
{
bool expression_valid;
- rtx head, tail, cond_list, last_valid_expr;
+ rtx head, tail, last_valid_expr;
+ rtx_expr_list *cond_list;
rtx_insn *insn;
rtx neutral, aggr;
regset altered, this_altered;
@@ -1951,7 +1952,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
expression_valid = true;
last_valid_expr = *expr;
- cond_list = NULL_RTX;
+ cond_list = NULL;
while (1)
{
insn = BB_END (e->src);
@@ -2003,7 +2004,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
if (suitable_set_for_replacement (insn, &dest, &src))
{
- rtx *pnote, *pnote_next;
+ rtx_expr_list **pnote, **pnote_next;
replace_in_expr (expr, dest, src);
if (CONSTANT_P (*expr))
@@ -2014,7 +2015,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
rtx note = *pnote;
rtx old_cond = XEXP (note, 0);
- pnote_next = &XEXP (note, 1);
+ pnote_next = (rtx_expr_list **)&XEXP (note, 1);
replace_in_expr (&XEXP (note, 0), dest, src);
/* We can no longer use a condition that has been simplified
@@ -2034,7 +2035,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
}
else
{
- rtx *pnote, *pnote_next;
+ rtx_expr_list **pnote, **pnote_next;
/* If we did not use this insn to make a replacement, any overlap
between stores in this insn and our expression will cause the
@@ -2048,7 +2049,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
rtx note = *pnote;
rtx old_cond = XEXP (note, 0);
- pnote_next = &XEXP (note, 1);
+ pnote_next = (rtx_expr_list **)&XEXP (note, 1);
if (for_each_rtx (&old_cond, altered_reg_used, this_altered))
{
*pnote = *pnote_next;
diff --git a/gcc/reload.h b/gcc/reload.h
index ea9081f..80ceae2 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -233,7 +233,7 @@ struct reg_equivs_t
/* An EXPR_LIST of REG_EQUIVs containing MEMs with
alternate representations of the location of pseudo reg N. */
- rtx alt_mem_list;
+ rtx_expr_list *alt_mem_list;
/* The list of insns that initialized reg N from its equivalent
constant or memory slot. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b086b3c..4dcbe86 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2862,18 +2862,18 @@ extern void subreg_get_info (unsigned int, enum machine_mode,
/* lists.c */
-extern void free_EXPR_LIST_list (rtx *);
+extern void free_EXPR_LIST_list (rtx_expr_list **);
extern void free_INSN_LIST_list (rtx_insn_list **);
extern void free_EXPR_LIST_node (rtx);
extern void free_INSN_LIST_node (rtx);
extern rtx_insn_list *alloc_INSN_LIST (rtx, rtx);
extern rtx_insn_list *copy_INSN_LIST (rtx_insn_list *);
extern rtx_insn_list *concat_INSN_LIST (rtx_insn_list *, rtx_insn_list *);
-extern rtx alloc_EXPR_LIST (int, rtx, rtx);
+extern rtx_expr_list *alloc_EXPR_LIST (int, rtx, rtx);
extern void remove_free_INSN_LIST_elem (rtx_insn *, rtx_insn_list **);
extern rtx remove_list_elem (rtx, rtx *);
extern rtx_insn *remove_free_INSN_LIST_node (rtx_insn_list **);
-extern rtx remove_free_EXPR_LIST_node (rtx *);
+extern rtx remove_free_EXPR_LIST_node (rtx_expr_list **);
/* reginfo.c */
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index fb1b658..cbc1814 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1622,7 +1622,7 @@ remove_from_dependence_list (rtx insn, rtx_insn_list **listp)
static int
remove_from_both_dependence_lists (rtx insn,
rtx_insn_list **listp,
- rtx *exprp)
+ rtx_expr_list **exprp)
{
int removed = 0;
@@ -1637,7 +1637,7 @@ remove_from_both_dependence_lists (rtx insn,
}
listp = (rtx_insn_list **)&XEXP (*listp, 1);
- exprp = &XEXP (*exprp, 1);
+ exprp = (rtx_expr_list **)&XEXP (*exprp, 1);
}
return removed;
@@ -1719,8 +1719,8 @@ add_insn_mem_dependence (struct deps_desc *deps, bool read_p,
{
rtx_insn_list **insn_list;
rtx_insn_list *insn_node;
- rtx *mem_list;
- rtx mem_node;
+ rtx_expr_list **mem_list;
+ rtx_expr_list *mem_node;
gcc_assert (!deps->readonly);
if (read_p)
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index f8e5e74..a19d776 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -474,13 +474,13 @@ struct deps_desc
rtx_insn_list *pending_read_insns;
/* An EXPR_LIST containing all MEM rtx's which are pending reads. */
- rtx pending_read_mems;
+ rtx_expr_list *pending_read_mems;
/* An INSN_LIST containing all insns with pending write operations. */
rtx_insn_list *pending_write_insns;
/* An EXPR_LIST containing all MEM rtx's which are pending writes. */
- rtx pending_write_mems;
+ rtx_expr_list *pending_write_mems;
/* An INSN_LIST containing all jump insns. */
rtx_insn_list *pending_jump_insns;
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 92a8a27..93bebc9 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -240,8 +240,8 @@ static void add_branch_dependences (rtx_insn *, rtx_insn *);
static void compute_block_dependences (int);
static void schedule_region (int);
-static void concat_insn_mem_list (rtx_insn_list *, rtx,
- rtx_insn_list **, rtx *);
+static void concat_insn_mem_list (rtx_insn_list *, rtx_expr_list *,
+ rtx_insn_list **, rtx_expr_list **);
static void propagate_deps (int, struct deps_desc *);
static void free_pending_lists (void);
@@ -2585,19 +2585,20 @@ add_branch_dependences (rtx_insn *head, rtx_insn *tail)
static struct deps_desc *bb_deps;
static void
-concat_insn_mem_list (rtx_insn_list *copy_insns, rtx copy_mems,
+concat_insn_mem_list (rtx_insn_list *copy_insns,
+ rtx_expr_list *copy_mems,
rtx_insn_list **old_insns_p,
- rtx *old_mems_p)
+ rtx_expr_list **old_mems_p)
{
rtx_insn_list *new_insns = *old_insns_p;
- rtx new_mems = *old_mems_p;
+ rtx_expr_list *new_mems = *old_mems_p;
while (copy_insns)
{
new_insns = alloc_INSN_LIST (copy_insns->insn (), new_insns);
- new_mems = alloc_EXPR_LIST (VOIDmode, XEXP (copy_mems, 0), new_mems);
+ new_mems = alloc_EXPR_LIST (VOIDmode, copy_mems->element (), new_mems);
copy_insns = copy_insns->next ();
- copy_mems = XEXP (copy_mems, 1);
+ copy_mems = copy_mems->next ();
}
*old_insns_p = new_insns;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index b3bda99..931a7f0 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -948,7 +948,7 @@ struct adjust_mem_data
bool store;
enum machine_mode mem_mode;
HOST_WIDE_INT stack_adjust;
- rtx side_effects;
+ rtx_expr_list *side_effects;
};
/* Helper for adjust_mems. Return 1 if *loc is unsuitable for
@@ -1231,7 +1231,7 @@ adjust_insn (basic_block bb, rtx_insn *insn)
amd.mem_mode = VOIDmode;
amd.stack_adjust = -VTI (bb)->out.stack_adjust;
- amd.side_effects = NULL_RTX;
+ amd.side_effects = NULL;
amd.store = true;
note_stores (PATTERN (insn), adjust_mem_stores, &amd);
@@ -6277,7 +6277,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
struct adjust_mem_data amd;
amd.mem_mode = VOIDmode;
amd.stack_adjust = -VTI (bb)->out.stack_adjust;
- amd.side_effects = NULL_RTX;
+ amd.side_effects = NULL;
amd.store = true;
mem = simplify_replace_fn_rtx (mem, NULL_RTX, adjust_mems,
&amd);