remove more ifdefs for HAVE_cc0
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>
Wed, 22 Apr 2015 00:45:06 +0000 (00:45 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Wed, 22 Apr 2015 00:45:06 +0000 (00:45 +0000)
gcc/ChangeLog:

2015-04-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* caller-save.c (insert_one_insn): Remove ifdef HAVE_cc0.
* cfgcleanup.c (flow_find_cross_jump): Likewise.
(flow_find_head_matching_sequence): Likewise.
(try_head_merge_bb): Likewise.
* combine.c (can_combine_p): Likewise.
(try_combine): Likewise.
(distribute_notes): Likewise.
* df-problems.c (can_move_insns_across): Likewise.
* final.c (final): Likewise.
* gcse.c (insert_insn_end_basic_block): Likewise.
* ira.c (find_moveable_pseudos): Likewise.
* reorg.c (try_merge_delay_insns): Likewise.
(fill_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
* sched-deps.c (sched_analyze_2): Likewise.

From-SVN: r222302

gcc/ChangeLog
gcc/caller-save.c
gcc/cfgcleanup.c
gcc/combine.c
gcc/df-problems.c
gcc/final.c
gcc/gcse.c
gcc/ira.c
gcc/reorg.c
gcc/sched-deps.c

index 93384b72af2cf1ebeff6836c37473ceb768d7af2..541a3d39ee4b853a15868a1e4345b26128a8183f 100644 (file)
@@ -1,3 +1,21 @@
+2015-04-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * caller-save.c (insert_one_insn): Remove ifdef HAVE_cc0.
+       * cfgcleanup.c (flow_find_cross_jump): Likewise.
+       (flow_find_head_matching_sequence): Likewise.
+       (try_head_merge_bb): Likewise.
+       * combine.c (can_combine_p): Likewise.
+       (try_combine): Likewise.
+       (distribute_notes): Likewise.
+       * df-problems.c (can_move_insns_across): Likewise.
+       * final.c (final): Likewise.
+       * gcse.c (insert_insn_end_basic_block): Likewise.
+       * ira.c (find_moveable_pseudos): Likewise.
+       * reorg.c (try_merge_delay_insns): Likewise.
+       (fill_simple_delay_slots): Likewise.
+       (fill_slots_from_thread): Likewise.
+       * sched-deps.c (sched_analyze_2): Likewise.
+
 2015-04-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
        * df-scan.c (df_get_entry_block_def_set): Remove #ifdef
index fc575ebb724b06f9a7092eb9f627561d3d1b5368..76c3a7e5263e694ccd5d00b4ef6ad7c5c58847c6 100644 (file)
@@ -1400,18 +1400,16 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
   rtx_insn *insn = chain->insn;
   struct insn_chain *new_chain;
 
-#if HAVE_cc0
   /* If INSN references CC0, put our insns in front of the insn that sets
      CC0.  This is always safe, since the only way we could be passed an
      insn that references CC0 is for a restore, and doing a restore earlier
      isn't a problem.  We do, however, assume here that CALL_INSNs don't
      reference CC0.  Guard against non-INSN's like CODE_LABEL.  */
 
-  if ((NONJUMP_INSN_P (insn) || JUMP_P (insn))
+  if (HAVE_cc0 && (NONJUMP_INSN_P (insn) || JUMP_P (insn))
       && before_p
       && reg_referenced_p (cc0_rtx, PATTERN (insn)))
     chain = chain->prev, insn = chain->insn;
-#endif
 
   new_chain = new_insn_chain ();
   if (before_p)
index 17cf023561b453fdd1d7f71e99f28fd069575ffa..477b6da2e81621db4a4ac7e9ec8b397378ecdaea 100644 (file)
@@ -1456,12 +1456,11 @@ flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx_insn **f1,
       i2 = PREV_INSN (i2);
     }
 
-#if HAVE_cc0
   /* Don't allow the insn after a compare to be shared by
      cross-jumping unless the compare is also shared.  */
-  if (ninsns && reg_mentioned_p (cc0_rtx, last1) && ! sets_cc0_p (last1))
+  if (HAVE_cc0 && ninsns && reg_mentioned_p (cc0_rtx, last1)
+      && ! sets_cc0_p (last1))
     last1 = afterlast1, last2 = afterlast2, last_dir = afterlast_dir, ninsns--;
-#endif
 
   /* Include preceding notes and labels in the cross-jump.  One,
      this may bring us to the head of the blocks as requested above.
@@ -1579,12 +1578,11 @@ flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx_insn **f
       i2 = NEXT_INSN (i2);
     }
 
-#if HAVE_cc0
   /* Don't allow a compare to be shared by cross-jumping unless the insn
      after the compare is also shared.  */
-  if (ninsns && reg_mentioned_p (cc0_rtx, last1) && sets_cc0_p (last1))
+  if (HAVE_cc0 && ninsns && reg_mentioned_p (cc0_rtx, last1)
+      && sets_cc0_p (last1))
     last1 = beforelast1, last2 = beforelast2, ninsns--;
-#endif
 
   if (ninsns)
     {
@@ -2370,11 +2368,9 @@ try_head_merge_bb (basic_block bb)
   cond = get_condition (jump, &move_before, true, false);
   if (cond == NULL_RTX)
     {
-#if HAVE_cc0
-      if (reg_mentioned_p (cc0_rtx, jump))
+      if (HAVE_cc0 && reg_mentioned_p (cc0_rtx, jump))
        move_before = prev_nonnote_nondebug_insn (jump);
       else
-#endif
        move_before = jump;
     }
 
@@ -2539,11 +2535,9 @@ try_head_merge_bb (basic_block bb)
       cond = get_condition (jump, &move_before, true, false);
       if (cond == NULL_RTX)
        {
-#if HAVE_cc0
-         if (reg_mentioned_p (cc0_rtx, jump))
+         if (HAVE_cc0 && reg_mentioned_p (cc0_rtx, jump))
            move_before = prev_nonnote_nondebug_insn (jump);
          else
-#endif
            move_before = jump;
        }
     }
@@ -2562,12 +2556,10 @@ try_head_merge_bb (basic_block bb)
          /* Try again, using a different insertion point.  */
          move_before = jump;
 
-#if HAVE_cc0
          /* Don't try moving before a cc0 user, as that may invalidate
             the cc0.  */
-         if (reg_mentioned_p (cc0_rtx, jump))
+         if (HAVE_cc0 && reg_mentioned_p (cc0_rtx, jump))
            break;
-#endif
 
          continue;
        }
@@ -2622,12 +2614,10 @@ try_head_merge_bb (basic_block bb)
          /* For the unmerged insns, try a different insertion point.  */
          move_before = jump;
 
-#if HAVE_cc0
          /* Don't try moving before a cc0 user, as that may invalidate
             the cc0.  */
-         if (reg_mentioned_p (cc0_rtx, jump))
+         if (HAVE_cc0 && reg_mentioned_p (cc0_rtx, jump))
            break;
-#endif
 
          for (ix = 0; ix < nedges; ix++)
            currptr[ix] = headptr[ix] = nextptr[ix];
index d71f863934345b19dd41482b5ac77477168c9157..6f0007af24e1f8bb0f3ec06fec5fd9c168543afc 100644 (file)
@@ -2066,7 +2066,6 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
       return 0;
 #endif
 
-#if HAVE_cc0
   /* Don't combine an insn that follows a CC0-setting insn.
      An insn that uses CC0 must not be separated from the one that sets it.
      We do, however, allow I2 to follow a CC0-setting insn if that insn
@@ -2076,11 +2075,13 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
      It would be more logical to test whether CC0 occurs inside I1 or I2,
      but that would be much slower, and this ought to be equivalent.  */
 
-  p = prev_nonnote_insn (insn);
-  if (p && p != pred && NONJUMP_INSN_P (p) && sets_cc0_p (PATTERN (p))
-      && ! all_adjacent)
-    return 0;
-#endif
+  if (HAVE_cc0)
+    {
+      p = prev_nonnote_insn (insn);
+      if (p && p != pred && NONJUMP_INSN_P (p) && sets_cc0_p (PATTERN (p))
+         && ! all_adjacent)
+       return 0;
+    }
 
   /* If we get here, we have passed all the tests and the combination is
      to be allowed.  */
@@ -3114,7 +3115,6 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
 
   subst_insn = i3;
 
-#if !HAVE_cc0
   /* Many machines that don't use CC0 have insns that can both perform an
      arithmetic operation and set the condition code.  These operations will
      be represented as a PARALLEL with the first element of the vector
@@ -3126,7 +3126,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
      needed, and make the PARALLEL by just replacing I2DEST in I3SRC with
      I2SRC.  Later we will make the PARALLEL that contains I2.  */
 
-  if (i1 == 0 && added_sets_2 && GET_CODE (PATTERN (i3)) == SET
+  if (!HAVE_cc0 && i1 == 0 && added_sets_2 && GET_CODE (PATTERN (i3)) == SET
       && GET_CODE (SET_SRC (PATTERN (i3))) == COMPARE
       && CONST_INT_P (XEXP (SET_SRC (PATTERN (i3)), 1))
       && rtx_equal_p (XEXP (SET_SRC (PATTERN (i3)), 0), i2dest))
@@ -3216,7 +3216,6 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
          i2_is_used = 1;
        }
     }
