df.h (FOR_EACH_INSN_INFO_MW): New macro.
authorRichard Sandiford <rdsandiford@googlemail.com>
Sun, 15 Jun 2014 07:32:54 +0000 (07:32 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 15 Jun 2014 07:32:54 +0000 (07:32 +0000)
gcc/
* df.h (FOR_EACH_INSN_INFO_MW): New macro.
* df-problems.c (df_note_bb_compute): Use it.
* regstat.c (regstat_bb_compute_ri): Likewise.

From-SVN: r211680

gcc/ChangeLog
gcc/df-problems.c
gcc/df.h
gcc/regstat.c

index da8eb373d68c56f8568c7fab1e9af531d5d7717f..2fcde0c8f9b327324a32637f39e4b0c66fb16f6e 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-15  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * df.h (FOR_EACH_INSN_INFO_MW): New macro.
+       * df-problems.c (df_note_bb_compute): Use it.
+       * regstat.c (regstat_bb_compute_ri): Likewise.
+
 2014-06-15  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * df.h (FOR_EACH_ARTIFICIAL_USE, FOR_EACH_ARTIFICIAL_DEF): New macros.
index 2855eb50cc9c2c075a74237a71e2fa5c9367e426..d97e2870aeaacc722871ca274f450e900889abd8 100644 (file)
@@ -3114,7 +3114,7 @@ df_note_bb_compute (unsigned int bb_index,
   FOR_BB_INSNS_REVERSE (bb, insn)
     {
       df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
-      struct df_mw_hardreg **mws_rec;
+      df_mw_hardreg *mw;
       int debug_insn;
 
       if (!INSN_P (insn))
@@ -3137,17 +3137,11 @@ df_note_bb_compute (unsigned int bb_index,
 
          /* We only care about real sets for calls.  Clobbers cannot
             be depended on to really die.  */
-         mws_rec = DF_INSN_INFO_MWS (insn_info);
-         while (*mws_rec)
-           {
-             struct df_mw_hardreg *mws = *mws_rec;
-             if ((DF_MWS_REG_DEF_P (mws))
-                 && !df_ignore_stack_reg (mws->start_regno))
-             df_set_unused_notes_for_mw (insn,
-                                         mws, live, do_not_gen,
+         FOR_EACH_INSN_INFO_MW (mw, insn_info)
+           if ((DF_MWS_REG_DEF_P (mw))
+               && !df_ignore_stack_reg (mw->start_regno))
+             df_set_unused_notes_for_mw (insn, mw, live, do_not_gen,
                                          artificial_uses, &debug);
-             mws_rec++;
-           }
 
          /* All of the defs except the return value are some sort of
             clobber.  This code is for the return.  */
@@ -3168,16 +3162,10 @@ df_note_bb_compute (unsigned int bb_index,
       else
        {
          /* Regular insn.  */
-         mws_rec = DF_INSN_INFO_MWS (insn_info);
-         while (*mws_rec)
-           {
-             struct df_mw_hardreg *mws = *mws_rec;
-             if (DF_MWS_REG_DEF_P (mws))
-               df_set_unused_notes_for_mw (insn,
-                                           mws, live, do_not_gen,
-                                           artificial_uses, &debug);
-             mws_rec++;
-           }
+         FOR_EACH_INSN_INFO_MW (mw, insn_info)
+           if (DF_MWS_REG_DEF_P (mw))
+             df_set_unused_notes_for_mw (insn, mw, live, do_not_gen,
+                                         artificial_uses, &debug);
 
          FOR_EACH_INSN_INFO_DEF (def, insn_info)
            {
@@ -3194,25 +3182,19 @@ df_note_bb_compute (unsigned int bb_index,
        }
 
       /* Process the uses.  */
-      mws_rec = DF_INSN_INFO_MWS (insn_info);
-      while (*mws_rec)
-       {
-         struct df_mw_hardreg *mws = *mws_rec;
-         if (DF_MWS_REG_USE_P (mws)
-             && !df_ignore_stack_reg (mws->start_regno))
-           {
-             bool really_add_notes = debug_insn != 0;
+      FOR_EACH_INSN_INFO_MW (mw, insn_info)
+       if (DF_MWS_REG_USE_P (mw)
+           && !df_ignore_stack_reg (mw->start_regno))
+         {
+           bool really_add_notes = debug_insn != 0;
 
-             df_set_dead_notes_for_mw (insn,
-                                       mws, live, do_not_gen,
-                                       artificial_uses,
-                                       &really_add_notes);
+           df_set_dead_notes_for_mw (insn, mw, live, do_not_gen,
+                                     artificial_uses,
+                                     &really_add_notes);
 
-             if (really_add_notes)
-               debug_insn = -1;
-           }
-         mws_rec++;
-       }
+           if (really_add_notes)
+             debug_insn = -1;
+         }
 
       FOR_EACH_INSN_INFO_USE (use, insn_info)
        {
index 482ac930c9c274dbdfb651a6e596f90799e8d7b9..9ec8ae1fd5d2beeea99dc939c0b6f4ece835b2db 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -766,6 +766,10 @@ struct df_d
   for (df_ref *ITER##_ = DF_INSN_INFO_EQ_USES (INSN); (ITER = *ITER##_); \
        ++ITER##_)
 
+#define FOR_EACH_INSN_INFO_MW(ITER, INSN) \
+  for (df_mw_hardreg **ITER##_ = DF_INSN_INFO_MWS (INSN); (ITER = *ITER##_); \
+       ++ITER##_)
+
 #define FOR_EACH_INSN_DEF(ITER, INSN) \
   FOR_EACH_INSN_INFO_DEF(ITER, DF_INSN_INFO_GET (INSN))
 
index 10135b3022c2fe5906b24040992ba1a784a56a47..9dff2680c46b32db05e8db44cefd73201637494b 100644 (file)
@@ -153,7 +153,7 @@ regstat_bb_compute_ri (unsigned int bb_index,
     {
       struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
       bitmap_iterator bi;
-      struct df_mw_hardreg **mws_rec;
+      df_mw_hardreg *mw;
       rtx link;
 
       if (!NONDEBUG_INSN_P (insn))
@@ -202,29 +202,26 @@ regstat_bb_compute_ri (unsigned int bb_index,
       /* We only care about real sets for calls.  Clobbers cannot
         be depended on.
         Only do this if the value is totally dead.  */
-      for (mws_rec = DF_INSN_INFO_MWS (insn_info); *mws_rec; mws_rec++)
-       {
-         struct df_mw_hardreg *mws = *mws_rec;
-         if (DF_MWS_REG_DEF_P (mws))
-           {
-             bool all_dead = true;
-             unsigned int r;
-
-             for (r = mws->start_regno; r <= mws->end_regno; r++)
-               if (bitmap_bit_p (artificial_uses, r)
-                   || bitmap_bit_p (live, r))
-                 {
-                   all_dead = false;
-                   break;
-                 }
-
-             if (all_dead)
+      FOR_EACH_INSN_INFO_MW (mw, insn_info)
+       if (DF_MWS_REG_DEF_P (mw))
+         {
+           bool all_dead = true;
+           unsigned int r;
+
+           for (r = mw->start_regno; r <= mw->end_regno; r++)
+             if (bitmap_bit_p (artificial_uses, r)
+                 || bitmap_bit_p (live, r))
                {
-                 regno = mws->start_regno;
-                 REG_LIVE_LENGTH (regno)++;
+                 all_dead = false;
+                 break;
                }
-           }
-       }
+
+           if (all_dead)
+             {
+               regno = mw->start_regno;
+               REG_LIVE_LENGTH (regno)++;
+             }
+         }
 
       /* All of the defs except the return value are some sort of
         clobber.  This code is for the return.  */