]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use rtx_expr_list in various places
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2014 20:40:05 +0000 (20:40 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2014 20:40:05 +0000 (20:40 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214605 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c
gcc/lists.c
gcc/loop-iv.c
gcc/reload.h
gcc/rtl.h
gcc/sched-deps.c
gcc/sched-int.h
gcc/sched-rgn.c
gcc/var-tracking.c

index 9fbf522c75ae7d73faedeb7750b1b86786065c40..11fba83a063861c45d47ebf458686b0a8bf25e32 100644 (file)
@@ -1,3 +1,40 @@
+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
index fb017326b658961f07e9675ec6dcf6653220d569..8698e45d2b11fdfc3594d296a8de2ef1b917a952 100644 (file)
@@ -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)
index 5e07880a10bc5ee8718616c79399f2e3a08ef1d1..78556be43b5f0ea0210d358a1d45531d3260cb42 100644 (file)
@@ -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;
index b83f8f89ee3c3c2f3601e87b8d7a531bbb38eb27..eb3fd47d0d427c774bbfe7962cf6b2ecb5c6f3dd 100644 (file)
@@ -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;
index ea9081f6471edea96921ea15a226f66ac0d2d05d..80ceae2b3d83dbe0613df05e656c48962a201013 100644 (file)
@@ -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.  */
index b086b3c895274c4a0ae2c7e9177bff27418c35ed..4dcbe8625d09b09fb5f1abb700660e48fca5b6b3 100644 (file)
--- 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 */
index fb1b658b60ce76e1b307bc4c3298a892875f2491..cbc1814bcec3f39bbee44f0894e7f29b3e26d038 100644 (file)
@@ -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)
index f8e5e74a44f30861795c33ebfb6eec84e06a45b8..a19d776a9510c2e459296342c30b0c9487c35d66 100644 (file)
@@ -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;
index 92a8a27ea84bbe296b911689cd6acc109aae1308..93bebc9e014642f8f902ab289c20766bd2c89058 100644 (file)
@@ -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;
index b3bda998f87a2177724a76b4678ef97b94ca5baa..931a7f06fec4c23860e60e6a52b0debb438c9d7c 100644 (file)
@@ -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);