-#endif
 
   if (i2_is_used == 0)
     {
@@ -3644,9 +3643,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
         are set between I2 and I3.  */
       if (insn_code_number < 0
           && (split = find_split_point (&newpat, i3, false)) != 0
-#if HAVE_cc0
-         && REG_P (i2dest)
-#endif
+         && (!HAVE_cc0 || REG_P (i2dest))
          /* We need I2DEST in the proper mode.  If it is a hard register
             or the only use of a pseudo, we can change its mode.
             Make sure we don't change a hard register to have a mode that
@@ -3916,9 +3913,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
          && !(GET_CODE (SET_DEST (set1)) == SUBREG
               && find_reg_note (i2, REG_DEAD,
                                 SUBREG_REG (SET_DEST (set1))))
-#if HAVE_cc0
-         && !reg_referenced_p (cc0_rtx, set0)
-#endif
+         && (!HAVE_cc0 || !reg_referenced_p (cc0_rtx, set0))
          /* If I3 is a jump, ensure that set0 is a jump so that
             we do not create invalid RTL.  */
          && (!JUMP_P (i3) || SET_DEST (set0) == pc_rtx)
@@ -3933,9 +3928,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
               && !(GET_CODE (SET_DEST (set0)) == SUBREG
                    && find_reg_note (i2, REG_DEAD,
                                      SUBREG_REG (SET_DEST (set0))))
-#if HAVE_cc0
-              && !reg_referenced_p (cc0_rtx, set1)
-#endif
+              && (!HAVE_cc0 || !reg_referenced_p (cc0_rtx, set1))
               /* If I3 is a jump, ensure that set1 is a jump so that
                  we do not create invalid RTL.  */
               && (!JUMP_P (i3) || SET_DEST (set1) == pc_rtx)
@@ -4000,19 +3993,18 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
        }
     }
 
