]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use rtx_expr_list for expr_status.x_forced_labels
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 27 Aug 2014 20:33:38 +0000 (20:33 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 27 Aug 2014 20:33:38 +0000 (20:33 +0000)
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

* function.h (struct expr_status): Strengthen field
"x_forced_labels" from rtx to rtx_expr_list *.

* cfgbuild.c (make_edges): Split local "x" into two locals,
strengthening one from rtx to rtx_expr_list *, and using methods
of said class.
* dwarf2cfi.c (create_trace_edges): Split local "lab" out; within
loop over forced_labels, introduce strengthen it from rtx to
rtx_expr_list *, using methods to clarify the code.
* jump.c (rebuild_jump_labels_1): Strengthen local "insn" from rtx
to rtx_expr_list *, using methods of said class to clarify the
code.
* reload1.c (set_initial_label_offsets): Split local "x" into two
per-loop variables, strengthening the first from rtx to
rtx_expr_list * and using methods.

From-SVN: r214602

gcc/ChangeLog
gcc/cfgbuild.c
gcc/dwarf2cfi.c
gcc/function.h
gcc/jump.c
gcc/reload1.c

index dbdae273604c896d4518da500f4819e9654b56e5..e85db1a6797197646592e5104cb3c5a30e5ec0b3 100644 (file)
@@ -1,3 +1,21 @@
+2014-08-27  David Malcolm  <dmalcolm@redhat.com>
+
+       * function.h (struct expr_status): Strengthen field
+       "x_forced_labels" from rtx to rtx_expr_list *.
+
+       * cfgbuild.c (make_edges): Split local "x" into two locals,
+       strengthening one from rtx to rtx_expr_list *, and using methods
+       of said class.
+       * dwarf2cfi.c (create_trace_edges): Split local "lab" out; within
+       loop over forced_labels, introduce strengthen it from rtx to
+       rtx_expr_list *, using methods to clarify the code.
+       * jump.c (rebuild_jump_labels_1): Strengthen local "insn" from rtx
+       to rtx_expr_list *, using methods of said class to clarify the
+       code.
+       * reload1.c (set_initial_label_offsets): Split local "x" into two
+       per-loop variables, strengthening the first from rtx to
+       rtx_expr_list * and using methods.
+
 2014-08-27  David Malcolm  <dmalcolm@redhat.com>
 
        * coretypes.h (class rtx_expr_list): Add forward declaration.
index dd6ed7a00e126d4d34dc5e005a25116f346dfb7a..05adac0cbc4d1b1df26d3467a7436093882e6ce2 100644 (file)
@@ -219,7 +219,6 @@ make_edges (basic_block min, basic_block max, int update_p)
   FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
     {
       rtx_insn *insn;
-      rtx x;
       enum rtx_code code;
       edge e;
       edge_iterator ei;
@@ -285,8 +284,8 @@ make_edges (basic_block min, basic_block max, int update_p)
             everything on the forced_labels list.  */
          else if (computed_jump_p (insn))
            {
-             for (x = forced_labels; x; x = XEXP (x, 1))
-               make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
+             for (rtx_expr_list *x = forced_labels; x; x = x->next ())
+               make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL);
            }
 
          /* Returns create an exit out.  */
@@ -338,7 +337,7 @@ make_edges (basic_block min, basic_block max, int update_p)
                     taken, then only calls to those functions or to other
                     nested functions that use them could possibly do
                     nonlocal gotos.  */
-                 for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+                 for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
                    make_label_edge (edge_cache, bb, XEXP (x, 0),
                                     EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
                }
index 25571fa7bcd584ff35af7b7b1ecc6267046c2db7..3f4a0ad6d5c10173c024051f6ec390a77efb29a8 100644 (file)
@@ -2286,7 +2286,7 @@ maybe_record_trace_start_abnormal (rtx start, rtx origin)
 static void
 create_trace_edges (rtx insn)
 {
-  rtx tmp, lab;
+  rtx tmp;
   int i, n;
 
   if (JUMP_P (insn))
@@ -2303,14 +2303,14 @@ create_trace_edges (rtx insn)
          n = GET_NUM_ELEM (vec);
          for (i = 0; i < n; ++i)
            {
-             lab = XEXP (RTVEC_ELT (vec, i), 0);
+             rtx lab = XEXP (RTVEC_ELT (vec, i), 0);
              maybe_record_trace_start (lab, insn);
            }
        }
       else if (computed_jump_p (insn))
        {
-         for (lab = forced_labels; lab; lab = XEXP (lab, 1))
-           maybe_record_trace_start (XEXP (lab, 0), insn);
+         for (rtx_expr_list *lab = forced_labels; lab; lab = lab->next ())
+           maybe_record_trace_start (lab->element (), insn);
        }
       else if (returnjump_p (insn))
        ;
@@ -2319,13 +2319,13 @@ create_trace_edges (rtx insn)
          n = ASM_OPERANDS_LABEL_LENGTH (tmp);
          for (i = 0; i < n; ++i)
            {
-             lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
+             rtx lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
              maybe_record_trace_start (lab, insn);
            }
        }
       else
        {
-         lab = JUMP_LABEL (insn);
+         rtx lab = JUMP_LABEL (insn);
          gcc_assert (lab != NULL);
          maybe_record_trace_start (lab, insn);
        }