-#if HAVE_cc0
   /* If I2 is the CC0 setter and I3 is the CC0 user then check whether
      they are adjacent to each other or not.  */
-  {
-    rtx_insn *p = prev_nonnote_insn (i3);
-    if (p && p != i2 && NONJUMP_INSN_P (p) && newi2pat
-       && sets_cc0_p (newi2pat))
-      {
-       undo_all ();
-       return 0;
-      }
-  }
-#endif
+  if (HAVE_cc0)
+    {
+      rtx_insn *p = prev_nonnote_insn (i3);
+      if (p && p != i2 && NONJUMP_INSN_P (p) && newi2pat
+         && sets_cc0_p (newi2pat))
+       {
+         undo_all ();
+         return 0;
+       }
+    }
 
   /* Only allow this combination if insn_rtx_costs reports that the
      replacement instructions are cheaper than the originals.  */
@@ -13796,9 +13788,7 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
                    {
                      rtx set = single_set (tem_insn);
                      rtx inner_dest = 0;
-#if HAVE_cc0
                      rtx_insn *cc0_setter = NULL;
-#endif
 
                      if (set != 0)
                        for (inner_dest = SET_DEST (set);
@@ -13842,7 +13832,6 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
                          if (tem_insn == i2)
                            i2 = NULL;
 
-#if HAVE_cc0
                          /* Delete the setter too.  */
                          if (cc0_setter)
                            {
@@ -13859,7 +13848,6 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
                              if (cc0_setter == i2)
                                i2 = NULL;
                            }
-#endif
                        }
                      else
                        {
index 22fcfa6f6e06bb20fecb40e69ab6d2e51db2f534..d3d06eedc7c2ea91da6b9683f30b30d751625041 100644 (file)
@@ -3859,10 +3859,7 @@ can_move_insns_across (rtx_insn *from, rtx_insn *to,
       if (NONDEBUG_INSN_P (insn))
        {
          if (!bitmap_intersect_p (test_set, local_merge_live)
-#if HAVE_cc0
-             && !sets_cc0_p (insn)
-#endif
-             )
+             && (!HAVE_cc0 || !sets_cc0_p (insn)))
            {
              max_to = insn;
              break;
index dc7126ef212935661939c57f096706c106daee2f..231cfe56249ee89456f0dc59f1447b5efc67857e 100644 (file)
@@ -2029,21 +2029,20 @@ final (rtx_insn *first, FILE *file, int optimize_p)
 
   last_ignored_compare = 0;
 
-#if HAVE_cc0
-  for (insn = first; insn; insn = NEXT_INSN (insn))
-    {
-      /* If CC tracking across branches is enabled, record the insn which
-        jumps to each branch only reached from one place.  */
-      if (optimize_p && JUMP_P (insn))
-       {
-         rtx lab = JUMP_LABEL (insn);
-         if (lab && LABEL_P (lab) && LABEL_NUSES (lab) == 1)
-           {
-             LABEL_REFS (lab) = insn;
-           }
-       }
-    }
-#endif
+  if (HAVE_cc0)
+    for (insn = first; insn; insn = NEXT_INSN (insn))
+      {
+       /* If CC tracking across branches is enabled, record the insn which
+          jumps to each branch only reached from one place.  */
+       if (optimize_p && JUMP_P (insn))
+         {
+           rtx lab = JUMP_LABEL (insn);
+           if (lab && LABEL_P (lab) && LABEL_NUSES (lab) == 1)
+             {
+               LABEL_REFS (lab) = insn;
+             }
+         }
+      }
 
   init_recog ();
 
index 151da065a0dd9d10d70ced8111efa6b355bf3366..e4303fea10aeb8a3421c409ae8ebf67b8fb5c036 100644 (file)
@@ -2048,21 +2048,23 @@ insert_insn_end_basic_block (struct gcse_expr *expr, basic_block bb)
          && (!single_succ_p (bb)
              || single_succ_edge (bb)->flags & EDGE_ABNORMAL)))
     {
-#if HAVE_cc0
       /* FIXME: 'twould be nice to call prev_cc0_setter here but it aborts
         if cc0 isn't set.  */
-      rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
-      if (note)
-       insn = safe_as_a <rtx_insn *> (XEXP (note, 0));
-      else
+      if (HAVE_cc0)
        {
-         rtx_insn *maybe_cc0_setter = prev_nonnote_insn (insn);
-         if (maybe_cc0_setter
-             && INSN_P (maybe_cc0_setter)
-             && sets_cc0_p (PATTERN (maybe_cc0_setter)))
-           insn = maybe_cc0_setter;
+         rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
+         if (note)
+           insn = safe_as_a <rtx_insn *> (XEXP (note, 0));
+         else
+           {
+             rtx_insn *maybe_cc0_setter = prev_nonnote_insn (insn);
+             if (maybe_cc0_setter
+                 && INSN_P (maybe_cc0_setter)
+                 && sets_cc0_p (PATTERN (maybe_cc0_setter)))
+               insn = maybe_cc0_setter;
+           }
        }
-#endif
+
       /* FIXME: What if something in cc0/jump uses value set in new insn?  */
       new_insn = emit_insn_before_noloc (pat, insn, bb);
     }
index 9dcbc62f1d4b31721fc945e77d927998601279db..25baa90845ac506302422d32aea25dbc81f6051a 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -4724,10 +4724,7 @@ find_moveable_pseudos (void)
            {
              if (bitmap_bit_p (def_bb_moveable, regno)
                  && !control_flow_insn_p (use_insn)
-#if HAVE_cc0
-                 && !sets_cc0_p (use_insn)
-#endif
-                 )
+                 && (!HAVE_cc0 || !sets_cc0_p (use_insn)))
                {
                  if (modified_between_p (DF_REF_REG (use), def_insn, use_insn))
                    {
index 16dfa5e1f2359328cd4d664fabcb9a422fd6066b..45c7201c99e5fa65723be47fe352cf4f28dff23f 100644 (file)
@@ -1364,10 +1364,8 @@ try_merge_delay_insns (rtx insn, rtx_insn *thread)
        continue;
 
       if (GET_CODE (next_to_match) == GET_CODE (trial)
-#if HAVE_cc0
          /* We can't share an insn that sets cc0.  */
-         && ! sets_cc0_p (pat)
-#endif
+         && (!HAVE_cc0 || ! sets_cc0_p (pat))
          && ! insn_references_resource_p (trial, &set, true)
          && ! insn_sets_resource_p (trial, &set, true)
          && ! insn_sets_resource_p (trial, &needed, true)
@@ -1437,9 +1435,7 @@ try_merge_delay_insns (rtx insn, rtx_insn *thread)
          if (! insn_references_resource_p (dtrial, &set, true)
              && ! insn_sets_resource_p (dtrial, &set, true)
              && ! insn_sets_resource_p (dtrial, &needed, true)
-#if HAVE_cc0
-             && ! sets_cc0_p (PATTERN (dtrial))
-#endif
+             && (!HAVE_cc0 || ! sets_cc0_p (PATTERN (dtrial)))
              && rtx_equal_p (PATTERN (next_to_match), PATTERN (dtrial))
              /* Check that DTRIAL and NEXT_TO_MATCH does not reference a 
                 resource modified between them (only dtrial is checked because
@@ -2114,10 +2110,8 @@ fill_simple_delay_slots (int non_jumps_p)
                                             filter_flags ? &fset : &set,
                                             true)
                  && ! insn_sets_resource_p (trial, &needed, true)
-#if HAVE_cc0
                  /* Can't separate set of cc0 from its use.  */
-                 && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
-#endif
+                 && (!HAVE_cc0 || ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)))
                  && ! can_throw_internal (trial))
                {
                  trial = try_split (pat, trial, 1);
@@ -2249,9 +2243,7 @@ fill_simple_delay_slots (int non_jumps_p)
                  && ! insn_references_resource_p (trial, &set, true)
                  && ! insn_sets_resource_p (trial, &set, true)
                  && ! insn_sets_resource_p (trial, &needed, true)
-#if HAVE_cc0
-                 && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
-#endif
+                 && (!HAVE_cc0 && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)))
                  && ! (maybe_never && may_trap_or_fault_p (pat))
                  && (trial = try_split (pat, trial, 0))
                  && eligible_for_delay (insn, slots_filled, trial, flags)
@@ -2297,9 +2289,7 @@ fill_simple_delay_slots (int non_jumps_p)
              && ! insn_references_resource_p (next_trial, &set, true)
              && ! insn_sets_resource_p (next_trial, &set, true)
              && ! insn_sets_resource_p (next_trial, &needed, true)
-#if HAVE_cc0
-             && ! reg_mentioned_p (cc0_rtx, PATTERN (next_trial))
-#endif
+             && (!HAVE_cc0 || ! reg_mentioned_p (cc0_rtx, PATTERN (next_trial)))
              && ! (maybe_never && may_trap_or_fault_p (PATTERN (next_trial)))
              && (next_trial = try_split (PATTERN (next_trial), next_trial, 0))
              && eligible_for_delay (insn, slots_filled, next_trial, flags)
@@ -2510,10 +2500,8 @@ fill_slots_from_thread (rtx_insn *insn, rtx condition, rtx thread_or_return,
       if (! insn_references_resource_p (trial, &set, true)
          && ! insn_sets_resource_p (trial, &set, true)
          && ! insn_sets_resource_p (trial, &needed, true)
-#if HAVE_cc0
-         && ! (reg_mentioned_p (cc0_rtx, pat)
-               && (! own_thread || ! sets_cc0_p (pat)))
-#endif
+         && (!HAVE_cc0 || (! (reg_mentioned_p (cc0_rtx, pat)
+                             && (! own_thread || ! sets_cc0_p (pat)))))
          && ! can_throw_internal (trial))
        {
          rtx prior_insn;
index 7d2719fb69ddd81ccc2ee3c61e253124c5065ed0..e62456325e28390d71b610d4dec379ccc71ab31a 100644 (file)
@@ -2609,9 +2609,9 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx_insn *insn)
       return;
 
     case CC0:
-#if !HAVE_cc0
-      gcc_unreachable ();
-#endif
+      if (!HAVE_cc0)
+       gcc_unreachable ();
+
       /* User of CC0 depends on immediately preceding insn.  */
       SCHED_GROUP_P (insn) = 1;
        /* Don't move CC0 setter to another block (it can set up the