@@ -2338,7 +2338,7 @@ create_trace_edges (rtx insn)
 
       /* Process non-local goto edges.  */
       if (can_nonlocal_goto (insn))
-       for (lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
+       for (rtx lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
          maybe_record_trace_start_abnormal (XEXP (lab, 0), insn);
     }
   else if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
index 28a20f34b98914c755103826b5de546f388bd227..ba7597c2bdc3ad3f6705c779417fc907ee4e0766 100644 (file)
@@ -135,7 +135,7 @@ struct GTY(()) expr_status {
   rtx x_apply_args_value;
 
   /* List of labels that must never be deleted.  */
-  rtx x_forced_labels;
+  rtx_expr_list *x_forced_labels;
 };
 
 typedef struct call_site_record_d *call_site_record;
index a28300c2d7375573a0cb8c61a1c1bc859c7a79ce..b8d3d52cea9f3c2202cac27bed01d5e126e50ce2 100644 (file)
@@ -74,7 +74,7 @@ static int returnjump_p_1 (rtx *, void *);
 static void
 rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
 {
-  rtx insn;
+  rtx_expr_list *insn;
 
   timevar_push (TV_REBUILD_JUMP);
   init_label_info (f);
@@ -85,9 +85,9 @@ rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
      count doesn't drop to zero.  */
 
   if (count_forced)
-    for (insn = forced_labels; insn; insn = XEXP (insn, 1))
-      if (LABEL_P (XEXP (insn, 0)))
-       LABEL_NUSES (XEXP (insn, 0))++;
+    for (insn = forced_labels; insn; insn = insn->next ())
+      if (LABEL_P (insn->element ()))
+       LABEL_NUSES (insn->element ())++;
   timevar_pop (TV_REBUILD_JUMP);
 }
 
index 2bb8005329ba5a5a7f56f4c06fba6f67f2302972..f7acd65f87ac762bf771ac60803af8b3cb23813d 100644 (file)
@@ -3909,14 +3909,13 @@ set_initial_eh_label_offset (rtx label)
 static void
 set_initial_label_offsets (void)
 {
-  rtx x;
   memset (offsets_known_at, 0, num_labels);
 
-  for (x = forced_labels; x; x = XEXP (x, 1))
-    if (XEXP (x, 0))
-      set_label_offsets (XEXP (x, 0), NULL, 1);
+  for (rtx_expr_list *x = forced_labels; x; x = x->next ())
+    if (x->element ())
+      set_label_offsets (x->element (), NULL, 1);
 
-  for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+  for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
     if (XEXP (x, 0))
       set_label_offsets (XEXP (x, 0), NULL, 1);