public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/segher/heads/cc0)] delete CC0 rtl code
@ 2020-02-04 21:55 Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2020-02-04 21:55 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a3a6cafe0162e8b1bb8efe11a46548a9d19db0eb

commit a3a6cafe0162e8b1bb8efe11a46548a9d19db0eb
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Sun Sep 22 05:54:05 2019 +0000

    delete CC0 rtl code

Diff:
---
 gcc/caller-save.c      |  2 +-
 gcc/combine.c          | 23 ++++++++---------------
 gcc/cse.c              | 32 --------------------------------
 gcc/cselib.c           |  2 --
 gcc/df-scan.c          |  2 --
 gcc/emit-rtl.c         |  4 ----
 gcc/gcse-common.c      |  1 -
 gcc/gcse.c             |  1 -
 gcc/genattrtab.c       |  1 -
 gcc/genconfig.c        |  5 -----
 gcc/genemit.c          |  3 ---
 gcc/genextract.c       |  1 -
 gcc/genrecog.c         |  6 ++----
 gcc/ira-costs.c        |  1 -
 gcc/ira.c              |  5 -----
 gcc/jump.c             |  2 --
 gcc/loop-invariant.c   |  1 -
 gcc/lra-eliminations.c |  1 -
 gcc/postreload-gcse.c  |  1 -
 gcc/print-rtl.c        |  1 -
 gcc/reginfo.c          |  1 -
 gcc/regrename.c        |  1 -
 gcc/reload.c           |  4 +---
 gcc/reload1.c          |  3 ---
 gcc/resource.c         |  9 ---------
 gcc/rtl.c              |  2 --
 gcc/rtl.def            |  9 +--------
 gcc/rtlanal.c          | 16 +++-------------
 gcc/sched-deps.c       | 15 ---------------
 gcc/simplify-rtx.c     | 15 ++++++---------
 gcc/valtrack.c         |  1 -
 gcc/var-tracking.c     |  2 --
 32 files changed, 22 insertions(+), 151 deletions(-)

diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index b7c8bd3..f36f107 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1012,7 +1012,7 @@ mark_referenced_regs (rtx *loc, refmarker_fn *mark, void *arg)
       loc = &SET_DEST (*loc);
       code = GET_CODE (*loc);
       if ((code == REG && REGNO (*loc) < FIRST_PSEUDO_REGISTER)
-	  || code == PC || code == CC0
+	  || code == PC
 	  || (code == SUBREG && REG_P (SUBREG_REG (*loc))
 	      && REGNO (SUBREG_REG (*loc)) < FIRST_PSEUDO_REGISTER
 	      /* If we're setting only part of a multi-word register,
diff --git a/gcc/combine.c b/gcc/combine.c
index ef6f8e7..f45f579 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -574,12 +574,11 @@ find_single_use_1 (rtx dest, rtx *loc)
       return 0;
 
     case SET:
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn uses DEST if
 	 it is mentioned in the destination or the source.  Otherwise, we
 	 need just check the source.  */
-      if (GET_CODE (SET_DEST (x)) != CC0
-	  && GET_CODE (SET_DEST (x)) != PC
+      if (GET_CODE (SET_DEST (x)) != PC
 	  && !REG_P (SET_DEST (x))
 	  && ! (GET_CODE (SET_DEST (x)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (x)))
@@ -2004,7 +2003,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
 						  GET_MODE (src)))))
 	return 0;
     }
-  else if (GET_CODE (dest) != CC0)
+  else
     return 0;
 
 
@@ -5447,9 +5446,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
 	{
 	  rtx dest = SET_DEST (XVECEXP (x, 0, i));
 
-	  if (!REG_P (dest)
-	      && GET_CODE (dest) != CC0
-	      && GET_CODE (dest) != PC)
+	  if (!REG_P (dest) && GET_CODE (dest) != PC)
 	    {
 	      new_rtx = subst (dest, from, to, 0, 0, unique_copy);
 
@@ -5467,13 +5464,12 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
       len = GET_RTX_LENGTH (code);
       fmt = GET_RTX_FORMAT (code);
 
-      /* We don't need to process a SET_DEST that is a register, CC0,
-	 or PC, so set up to skip this common case.  All other cases
-	 where we want to suppress replacing something inside a
-	 SET_SRC are handled via the IN_DEST operand.  */
+      /* We don't need to process a SET_DEST that is a register or PC, so
+	 set up to skip this common case.  All other cases where we want
+	 to suppress replacing something inside a SET_SRC are handled via
+	 the IN_DEST operand.  */
       if (code == SET
 	  && (REG_P (SET_DEST (x))
-	      || GET_CODE (SET_DEST (x)) == CC0
 	      || GET_CODE (SET_DEST (x)) == PC))
 	fmt = "ie";
 
@@ -13842,9 +13838,6 @@ mark_used_regs_combine (rtx x)
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     case ASM_INPUT:
-    /* CC0 must die in the insn after it is set, so we don't need to take
-       special note of it here.  */
-    case CC0:
       return;
 
     case CLOBBER:
diff --git a/gcc/cse.c b/gcc/cse.c
index d848c00..051ce57 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2449,7 +2449,6 @@ hash_rtx_cb (const_rtx x, machine_mode mode,
     case PRE_MODIFY:
     case POST_MODIFY:
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       if (do_not_record_p) {
@@ -2634,7 +2633,6 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
   switch (code)
     {
     case PC:
-    case CC0:
     CASE_CONST_UNIQUE:
       return x == y;
 
@@ -2849,7 +2847,6 @@ canon_reg (rtx x, rtx_insn *insn)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
@@ -3175,9 +3172,6 @@ fold_rtx (rtx x, rtx_insn *insn)
     case EXPR_LIST:
       return x;
 
-    case CC0:
-      return prev_insn_cc0;
-
     case ASM_OPERANDS:
       if (insn)
 	{
@@ -3228,30 +3222,6 @@ fold_rtx (rtx x, rtx_insn *insn)
 	    const_arg = folded_arg;
 	    break;
 
-	  case CC0:
-	    /* The cc0-user and cc0-setter may be in different blocks if
-	       the cc0-setter potentially traps.  In that case PREV_INSN_CC0
-	       will have been cleared as we exited the block with the
-	       setter.
-
-	       While we could potentially track cc0 in this case, it just
-	       doesn't seem to be worth it given that cc0 targets are not
-	       terribly common or important these days and trapping math
-	       is rarely used.  The combination of those two conditions
-	       necessary to trip this situation is exceedingly rare in the
-	       real world.  */
-	    if (!prev_insn_cc0)
-	      {
-		const_arg = NULL_RTX;
-	      }
-	    else
-	      {
-		folded_arg = prev_insn_cc0;
-		mode_arg = prev_insn_cc0_mode;
-		const_arg = equiv_constant (folded_arg);
-	      }
-	    break;
-
 	  default:
 	    folded_arg = fold_rtx (folded_arg, insn);
 	    const_arg = equiv_constant (folded_arg);
@@ -6208,7 +6178,6 @@ cse_process_notes_1 (rtx x, rtx object, bool *changed)
     case LABEL_REF:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case LO_SUM:
       return x;
 
@@ -6809,7 +6778,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
       return;
 
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 3e0c69d..8e901f6 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1226,7 +1226,6 @@ cselib_hash_rtx (rtx x, int create, machine_mode memmode)
       return cselib_hash_rtx (XEXP (x, 0), create, memmode);
 
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       return 0;
@@ -1656,7 +1655,6 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return orig;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 93b060f..f32d1f7 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2816,7 +2816,6 @@ df_uses_record (class df_collection_rec *collection_rec,
     case CONST:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
       return;
@@ -2902,7 +2901,6 @@ df_uses_record (class df_collection_rec *collection_rec,
 	    case PARALLEL:
 	    case SCRATCH:
 	    case PC:
-	    case CC0:
 		break;
 	    case MEM:
 	      df_uses_record (collection_rec, &XEXP (dst, 0),
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index f7617469..efa2634 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2889,7 +2889,6 @@ verify_rtx_sharing (rtx orig, rtx insn)
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3142,7 +3141,6 @@ repeat:
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3265,7 +3263,6 @@ repeat:
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return;
@@ -5714,7 +5711,6 @@ copy_insn_1 (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return orig;
diff --git a/gcc/gcse-common.c b/gcc/gcse-common.c
index 323ff85..812e236 100644
--- a/gcc/gcse-common.c
+++ b/gcc/gcse-common.c
@@ -186,7 +186,6 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap,
       goto repeat;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 1f1e5a5..927b928 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -926,7 +926,6 @@ oprs_unchanged_p (const_rtx x, const rtx_insn *insn, int avail_p)
       return 0;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 6166c75..730484c 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -3011,7 +3011,6 @@ clear_struct_flag (rtx x)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case EQ_ATTR:
     case ATTR_FLAG:
       return;
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index b1abebf..7f8e7fc 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -105,11 +105,6 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
 	max_recog_operands = XINT (part, 0);
       return;
 
-    case CC0:
-      if (recog_p)
-	have_cc0_flag = 1;
-      return;
-
     case LO_SUM:
       if (recog_p)
 	have_lo_sum_flag = 1;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 84d07d3..b327821 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -169,9 +169,6 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info)
 	  return;
 	}
       break;
-    case CC0:
-      printf ("cc0_rtx");
-      return;
 
     case CONST_INT:
       if (INTVAL (x) == 0)
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 63911e7..220c4ad 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -237,7 +237,6 @@ walk_rtx (md_rtx_info *info, rtx x, class accum_extract *acc)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST_INT:
     case SYMBOL_REF:
       return;
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index bc371b1..2445f4a 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -694,13 +694,11 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
 	  error_at (info->loc, "mode mismatch in set: %smode vs %smode",
 		    GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
 
-	/* If only one of the operands is VOIDmode, and PC or CC0 is
-	   not involved, it's probably a mistake.  */
+	/* If only one of the operands is VOIDmode, and PC is not involved,
+	   it's probably a mistake.  */
 	else if (dmode != smode
 		 && GET_CODE (dest) != PC
-		 && GET_CODE (dest) != CC0
 		 && GET_CODE (src) != PC
-		 && GET_CODE (src) != CC0
 		 && !CONST_INT_P (src)
 		 && !CONST_WIDE_INT_P (src)
 		 && GET_CODE (src) != CALL)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index d9e7105..a3a7f13 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1103,7 +1103,6 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x,
     {
     case CONST_INT:
     case CONST:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/ira.c b/gcc/ira.c
index bee0654..bf39101 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3068,7 +3068,6 @@ equiv_init_movable_p (rtx x, int regno)
     case SET:
       return equiv_init_movable_p (SET_SRC (x), regno);
 
-    case CC0:
     case CLOBBER:
       return 0;
 
@@ -3153,7 +3152,6 @@ memref_referenced_p (rtx memref, rtx x, bool read_p)
     case SYMBOL_REF:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case HIGH:
     case LO_SUM:
       return false;
@@ -4426,9 +4424,6 @@ rtx_moveable_p (rtx *loc, enum op_type type)
     case PC:
       return type == OP_IN;
 
-    case CC0:
-      return false;
-
     case REG:
       if (x == frame_pointer_rtx)
 	return true;
diff --git a/gcc/jump.c b/gcc/jump.c
index b646903..678207d 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1084,7 +1084,6 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target)
   switch (code)
     {
     case PC:
-    case CC0:
     case REG:
     case CLOBBER:
     case CALL:
@@ -1754,7 +1753,6 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
   switch (code)
     {
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     CASE_CONST_UNIQUE:
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 37ae654..9da7b86 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -212,7 +212,6 @@ check_maybe_invariant (rtx x)
       return true;
 
     case PC:
-    case CC0:
     case UNSPEC_VOLATILE:
     case CALL:
       return false;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index cf745dc..fcef253 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -353,7 +353,6 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 713180f..c11653e 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -549,7 +549,6 @@ oprs_unchanged_p (rtx x, rtx_insn *insn, bool after_insn)
 	return oprs_unchanged_p (XEXP (x, 0), insn, after_insn);
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 653e9c6..3a406ca 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1718,7 +1718,6 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_wide_integer (pp, SUBREG_BYTE (x));
       break;
     case SCRATCH:
-    case CC0:
     case PC:
       pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
       break;
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index e34b74a..9c750f0 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -998,7 +998,6 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn)
     {
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 663935b7..216e52a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1440,7 +1440,6 @@ scan_rtx (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions action,
     CASE_CONST_ANY:
     case SYMBOL_REF:
     case LABEL_REF:
-    case CC0:
     case PC:
       return;
 
diff --git a/gcc/reload.c b/gcc/reload.c
index aa68f7b..8d45081 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5264,7 +5264,6 @@ subst_reg_equivs (rtx ad, rtx_insn *insn)
     case SYMBOL_REF:
     case LABEL_REF:
     case PC:
-    case CC0:
       return ad;
 
     case REG:
@@ -6562,8 +6561,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
     }
   else if (MEM_P (x))
     return refers_to_mem_for_reload_p (in);
-  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
-	   || GET_CODE (x) == CC0)
+  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC)
     return reg_mentioned_p (x, in);
   else
     {
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 2f02c3e..f7f7bec 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2540,7 +2540,6 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -2962,7 +2961,6 @@ elimination_effects (rtx x, machine_mode mem_mode)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -4341,7 +4339,6 @@ scan_paradoxical_subregs (rtx x)
     case SYMBOL_REF:
     case LABEL_REF:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case USE:
     case CLOBBER:
diff --git a/gcc/resource.c b/gcc/resource.c
index d26217c..44754f6 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -245,10 +245,6 @@ mark_referenced_resources (rtx x, struct resources *res,
       mark_referenced_resources (XEXP (x, 0), res, false);
       return;
 
-    case CC0:
-      res->cc = 1;
-      return;
-
     case UNSPEC_VOLATILE:
     case TRAP_IF:
     case ASM_INPUT:
@@ -642,11 +638,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
       /* These don't set any resources.  */
       return;
 
-    case CC0:
-      if (in_dest)
-	res->cc = 1;
-      return;
-
     case CALL_INSN:
       /* Called routine modifies the condition code, memory, any registers
 	 that aren't saved across calls, global registers and anything
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 4d527cf..d51c252 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -295,7 +295,6 @@ copy_rtx (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -388,7 +387,6 @@ shallow_copy_rtx (const_rtx orig MEM_STAT_DECL)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 9754333..64c9529 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -287,7 +287,7 @@ DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
    ---------------------------------------------------------------------- */
 
 /* Assignment.
-   Operand 1 is the location (REG, MEM, PC, CC0 or whatever) assigned to.
+   Operand 1 is the location (REG, MEM, PC or whatever) assigned to.
    Operand 2 is the value stored there.
    ALL assignment must use SET.
    Instructions that do multiple assignments must use multiple SET,
@@ -436,13 +436,6 @@ DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
    This is either a DECL node, or some kind of constant.  */
 DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
 
-/* The condition code register is represented, in our imagination,
-   as a register holding a value that can be compared to zero.
-   In fact, the machine has already compared them and recorded the
-   results; but instructions that look at the condition code
-   pretend to be looking at the entire value and comparing it.  */
-DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
-
 /* ----------------------------------------------------------------------
    Expressions for operators in an rtl pattern
    ---------------------------------------------------------------------- */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 359c2be..a2cbbd4 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -990,7 +990,6 @@ count_occurrences (const_rtx x, const_rtx find, int count_dest)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
       return 0;
 
     case EXPR_LIST:
@@ -1084,7 +1083,6 @@ reg_mentioned_p (const_rtx reg, const_rtx in)
       /* These codes have no constituent expressions
 	 and are unique.  */
     case SCRATCH:
-    case CC0:
     case PC:
       return 0;
 
@@ -1167,11 +1165,10 @@ reg_referenced_p (const_rtx x, const_rtx body)
       if (reg_overlap_mentioned_p (x, SET_SRC (body)))
 	return 1;
 
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn references X if
 	 it is mentioned in the destination.  */
-      if (GET_CODE (SET_DEST (body)) != CC0
-	  && GET_CODE (SET_DEST (body)) != PC
+      if (GET_CODE (SET_DEST (body)) != PC
 	  && !REG_P (SET_DEST (body))
 	  && ! (GET_CODE (SET_DEST (body)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (body)))
@@ -1318,7 +1315,6 @@ modified_between_p (const_rtx x, const rtx_insn *start, const rtx_insn *end)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1373,7 +1369,6 @@ modified_in_p (const_rtx x, const_rtx insn)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1870,7 +1865,6 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
 
     case SCRATCH:
     case PC:
-    case CC0:
       return reg_mentioned_p (x, in);
 
     case PARALLEL:
@@ -1896,7 +1890,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
    ignored by note_stores, but passed to FUN.
 
    FUN receives three arguments:
-   1. the REG, MEM, CC0 or PC being stored in or clobbered,
+   1. the REG, MEM or PC being stored in or clobbered,
    2. the SET or CLOBBER rtx that does the store,
    3. the pointer DATA provided to note_stores.
 
@@ -2609,7 +2603,6 @@ volatile_insn_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2670,7 +2663,6 @@ volatile_refs_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2730,7 +2722,6 @@ side_effects_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2818,7 +2809,6 @@ may_trap_p_1 (const_rtx x, unsigned flags)
     case LABEL_REF:
     case CONST:
     case PC:
-    case CC0:
     case REG:
     case SCRATCH:
       return 0;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 331af5f..f2a7dfb 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2579,21 +2579,6 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn)
 
       return;
 
-    case CC0:
-      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
-        same flag for previous CC0 users which is safe).  */
-      CANT_MOVE (prev_nonnote_insn (insn)) = 1;
-
-      if (cslr_p && sched_deps_info->finish_rhs)
-	sched_deps_info->finish_rhs ();
-
-      return;
-
     case REG:
       {
 	int regno = REGNO (x);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index fe1509d..e60d2eb 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2540,15 +2540,12 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	  rtx xop00 = XEXP (op0, 0);
 	  rtx xop10 = XEXP (op1, 0);
 
-	  if (GET_CODE (xop00) == CC0 && GET_CODE (xop10) == CC0)
-	      return xop00;
-
-	    if (REG_P (xop00) && REG_P (xop10)
-		&& REGNO (xop00) == REGNO (xop10)
-		&& GET_MODE (xop00) == mode
-		&& GET_MODE (xop10) == mode
-		&& GET_MODE_CLASS (mode) == MODE_CC)
-	      return xop00;
+	  if (REG_P (xop00) && REG_P (xop10)
+	      && REGNO (xop00) == REGNO (xop10)
+	      && GET_MODE (xop00) == mode
+	      && GET_MODE (xop10) == mode
+	      && GET_MODE_CLASS (mode) == MODE_CC)
+	    return xop00;
 	}
       break;
 
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 42c5950..f4d10a4 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -68,7 +68,6 @@ cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return x;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 9984565..ba0d44b 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2442,7 +2442,6 @@ unsuitable_loc (rtx loc)
     {
     case PC:
     case SCRATCH:
-    case CC0:
     case ASM_INPUT:
     case ASM_OPERANDS:
       return true;
@@ -5653,7 +5652,6 @@ non_suitable_const (const_rtx x)
 	case DEBUG_EXPR:
 	case PC:
 	case SCRATCH:
-	case CC0:
 	case ASM_INPUT:
 	case ASM_OPERANDS:
 	  return true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/segher/heads/cc0)] delete CC0 rtl code
@ 2020-12-15 17:04 Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2020-12-15 17:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fd2db4bb5cf679ae3f8f212e60b87793242c1ea0

commit fd2db4bb5cf679ae3f8f212e60b87793242c1ea0
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Sun Sep 22 05:54:05 2019 +0000

    delete CC0 rtl code

Diff:
---
 gcc/caller-save.c      |  2 +-
 gcc/combine.c          | 23 ++++++++---------------
 gcc/cse.c              | 31 -------------------------------
 gcc/cselib.c           |  2 --
 gcc/df-scan.c          |  2 --
 gcc/emit-rtl.c         |  4 ----
 gcc/gcse-common.c      |  1 -
 gcc/gcse.c             |  1 -
 gcc/genattrtab.c       |  1 -
 gcc/genconfig.c        |  5 -----
 gcc/genemit.c          |  3 ---
 gcc/genextract.c       |  1 -
 gcc/genrecog.c         |  6 ++----
 gcc/ira-costs.c        |  1 -
 gcc/ira.c              |  5 -----
 gcc/jump.c             |  2 --
 gcc/loop-invariant.c   |  1 -
 gcc/lra-eliminations.c |  1 -
 gcc/postreload-gcse.c  |  1 -
 gcc/print-rtl.c        |  1 -
 gcc/reginfo.c          |  1 -
 gcc/regrename.c        |  1 -
 gcc/reload.c           |  4 +---
 gcc/reload1.c          |  3 ---
 gcc/resource.c         |  9 ---------
 gcc/rtl.c              |  2 --
 gcc/rtl.def            |  9 +--------
 gcc/rtlanal.c          | 16 +++-------------
 gcc/sched-deps.c       | 15 ---------------
 gcc/simplify-rtx.c     | 15 ++++++---------
 gcc/valtrack.c         |  1 -
 gcc/var-tracking.c     |  2 --
 32 files changed, 22 insertions(+), 150 deletions(-)

diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index b7c8bd3f9dd..f36f107339f 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1012,7 +1012,7 @@ mark_referenced_regs (rtx *loc, refmarker_fn *mark, void *arg)
       loc = &SET_DEST (*loc);
       code = GET_CODE (*loc);
       if ((code == REG && REGNO (*loc) < FIRST_PSEUDO_REGISTER)
-	  || code == PC || code == CC0
+	  || code == PC
 	  || (code == SUBREG && REG_P (SUBREG_REG (*loc))
 	      && REGNO (SUBREG_REG (*loc)) < FIRST_PSEUDO_REGISTER
 	      /* If we're setting only part of a multi-word register,
diff --git a/gcc/combine.c b/gcc/combine.c
index 735f4b937b7..d440ef60714 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -574,12 +574,11 @@ find_single_use_1 (rtx dest, rtx *loc)
       return 0;
 
     case SET:
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn uses DEST if
 	 it is mentioned in the destination or the source.  Otherwise, we
 	 need just check the source.  */
-      if (GET_CODE (SET_DEST (x)) != CC0
-	  && GET_CODE (SET_DEST (x)) != PC
+      if (GET_CODE (SET_DEST (x)) != PC
 	  && !REG_P (SET_DEST (x))
 	  && ! (GET_CODE (SET_DEST (x)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (x)))
@@ -2005,7 +2004,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
 						  GET_MODE (src)))))
 	return 0;
     }
-  else if (GET_CODE (dest) != CC0)
+  else
     return 0;
 
 
@@ -5452,9 +5451,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
 	{
 	  rtx dest = SET_DEST (XVECEXP (x, 0, i));
 
-	  if (!REG_P (dest)
-	      && GET_CODE (dest) != CC0
-	      && GET_CODE (dest) != PC)
+	  if (!REG_P (dest) && GET_CODE (dest) != PC)
 	    {
 	      new_rtx = subst (dest, from, to, 0, 0, unique_copy);
 
@@ -5472,13 +5469,12 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
       len = GET_RTX_LENGTH (code);
       fmt = GET_RTX_FORMAT (code);
 
-      /* We don't need to process a SET_DEST that is a register, CC0,
-	 or PC, so set up to skip this common case.  All other cases
-	 where we want to suppress replacing something inside a
-	 SET_SRC are handled via the IN_DEST operand.  */
+      /* We don't need to process a SET_DEST that is a register or PC, so
+	 set up to skip this common case.  All other cases where we want
+	 to suppress replacing something inside a SET_SRC are handled via
+	 the IN_DEST operand.  */
       if (code == SET
 	  && (REG_P (SET_DEST (x))
-	      || GET_CODE (SET_DEST (x)) == CC0
 	      || GET_CODE (SET_DEST (x)) == PC))
 	fmt = "ie";
 
@@ -13871,9 +13867,6 @@ mark_used_regs_combine (rtx x)
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     case ASM_INPUT:
-    /* CC0 must die in the insn after it is set, so we don't need to take
-       special note of it here.  */
-    case CC0:
       return;
 
     case CLOBBER:
diff --git a/gcc/cse.c b/gcc/cse.c
index dcb0801a15a..914fab7a8f7 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2448,7 +2448,6 @@ hash_rtx_cb (const_rtx x, machine_mode mode,
     case PRE_MODIFY:
     case POST_MODIFY:
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       if (do_not_record_p) {
@@ -2633,7 +2632,6 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
   switch (code)
     {
     case PC:
-    case CC0:
     CASE_CONST_UNIQUE:
       return x == y;
 
@@ -2848,7 +2846,6 @@ canon_reg (rtx x, rtx_insn *insn)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
@@ -3174,9 +3171,6 @@ fold_rtx (rtx x, rtx_insn *insn)
     case EXPR_LIST:
       return x;
 
-    case CC0:
-      return prev_insn_cc0;
-
     case ASM_OPERANDS:
       if (insn)
 	{
@@ -3227,30 +3221,6 @@ fold_rtx (rtx x, rtx_insn *insn)
 	    const_arg = folded_arg;
 	    break;
 
-	  case CC0:
-	    /* The cc0-user and cc0-setter may be in different blocks if
-	       the cc0-setter potentially traps.  In that case PREV_INSN_CC0
-	       will have been cleared as we exited the block with the
-	       setter.
-
-	       While we could potentially track cc0 in this case, it just
-	       doesn't seem to be worth it given that cc0 targets are not
-	       terribly common or important these days and trapping math
-	       is rarely used.  The combination of those two conditions
-	       necessary to trip this situation is exceedingly rare in the
-	       real world.  */
-	    if (!prev_insn_cc0)
-	      {
-		const_arg = NULL_RTX;
-	      }
-	    else
-	      {
-		folded_arg = prev_insn_cc0;
-		mode_arg = prev_insn_cc0_mode;
-		const_arg = equiv_constant (folded_arg);
-	      }
-	    break;
-
 	  default:
 	    folded_arg = fold_rtx (folded_arg, insn);
 	    const_arg = equiv_constant (folded_arg);
@@ -6781,7 +6751,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
       return;
 
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 53e9603868d..2238b81bfba 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1382,7 +1382,6 @@ cselib_hash_rtx (rtx x, int create, machine_mode memmode)
       return cselib_hash_rtx (XEXP (x, 0), create, memmode);
 
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       return 0;
@@ -1822,7 +1821,6 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return orig;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 9e75c13ccc6..5728dbbb6cd 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2816,7 +2816,6 @@ df_uses_record (class df_collection_rec *collection_rec,
     case CONST:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
       return;
@@ -2902,7 +2901,6 @@ df_uses_record (class df_collection_rec *collection_rec,
 	    case PARALLEL:
 	    case SCRATCH:
 	    case PC:
-	    case CC0:
 		break;
 	    case MEM:
 	      df_uses_record (collection_rec, &XEXP (dst, 0),
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a52a75900fc..ad219bc4fef 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2846,7 +2846,6 @@ verify_rtx_sharing (rtx orig, rtx insn)
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3099,7 +3098,6 @@ repeat:
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3222,7 +3220,6 @@ repeat:
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return;
@@ -5682,7 +5679,6 @@ copy_insn_1 (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return orig;
diff --git a/gcc/gcse-common.c b/gcc/gcse-common.c
index 323ff85bbbd..812e2369d71 100644
--- a/gcc/gcse-common.c
+++ b/gcc/gcse-common.c
@@ -186,7 +186,6 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap,
       goto repeat;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 1f1e5a59b74..927b9286845 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -926,7 +926,6 @@ oprs_unchanged_p (const_rtx x, const rtx_insn *insn, int avail_p)
       return 0;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 6166c75a9b1..730484c0806 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -3011,7 +3011,6 @@ clear_struct_flag (rtx x)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case EQ_ATTR:
     case ATTR_FLAG:
       return;
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index b1abebf0585..7f8e7fc768d 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -105,11 +105,6 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
 	max_recog_operands = XINT (part, 0);
       return;
 
-    case CC0:
-      if (recog_p)
-	have_cc0_flag = 1;
-      return;
-
     case LO_SUM:
       if (recog_p)
 	have_lo_sum_flag = 1;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 84d07d388ee..b327821932d 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -169,9 +169,6 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info)
 	  return;
 	}
       break;
-    case CC0:
-      printf ("cc0_rtx");
-      return;
 
     case CONST_INT:
       if (INTVAL (x) == 0)
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 359681e1680..a6f18647493 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -237,7 +237,6 @@ walk_rtx (md_rtx_info *info, rtx x, class accum_extract *acc)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST_INT:
     case SYMBOL_REF:
       return;
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 5b5b72fd6ca..79765ba301b 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -694,13 +694,11 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
 	  error_at (info->loc, "mode mismatch in set: %smode vs %smode",
 		    GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
 
-	/* If only one of the operands is VOIDmode, and PC or CC0 is
-	   not involved, it's probably a mistake.  */
+	/* If only one of the operands is VOIDmode, and PC is not involved,
+	   it's probably a mistake.  */
 	else if (dmode != smode
 		 && GET_CODE (dest) != PC
-		 && GET_CODE (dest) != CC0
 		 && GET_CODE (src) != PC
-		 && GET_CODE (src) != CC0
 		 && !CONST_INT_P (src)
 		 && !CONST_WIDE_INT_P (src)
 		 && GET_CODE (src) != CALL)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index aeda6588bcd..9227af5323b 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1104,7 +1104,6 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x,
     {
     case CONST_INT:
     case CONST:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/ira.c b/gcc/ira.c
index 2bb821dd2f8..4580a7197bf 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3077,7 +3077,6 @@ equiv_init_movable_p (rtx x, int regno)
     case SET:
       return equiv_init_movable_p (SET_SRC (x), regno);
 
-    case CC0:
     case CLOBBER:
       return 0;
 
@@ -3162,7 +3161,6 @@ memref_referenced_p (rtx memref, rtx x, bool read_p)
     case SYMBOL_REF:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case HIGH:
     case LO_SUM:
       return false;
@@ -4440,9 +4438,6 @@ rtx_moveable_p (rtx *loc, enum op_type type)
     case PC:
       return type == OP_IN;
 
-    case CC0:
-      return false;
-
     case REG:
       if (x == frame_pointer_rtx)
 	return true;
diff --git a/gcc/jump.c b/gcc/jump.c
index 26317546030..624a83c5b8c 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1094,7 +1094,6 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target)
   switch (code)
     {
     case PC:
-    case CC0:
     case REG:
     case CLOBBER:
     case CALL:
@@ -1764,7 +1763,6 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
   switch (code)
     {
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     CASE_CONST_UNIQUE:
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 653e3033271..e6baa1c9a88 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -212,7 +212,6 @@ check_maybe_invariant (rtx x)
       return true;
 
     case PC:
-    case CC0:
     case UNSPEC_VOLATILE:
     case CALL:
       return false;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index cf745dc6a26..fcef2537631 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -353,7 +353,6 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 713180f5a86..c11653eea44 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -549,7 +549,6 @@ oprs_unchanged_p (rtx x, rtx_insn *insn, bool after_insn)
 	return oprs_unchanged_p (XEXP (x, 0), insn, after_insn);
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index d514b1c5373..4769209f754 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1721,7 +1721,6 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_wide_integer (pp, SUBREG_BYTE (x));
       break;
     case SCRATCH:
-    case CC0:
     case PC:
       pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
       break;
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index e34b74af9f1..9c750f003fa 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -998,7 +998,6 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn)
     {
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 2a0e892e5fd..e021d7bf62a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1456,7 +1456,6 @@ scan_rtx (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions action,
     CASE_CONST_ANY:
     case SYMBOL_REF:
     case LABEL_REF:
-    case CC0:
     case PC:
       return;
 
diff --git a/gcc/reload.c b/gcc/reload.c
index e1bc3c376b2..52c9c3c93d6 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5312,7 +5312,6 @@ subst_reg_equivs (rtx ad, rtx_insn *insn)
     case SYMBOL_REF:
     case LABEL_REF:
     case PC:
-    case CC0:
       return ad;
 
     case REG:
@@ -6610,8 +6609,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
     }
   else if (MEM_P (x))
     return refers_to_mem_for_reload_p (in);
-  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
-	   || GET_CODE (x) == CC0)
+  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC)
     return reg_mentioned_p (x, in);
   else
     {
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 19a64f2542a..235b49765e1 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2539,7 +2539,6 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -2962,7 +2961,6 @@ elimination_effects (rtx x, machine_mode mem_mode)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -4341,7 +4339,6 @@ scan_paradoxical_subregs (rtx x)
     case SYMBOL_REF:
     case LABEL_REF:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case USE:
     case CLOBBER:
diff --git a/gcc/resource.c b/gcc/resource.c
index 90cf091652b..61ecc0f8171 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -246,10 +246,6 @@ mark_referenced_resources (rtx x, struct resources *res,
       mark_referenced_resources (XEXP (x, 0), res, false);
       return;
 
-    case CC0:
-      res->cc = 1;
-      return;
-
     case UNSPEC_VOLATILE:
     case TRAP_IF:
     case ASM_INPUT:
@@ -643,11 +639,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
       /* These don't set any resources.  */
       return;
 
-    case CC0:
-      if (in_dest)
-	res->cc = 1;
-      return;
-
     case CALL_INSN:
       /* Called routine modifies the condition code, memory, any registers
 	 that aren't saved across calls, global registers and anything
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 4411e067ba8..6030bb1a52c 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -295,7 +295,6 @@ copy_rtx (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -388,7 +387,6 @@ shallow_copy_rtx (const_rtx orig MEM_STAT_DECL)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 7ec94a95105..32bcefbd7ae 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -287,7 +287,7 @@ DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
    ---------------------------------------------------------------------- */
 
 /* Assignment.
-   Operand 1 is the location (REG, MEM, PC, CC0 or whatever) assigned to.
+   Operand 1 is the location (REG, MEM, PC or whatever) assigned to.
    Operand 2 is the value stored there.
    ALL assignment must use SET.
    Instructions that do multiple assignments must use multiple SET,
@@ -436,13 +436,6 @@ DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
    This is either a DECL node, or some kind of constant.  */
 DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
 
-/* The condition code register is represented, in our imagination,
-   as a register holding a value that can be compared to zero.
-   In fact, the machine has already compared them and recorded the
-   results; but instructions that look at the condition code
-   pretend to be looking at the entire value and comparing it.  */
-DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
-
 /* ----------------------------------------------------------------------
    Expressions for operators in an rtl pattern
    ---------------------------------------------------------------------- */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 00aaa38996b..a815e18b17c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -990,7 +990,6 @@ count_occurrences (const_rtx x, const_rtx find, int count_dest)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
       return 0;
 
     case EXPR_LIST:
@@ -1084,7 +1083,6 @@ reg_mentioned_p (const_rtx reg, const_rtx in)
       /* These codes have no constituent expressions
 	 and are unique.  */
     case SCRATCH:
-    case CC0:
     case PC:
       return 0;
 
@@ -1167,11 +1165,10 @@ reg_referenced_p (const_rtx x, const_rtx body)
       if (reg_overlap_mentioned_p (x, SET_SRC (body)))
 	return 1;
 
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn references X if
 	 it is mentioned in the destination.  */
-      if (GET_CODE (SET_DEST (body)) != CC0
-	  && GET_CODE (SET_DEST (body)) != PC
+      if (GET_CODE (SET_DEST (body)) != PC
 	  && !REG_P (SET_DEST (body))
 	  && ! (GET_CODE (SET_DEST (body)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (body)))
@@ -1318,7 +1315,6 @@ modified_between_p (const_rtx x, const rtx_insn *start, const rtx_insn *end)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1373,7 +1369,6 @@ modified_in_p (const_rtx x, const_rtx insn)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1876,7 +1871,6 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
 
     case SCRATCH:
     case PC:
-    case CC0:
       return reg_mentioned_p (x, in);
 
     case PARALLEL:
@@ -1902,7 +1896,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
    ignored by note_stores, but passed to FUN.
 
    FUN receives three arguments:
-   1. the REG, MEM, CC0 or PC being stored in or clobbered,
+   1. the REG, MEM or PC being stored in or clobbered,
    2. the SET or CLOBBER rtx that does the store,
    3. the pointer DATA provided to note_stores.
 
@@ -2618,7 +2612,6 @@ volatile_insn_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2679,7 +2672,6 @@ volatile_refs_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2739,7 +2731,6 @@ side_effects_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2827,7 +2818,6 @@ may_trap_p_1 (const_rtx x, unsigned flags)
     case LABEL_REF:
     case CONST:
     case PC:
-    case CC0:
     case REG:
     case SCRATCH:
       return 0;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index d8b5c53c6a4..e19f21036db 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2579,21 +2579,6 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn)
 
       return;
 
-    case CC0:
-      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
-        same flag for previous CC0 users which is safe).  */
-      CANT_MOVE (prev_nonnote_insn (insn)) = 1;
-
-      if (cslr_p && sched_deps_info->finish_rhs)
-	sched_deps_info->finish_rhs ();
-
-      return;
-
     case REG:
       {
 	int regno = REGNO (x);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4cedfbb05a3..9d25a68a0c9 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2675,15 +2675,12 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	  rtx xop00 = XEXP (op0, 0);
 	  rtx xop10 = XEXP (op1, 0);
 
-	  if (GET_CODE (xop00) == CC0 && GET_CODE (xop10) == CC0)
-	      return xop00;
-
-	    if (REG_P (xop00) && REG_P (xop10)
-		&& REGNO (xop00) == REGNO (xop10)
-		&& GET_MODE (xop00) == mode
-		&& GET_MODE (xop10) == mode
-		&& GET_MODE_CLASS (mode) == MODE_CC)
-	      return xop00;
+	  if (REG_P (xop00) && REG_P (xop10)
+	      && REGNO (xop00) == REGNO (xop10)
+	      && GET_MODE (xop00) == mode
+	      && GET_MODE (xop10) == mode
+	      && GET_MODE_CLASS (mode) == MODE_CC)
+	    return xop00;
 	}
       break;
 
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 42c5950aca1..f4d10a45bce 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -68,7 +68,6 @@ cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return x;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 52aea47a053..d57224486a2 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2450,7 +2450,6 @@ unsuitable_loc (rtx loc)
     {
     case PC:
     case SCRATCH:
-    case CC0:
     case ASM_INPUT:
     case ASM_OPERANDS:
       return true;
@@ -5661,7 +5660,6 @@ non_suitable_const (const_rtx x)
 	case DEBUG_EXPR:
 	case PC:
 	case SCRATCH:
-	case CC0:
 	case ASM_INPUT:
 	case ASM_OPERANDS:
 	  return true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/segher/heads/cc0)] delete CC0 rtl code
@ 2020-12-15 15:51 Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2020-12-15 15:51 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c1d017874ad00cf444ef097ff107264ada587203

commit c1d017874ad00cf444ef097ff107264ada587203
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Sun Sep 22 05:54:05 2019 +0000

    delete CC0 rtl code

Diff:
---
 gcc/caller-save.c      |  2 +-
 gcc/combine.c          | 23 ++++++++---------------
 gcc/cse.c              | 31 -------------------------------
 gcc/cselib.c           |  2 --
 gcc/df-scan.c          |  2 --
 gcc/emit-rtl.c         |  4 ----
 gcc/gcse-common.c      |  1 -
 gcc/gcse.c             |  1 -
 gcc/genattrtab.c       |  1 -
 gcc/genconfig.c        |  5 -----
 gcc/genemit.c          |  3 ---
 gcc/genextract.c       |  1 -
 gcc/genrecog.c         |  6 ++----
 gcc/ira-costs.c        |  1 -
 gcc/ira.c              |  5 -----
 gcc/jump.c             |  2 --
 gcc/loop-invariant.c   |  1 -
 gcc/lra-eliminations.c |  1 -
 gcc/postreload-gcse.c  |  1 -
 gcc/print-rtl.c        |  1 -
 gcc/reginfo.c          |  1 -
 gcc/regrename.c        |  1 -
 gcc/reload.c           |  4 +---
 gcc/reload1.c          |  3 ---
 gcc/resource.c         |  9 ---------
 gcc/rtl.c              |  2 --
 gcc/rtl.def            |  9 +--------
 gcc/rtlanal.c          | 16 +++-------------
 gcc/sched-deps.c       | 15 ---------------
 gcc/simplify-rtx.c     | 15 ++++++---------
 gcc/valtrack.c         |  1 -
 gcc/var-tracking.c     |  2 --
 32 files changed, 22 insertions(+), 150 deletions(-)

diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index b7c8bd3f9dd..f36f107339f 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1012,7 +1012,7 @@ mark_referenced_regs (rtx *loc, refmarker_fn *mark, void *arg)
       loc = &SET_DEST (*loc);
       code = GET_CODE (*loc);
       if ((code == REG && REGNO (*loc) < FIRST_PSEUDO_REGISTER)
-	  || code == PC || code == CC0
+	  || code == PC
 	  || (code == SUBREG && REG_P (SUBREG_REG (*loc))
 	      && REGNO (SUBREG_REG (*loc)) < FIRST_PSEUDO_REGISTER
 	      /* If we're setting only part of a multi-word register,
diff --git a/gcc/combine.c b/gcc/combine.c
index 735f4b937b7..d440ef60714 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -574,12 +574,11 @@ find_single_use_1 (rtx dest, rtx *loc)
       return 0;
 
     case SET:
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn uses DEST if
 	 it is mentioned in the destination or the source.  Otherwise, we
 	 need just check the source.  */
-      if (GET_CODE (SET_DEST (x)) != CC0
-	  && GET_CODE (SET_DEST (x)) != PC
+      if (GET_CODE (SET_DEST (x)) != PC
 	  && !REG_P (SET_DEST (x))
 	  && ! (GET_CODE (SET_DEST (x)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (x)))
@@ -2005,7 +2004,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
 						  GET_MODE (src)))))
 	return 0;
     }
-  else if (GET_CODE (dest) != CC0)
+  else
     return 0;
 
 
@@ -5452,9 +5451,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
 	{
 	  rtx dest = SET_DEST (XVECEXP (x, 0, i));
 
-	  if (!REG_P (dest)
-	      && GET_CODE (dest) != CC0
-	      && GET_CODE (dest) != PC)
+	  if (!REG_P (dest) && GET_CODE (dest) != PC)
 	    {
 	      new_rtx = subst (dest, from, to, 0, 0, unique_copy);
 
@@ -5472,13 +5469,12 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
       len = GET_RTX_LENGTH (code);
       fmt = GET_RTX_FORMAT (code);
 
-      /* We don't need to process a SET_DEST that is a register, CC0,
-	 or PC, so set up to skip this common case.  All other cases
-	 where we want to suppress replacing something inside a
-	 SET_SRC are handled via the IN_DEST operand.  */
+      /* We don't need to process a SET_DEST that is a register or PC, so
+	 set up to skip this common case.  All other cases where we want
+	 to suppress replacing something inside a SET_SRC are handled via
+	 the IN_DEST operand.  */
       if (code == SET
 	  && (REG_P (SET_DEST (x))
-	      || GET_CODE (SET_DEST (x)) == CC0
 	      || GET_CODE (SET_DEST (x)) == PC))
 	fmt = "ie";
 
@@ -13871,9 +13867,6 @@ mark_used_regs_combine (rtx x)
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     case ASM_INPUT:
-    /* CC0 must die in the insn after it is set, so we don't need to take
-       special note of it here.  */
-    case CC0:
       return;
 
     case CLOBBER:
diff --git a/gcc/cse.c b/gcc/cse.c
index dcb0801a15a..914fab7a8f7 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2448,7 +2448,6 @@ hash_rtx_cb (const_rtx x, machine_mode mode,
     case PRE_MODIFY:
     case POST_MODIFY:
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       if (do_not_record_p) {
@@ -2633,7 +2632,6 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
   switch (code)
     {
     case PC:
-    case CC0:
     CASE_CONST_UNIQUE:
       return x == y;
 
@@ -2848,7 +2846,6 @@ canon_reg (rtx x, rtx_insn *insn)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
@@ -3174,9 +3171,6 @@ fold_rtx (rtx x, rtx_insn *insn)
     case EXPR_LIST:
       return x;
 
-    case CC0:
-      return prev_insn_cc0;
-
     case ASM_OPERANDS:
       if (insn)
 	{
@@ -3227,30 +3221,6 @@ fold_rtx (rtx x, rtx_insn *insn)
 	    const_arg = folded_arg;
 	    break;
 
-	  case CC0:
-	    /* The cc0-user and cc0-setter may be in different blocks if
-	       the cc0-setter potentially traps.  In that case PREV_INSN_CC0
-	       will have been cleared as we exited the block with the
-	       setter.
-
-	       While we could potentially track cc0 in this case, it just
-	       doesn't seem to be worth it given that cc0 targets are not
-	       terribly common or important these days and trapping math
-	       is rarely used.  The combination of those two conditions
-	       necessary to trip this situation is exceedingly rare in the
-	       real world.  */
-	    if (!prev_insn_cc0)
-	      {
-		const_arg = NULL_RTX;
-	      }
-	    else
-	      {
-		folded_arg = prev_insn_cc0;
-		mode_arg = prev_insn_cc0_mode;
-		const_arg = equiv_constant (folded_arg);
-	      }
-	    break;
-
 	  default:
 	    folded_arg = fold_rtx (folded_arg, insn);
 	    const_arg = equiv_constant (folded_arg);
@@ -6781,7 +6751,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
       return;
 
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 53e9603868d..2238b81bfba 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1382,7 +1382,6 @@ cselib_hash_rtx (rtx x, int create, machine_mode memmode)
       return cselib_hash_rtx (XEXP (x, 0), create, memmode);
 
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       return 0;
@@ -1822,7 +1821,6 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return orig;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 9e75c13ccc6..5728dbbb6cd 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2816,7 +2816,6 @@ df_uses_record (class df_collection_rec *collection_rec,
     case CONST:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
       return;
@@ -2902,7 +2901,6 @@ df_uses_record (class df_collection_rec *collection_rec,
 	    case PARALLEL:
 	    case SCRATCH:
 	    case PC:
-	    case CC0:
 		break;
 	    case MEM:
 	      df_uses_record (collection_rec, &XEXP (dst, 0),
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a52a75900fc..ad219bc4fef 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2846,7 +2846,6 @@ verify_rtx_sharing (rtx orig, rtx insn)
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3099,7 +3098,6 @@ repeat:
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3222,7 +3220,6 @@ repeat:
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return;
@@ -5682,7 +5679,6 @@ copy_insn_1 (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return orig;
diff --git a/gcc/gcse-common.c b/gcc/gcse-common.c
index 323ff85bbbd..812e2369d71 100644
--- a/gcc/gcse-common.c
+++ b/gcc/gcse-common.c
@@ -186,7 +186,6 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap,
       goto repeat;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 1f1e5a59b74..927b9286845 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -926,7 +926,6 @@ oprs_unchanged_p (const_rtx x, const rtx_insn *insn, int avail_p)
       return 0;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 6166c75a9b1..730484c0806 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -3011,7 +3011,6 @@ clear_struct_flag (rtx x)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case EQ_ATTR:
     case ATTR_FLAG:
       return;
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index b1abebf0585..7f8e7fc768d 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -105,11 +105,6 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
 	max_recog_operands = XINT (part, 0);
       return;
 
-    case CC0:
-      if (recog_p)
-	have_cc0_flag = 1;
-      return;
-
     case LO_SUM:
       if (recog_p)
 	have_lo_sum_flag = 1;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 84d07d388ee..b327821932d 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -169,9 +169,6 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info)
 	  return;
 	}
       break;
-    case CC0:
-      printf ("cc0_rtx");
-      return;
 
     case CONST_INT:
       if (INTVAL (x) == 0)
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 63911e72d33..220c4adabca 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -237,7 +237,6 @@ walk_rtx (md_rtx_info *info, rtx x, class accum_extract *acc)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST_INT:
     case SYMBOL_REF:
       return;
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 5b5b72fd6ca..79765ba301b 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -694,13 +694,11 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
 	  error_at (info->loc, "mode mismatch in set: %smode vs %smode",
 		    GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
 
-	/* If only one of the operands is VOIDmode, and PC or CC0 is
-	   not involved, it's probably a mistake.  */
+	/* If only one of the operands is VOIDmode, and PC is not involved,
+	   it's probably a mistake.  */
 	else if (dmode != smode
 		 && GET_CODE (dest) != PC
-		 && GET_CODE (dest) != CC0
 		 && GET_CODE (src) != PC
-		 && GET_CODE (src) != CC0
 		 && !CONST_INT_P (src)
 		 && !CONST_WIDE_INT_P (src)
 		 && GET_CODE (src) != CALL)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index aeda6588bcd..9227af5323b 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1104,7 +1104,6 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x,
     {
     case CONST_INT:
     case CONST:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/ira.c b/gcc/ira.c
index 2bb821dd2f8..4580a7197bf 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3077,7 +3077,6 @@ equiv_init_movable_p (rtx x, int regno)
     case SET:
       return equiv_init_movable_p (SET_SRC (x), regno);
 
-    case CC0:
     case CLOBBER:
       return 0;
 
@@ -3162,7 +3161,6 @@ memref_referenced_p (rtx memref, rtx x, bool read_p)
     case SYMBOL_REF:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case HIGH:
     case LO_SUM:
       return false;
@@ -4440,9 +4438,6 @@ rtx_moveable_p (rtx *loc, enum op_type type)
     case PC:
       return type == OP_IN;
 
-    case CC0:
-      return false;
-
     case REG:
       if (x == frame_pointer_rtx)
 	return true;
diff --git a/gcc/jump.c b/gcc/jump.c
index 26317546030..624a83c5b8c 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1094,7 +1094,6 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target)
   switch (code)
     {
     case PC:
-    case CC0:
     case REG:
     case CLOBBER:
     case CALL:
@@ -1764,7 +1763,6 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
   switch (code)
     {
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     CASE_CONST_UNIQUE:
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 653e3033271..e6baa1c9a88 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -212,7 +212,6 @@ check_maybe_invariant (rtx x)
       return true;
 
     case PC:
-    case CC0:
     case UNSPEC_VOLATILE:
     case CALL:
       return false;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index cf745dc6a26..fcef2537631 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -353,7 +353,6 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 713180f5a86..c11653eea44 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -549,7 +549,6 @@ oprs_unchanged_p (rtx x, rtx_insn *insn, bool after_insn)
 	return oprs_unchanged_p (XEXP (x, 0), insn, after_insn);
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index d514b1c5373..4769209f754 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1721,7 +1721,6 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_wide_integer (pp, SUBREG_BYTE (x));
       break;
     case SCRATCH:
-    case CC0:
     case PC:
       pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
       break;
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index e34b74af9f1..9c750f003fa 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -998,7 +998,6 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn)
     {
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 2a0e892e5fd..e021d7bf62a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1456,7 +1456,6 @@ scan_rtx (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions action,
     CASE_CONST_ANY:
     case SYMBOL_REF:
     case LABEL_REF:
-    case CC0:
     case PC:
       return;
 
diff --git a/gcc/reload.c b/gcc/reload.c
index e1bc3c376b2..52c9c3c93d6 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5312,7 +5312,6 @@ subst_reg_equivs (rtx ad, rtx_insn *insn)
     case SYMBOL_REF:
     case LABEL_REF:
     case PC:
-    case CC0:
       return ad;
 
     case REG:
@@ -6610,8 +6609,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
     }
   else if (MEM_P (x))
     return refers_to_mem_for_reload_p (in);
-  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
-	   || GET_CODE (x) == CC0)
+  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC)
     return reg_mentioned_p (x, in);
   else
     {
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 19a64f2542a..235b49765e1 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2539,7 +2539,6 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -2962,7 +2961,6 @@ elimination_effects (rtx x, machine_mode mem_mode)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -4341,7 +4339,6 @@ scan_paradoxical_subregs (rtx x)
     case SYMBOL_REF:
     case LABEL_REF:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case USE:
     case CLOBBER:
diff --git a/gcc/resource.c b/gcc/resource.c
index 90cf091652b..61ecc0f8171 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -246,10 +246,6 @@ mark_referenced_resources (rtx x, struct resources *res,
       mark_referenced_resources (XEXP (x, 0), res, false);
       return;
 
-    case CC0:
-      res->cc = 1;
-      return;
-
     case UNSPEC_VOLATILE:
     case TRAP_IF:
     case ASM_INPUT:
@@ -643,11 +639,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
       /* These don't set any resources.  */
       return;
 
-    case CC0:
-      if (in_dest)
-	res->cc = 1;
-      return;
-
     case CALL_INSN:
       /* Called routine modifies the condition code, memory, any registers
 	 that aren't saved across calls, global registers and anything
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 4411e067ba8..6030bb1a52c 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -295,7 +295,6 @@ copy_rtx (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -388,7 +387,6 @@ shallow_copy_rtx (const_rtx orig MEM_STAT_DECL)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 7ec94a95105..32bcefbd7ae 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -287,7 +287,7 @@ DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
    ---------------------------------------------------------------------- */
 
 /* Assignment.
-   Operand 1 is the location (REG, MEM, PC, CC0 or whatever) assigned to.
+   Operand 1 is the location (REG, MEM, PC or whatever) assigned to.
    Operand 2 is the value stored there.
    ALL assignment must use SET.
    Instructions that do multiple assignments must use multiple SET,
@@ -436,13 +436,6 @@ DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
    This is either a DECL node, or some kind of constant.  */
 DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
 
-/* The condition code register is represented, in our imagination,
-   as a register holding a value that can be compared to zero.
-   In fact, the machine has already compared them and recorded the
-   results; but instructions that look at the condition code
-   pretend to be looking at the entire value and comparing it.  */
-DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
-
 /* ----------------------------------------------------------------------
    Expressions for operators in an rtl pattern
    ---------------------------------------------------------------------- */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 9894377b5f9..b4115c43912 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -990,7 +990,6 @@ count_occurrences (const_rtx x, const_rtx find, int count_dest)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
       return 0;
 
     case EXPR_LIST:
@@ -1084,7 +1083,6 @@ reg_mentioned_p (const_rtx reg, const_rtx in)
       /* These codes have no constituent expressions
 	 and are unique.  */
     case SCRATCH:
-    case CC0:
     case PC:
       return 0;
 
@@ -1167,11 +1165,10 @@ reg_referenced_p (const_rtx x, const_rtx body)
       if (reg_overlap_mentioned_p (x, SET_SRC (body)))
 	return 1;
 
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn references X if
 	 it is mentioned in the destination.  */
-      if (GET_CODE (SET_DEST (body)) != CC0
-	  && GET_CODE (SET_DEST (body)) != PC
+      if (GET_CODE (SET_DEST (body)) != PC
 	  && !REG_P (SET_DEST (body))
 	  && ! (GET_CODE (SET_DEST (body)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (body)))
@@ -1318,7 +1315,6 @@ modified_between_p (const_rtx x, const rtx_insn *start, const rtx_insn *end)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1373,7 +1369,6 @@ modified_in_p (const_rtx x, const_rtx insn)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1880,7 +1875,6 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
 
     case SCRATCH:
     case PC:
-    case CC0:
       return reg_mentioned_p (x, in);
 
     case PARALLEL:
@@ -1906,7 +1900,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
    ignored by note_stores, but passed to FUN.
 
    FUN receives three arguments:
-   1. the REG, MEM, CC0 or PC being stored in or clobbered,
+   1. the REG, MEM or PC being stored in or clobbered,
    2. the SET or CLOBBER rtx that does the store,
    3. the pointer DATA provided to note_stores.
 
@@ -2622,7 +2616,6 @@ volatile_insn_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2683,7 +2676,6 @@ volatile_refs_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2743,7 +2735,6 @@ side_effects_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2831,7 +2822,6 @@ may_trap_p_1 (const_rtx x, unsigned flags)
     case LABEL_REF:
     case CONST:
     case PC:
-    case CC0:
     case REG:
     case SCRATCH:
       return 0;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index d8b5c53c6a4..e19f21036db 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2579,21 +2579,6 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn)
 
       return;
 
-    case CC0:
-      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
-        same flag for previous CC0 users which is safe).  */
-      CANT_MOVE (prev_nonnote_insn (insn)) = 1;
-
-      if (cslr_p && sched_deps_info->finish_rhs)
-	sched_deps_info->finish_rhs ();
-
-      return;
-
     case REG:
       {
 	int regno = REGNO (x);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4cedfbb05a3..9d25a68a0c9 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2675,15 +2675,12 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	  rtx xop00 = XEXP (op0, 0);
 	  rtx xop10 = XEXP (op1, 0);
 
-	  if (GET_CODE (xop00) == CC0 && GET_CODE (xop10) == CC0)
-	      return xop00;
-
-	    if (REG_P (xop00) && REG_P (xop10)
-		&& REGNO (xop00) == REGNO (xop10)
-		&& GET_MODE (xop00) == mode
-		&& GET_MODE (xop10) == mode
-		&& GET_MODE_CLASS (mode) == MODE_CC)
-	      return xop00;
+	  if (REG_P (xop00) && REG_P (xop10)
+	      && REGNO (xop00) == REGNO (xop10)
+	      && GET_MODE (xop00) == mode
+	      && GET_MODE (xop10) == mode
+	      && GET_MODE_CLASS (mode) == MODE_CC)
+	    return xop00;
 	}
       break;
 
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 42c5950aca1..f4d10a45bce 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -68,7 +68,6 @@ cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return x;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 52aea47a053..d57224486a2 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2450,7 +2450,6 @@ unsuitable_loc (rtx loc)
     {
     case PC:
     case SCRATCH:
-    case CC0:
     case ASM_INPUT:
     case ASM_OPERANDS:
       return true;
@@ -5661,7 +5660,6 @@ non_suitable_const (const_rtx x)
 	case DEBUG_EXPR:
 	case PC:
 	case SCRATCH:
-	case CC0:
 	case ASM_INPUT:
 	case ASM_OPERANDS:
 	  return true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gcc(refs/users/segher/heads/cc0)] delete CC0 rtl code
@ 2020-06-15 19:23 Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2020-06-15 19:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cb3a87d3468d2dd1adcd9b23a4910b4969551449

commit cb3a87d3468d2dd1adcd9b23a4910b4969551449
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Sun Sep 22 05:54:05 2019 +0000

    delete CC0 rtl code

Diff:
---
 gcc/caller-save.c      |  2 +-
 gcc/combine.c          | 23 ++++++++---------------
 gcc/cse.c              | 31 -------------------------------
 gcc/cselib.c           |  2 --
 gcc/df-scan.c          |  2 --
 gcc/emit-rtl.c         |  4 ----
 gcc/gcse-common.c      |  1 -
 gcc/gcse.c             |  1 -
 gcc/genattrtab.c       |  1 -
 gcc/genconfig.c        |  5 -----
 gcc/genemit.c          |  3 ---
 gcc/genextract.c       |  1 -
 gcc/genrecog.c         |  6 ++----
 gcc/ira-costs.c        |  1 -
 gcc/ira.c              |  5 -----
 gcc/jump.c             |  2 --
 gcc/loop-invariant.c   |  1 -
 gcc/lra-eliminations.c |  1 -
 gcc/postreload-gcse.c  |  1 -
 gcc/print-rtl.c        |  1 -
 gcc/reginfo.c          |  1 -
 gcc/regrename.c        |  1 -
 gcc/reload.c           |  4 +---
 gcc/reload1.c          |  3 ---
 gcc/resource.c         |  9 ---------
 gcc/rtl.c              |  2 --
 gcc/rtl.def            |  9 +--------
 gcc/rtlanal.c          | 16 +++-------------
 gcc/sched-deps.c       | 15 ---------------
 gcc/simplify-rtx.c     | 15 ++++++---------
 gcc/valtrack.c         |  1 -
 gcc/var-tracking.c     |  2 --
 32 files changed, 22 insertions(+), 150 deletions(-)

diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index b7c8bd3f9dd..f36f107339f 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1012,7 +1012,7 @@ mark_referenced_regs (rtx *loc, refmarker_fn *mark, void *arg)
       loc = &SET_DEST (*loc);
       code = GET_CODE (*loc);
       if ((code == REG && REGNO (*loc) < FIRST_PSEUDO_REGISTER)
-	  || code == PC || code == CC0
+	  || code == PC
 	  || (code == SUBREG && REG_P (SUBREG_REG (*loc))
 	      && REGNO (SUBREG_REG (*loc)) < FIRST_PSEUDO_REGISTER
 	      /* If we're setting only part of a multi-word register,
diff --git a/gcc/combine.c b/gcc/combine.c
index 8a30e29b54e..2fd9b6e80f5 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -574,12 +574,11 @@ find_single_use_1 (rtx dest, rtx *loc)
       return 0;
 
     case SET:
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn uses DEST if
 	 it is mentioned in the destination or the source.  Otherwise, we
 	 need just check the source.  */
-      if (GET_CODE (SET_DEST (x)) != CC0
-	  && GET_CODE (SET_DEST (x)) != PC
+      if (GET_CODE (SET_DEST (x)) != PC
 	  && !REG_P (SET_DEST (x))
 	  && ! (GET_CODE (SET_DEST (x)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (x)))
@@ -2005,7 +2004,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
 						  GET_MODE (src)))))
 	return 0;
     }
-  else if (GET_CODE (dest) != CC0)
+  else
     return 0;
 
 
@@ -5451,9 +5450,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
 	{
 	  rtx dest = SET_DEST (XVECEXP (x, 0, i));
 
-	  if (!REG_P (dest)
-	      && GET_CODE (dest) != CC0
-	      && GET_CODE (dest) != PC)
+	  if (!REG_P (dest) && GET_CODE (dest) != PC)
 	    {
 	      new_rtx = subst (dest, from, to, 0, 0, unique_copy);
 
@@ -5471,13 +5468,12 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
       len = GET_RTX_LENGTH (code);
       fmt = GET_RTX_FORMAT (code);
 
-      /* We don't need to process a SET_DEST that is a register, CC0,
-	 or PC, so set up to skip this common case.  All other cases
-	 where we want to suppress replacing something inside a
-	 SET_SRC are handled via the IN_DEST operand.  */
+      /* We don't need to process a SET_DEST that is a register or PC, so
+	 set up to skip this common case.  All other cases where we want
+	 to suppress replacing something inside a SET_SRC are handled via
+	 the IN_DEST operand.  */
       if (code == SET
 	  && (REG_P (SET_DEST (x))
-	      || GET_CODE (SET_DEST (x)) == CC0
 	      || GET_CODE (SET_DEST (x)) == PC))
 	fmt = "ie";
 
@@ -13849,9 +13845,6 @@ mark_used_regs_combine (rtx x)
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     case ASM_INPUT:
-    /* CC0 must die in the insn after it is set, so we don't need to take
-       special note of it here.  */
-    case CC0:
       return;
 
     case CLOBBER:
diff --git a/gcc/cse.c b/gcc/cse.c
index dcb0801a15a..914fab7a8f7 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2448,7 +2448,6 @@ hash_rtx_cb (const_rtx x, machine_mode mode,
     case PRE_MODIFY:
     case POST_MODIFY:
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       if (do_not_record_p) {
@@ -2633,7 +2632,6 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
   switch (code)
     {
     case PC:
-    case CC0:
     CASE_CONST_UNIQUE:
       return x == y;
 
@@ -2848,7 +2846,6 @@ canon_reg (rtx x, rtx_insn *insn)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
@@ -3174,9 +3171,6 @@ fold_rtx (rtx x, rtx_insn *insn)
     case EXPR_LIST:
       return x;
 
-    case CC0:
-      return prev_insn_cc0;
-
     case ASM_OPERANDS:
       if (insn)
 	{
@@ -3227,30 +3221,6 @@ fold_rtx (rtx x, rtx_insn *insn)
 	    const_arg = folded_arg;
 	    break;
 
-	  case CC0:
-	    /* The cc0-user and cc0-setter may be in different blocks if
-	       the cc0-setter potentially traps.  In that case PREV_INSN_CC0
-	       will have been cleared as we exited the block with the
-	       setter.
-
-	       While we could potentially track cc0 in this case, it just
-	       doesn't seem to be worth it given that cc0 targets are not
-	       terribly common or important these days and trapping math
-	       is rarely used.  The combination of those two conditions
-	       necessary to trip this situation is exceedingly rare in the
-	       real world.  */
-	    if (!prev_insn_cc0)
-	      {
-		const_arg = NULL_RTX;
-	      }
-	    else
-	      {
-		folded_arg = prev_insn_cc0;
-		mode_arg = prev_insn_cc0_mode;
-		const_arg = equiv_constant (folded_arg);
-	      }
-	    break;
-
 	  default:
 	    folded_arg = fold_rtx (folded_arg, insn);
 	    const_arg = equiv_constant (folded_arg);
@@ -6781,7 +6751,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
       return;
 
     case PC:
-    case CC0:
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 53e9603868d..2238b81bfba 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1382,7 +1382,6 @@ cselib_hash_rtx (rtx x, int create, machine_mode memmode)
       return cselib_hash_rtx (XEXP (x, 0), create, memmode);
 
     case PC:
-    case CC0:
     case CALL:
     case UNSPEC_VOLATILE:
       return 0;
@@ -1822,7 +1821,6 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return orig;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 93b060f4bf3..f32d1f7dfcb 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2816,7 +2816,6 @@ df_uses_record (class df_collection_rec *collection_rec,
     case CONST:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
       return;
@@ -2902,7 +2901,6 @@ df_uses_record (class df_collection_rec *collection_rec,
 	    case PARALLEL:
 	    case SCRATCH:
 	    case PC:
-	    case CC0:
 		break;
 	    case MEM:
 	      df_uses_record (collection_rec, &XEXP (dst, 0),
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 81e1fbbd0c0..60d8328cf5d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2846,7 +2846,6 @@ verify_rtx_sharing (rtx orig, rtx insn)
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3099,7 +3098,6 @@ repeat:
     case LABEL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -3222,7 +3220,6 @@ repeat:
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return;
@@ -5671,7 +5668,6 @@ copy_insn_1 (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
       return orig;
diff --git a/gcc/gcse-common.c b/gcc/gcse-common.c
index 323ff85bbbd..812e2369d71 100644
--- a/gcc/gcse-common.c
+++ b/gcc/gcse-common.c
@@ -186,7 +186,6 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap,
       goto repeat;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 1f1e5a59b74..927b9286845 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -926,7 +926,6 @@ oprs_unchanged_p (const_rtx x, const rtx_insn *insn, int avail_p)
       return 0;
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 6166c75a9b1..730484c0806 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -3011,7 +3011,6 @@ clear_struct_flag (rtx x)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case EQ_ATTR:
     case ATTR_FLAG:
       return;
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index b1abebf0585..7f8e7fc768d 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -105,11 +105,6 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
 	max_recog_operands = XINT (part, 0);
       return;
 
-    case CC0:
-      if (recog_p)
-	have_cc0_flag = 1;
-      return;
-
     case LO_SUM:
       if (recog_p)
 	have_lo_sum_flag = 1;
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 84d07d388ee..b327821932d 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -169,9 +169,6 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info)
 	  return;
 	}
       break;
-    case CC0:
-      printf ("cc0_rtx");
-      return;
 
     case CONST_INT:
       if (INTVAL (x) == 0)
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 63911e72d33..220c4adabca 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -237,7 +237,6 @@ walk_rtx (md_rtx_info *info, rtx x, class accum_extract *acc)
   switch (code)
     {
     case PC:
-    case CC0:
     case CONST_INT:
     case SYMBOL_REF:
       return;
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index bc371b1903c..2445f4a3f46 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -694,13 +694,11 @@ validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
 	  error_at (info->loc, "mode mismatch in set: %smode vs %smode",
 		    GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
 
-	/* If only one of the operands is VOIDmode, and PC or CC0 is
-	   not involved, it's probably a mistake.  */
+	/* If only one of the operands is VOIDmode, and PC is not involved,
+	   it's probably a mistake.  */
 	else if (dmode != smode
 		 && GET_CODE (dest) != PC
-		 && GET_CODE (dest) != CC0
 		 && GET_CODE (src) != PC
-		 && GET_CODE (src) != CC0
 		 && !CONST_INT_P (src)
 		 && !CONST_WIDE_INT_P (src)
 		 && GET_CODE (src) != CALL)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 6891156b5aa..cfad664a89b 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1103,7 +1103,6 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x,
     {
     case CONST_INT:
     case CONST:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/ira.c b/gcc/ira.c
index 78dc9ea121a..3d16d11edd9 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3068,7 +3068,6 @@ equiv_init_movable_p (rtx x, int regno)
     case SET:
       return equiv_init_movable_p (SET_SRC (x), regno);
 
-    case CC0:
     case CLOBBER:
       return 0;
 
@@ -3153,7 +3152,6 @@ memref_referenced_p (rtx memref, rtx x, bool read_p)
     case SYMBOL_REF:
     CASE_CONST_ANY:
     case PC:
-    case CC0:
     case HIGH:
     case LO_SUM:
       return false;
@@ -4431,9 +4429,6 @@ rtx_moveable_p (rtx *loc, enum op_type type)
     case PC:
       return type == OP_IN;
 
-    case CC0:
-      return false;
-
     case REG:
       if (x == frame_pointer_rtx)
 	return true;
diff --git a/gcc/jump.c b/gcc/jump.c
index b6469031904..678207da5c0 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1084,7 +1084,6 @@ mark_jump_label_1 (rtx x, rtx_insn *insn, bool in_mem, bool is_target)
   switch (code)
     {
     case PC:
-    case CC0:
     case REG:
     case CLOBBER:
     case CALL:
@@ -1754,7 +1753,6 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
   switch (code)
     {
     case PC:
-    case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
     CASE_CONST_UNIQUE:
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 37ae6549e56..9da7b866ed9 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -212,7 +212,6 @@ check_maybe_invariant (rtx x)
       return true;
 
     case PC:
-    case CC0:
     case UNSPEC_VOLATILE:
     case CALL:
       return false;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index cf745dc6a26..fcef2537631 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -353,7 +353,6 @@ lra_eliminate_regs_1 (rtx_insn *insn, rtx x, machine_mode mem_mode,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 713180f5a86..c11653eea44 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -549,7 +549,6 @@ oprs_unchanged_p (rtx x, rtx_insn *insn, bool after_insn)
 	return oprs_unchanged_p (XEXP (x, 0), insn, after_insn);
 
     case PC:
-    case CC0: /*FIXME*/
     case CONST:
     CASE_CONST_ANY:
     case SYMBOL_REF:
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 25265efc71b..61fc2e48769 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1721,7 +1721,6 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_wide_integer (pp, SUBREG_BYTE (x));
       break;
     case SCRATCH:
-    case CC0:
     case PC:
       pp_string (pp, GET_RTX_NAME (GET_CODE (x)));
       break;
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index e34b74af9f1..9c750f003fa 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -998,7 +998,6 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn)
     {
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case SYMBOL_REF:
     case LABEL_REF:
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 669a6ead705..b4142cb07a6 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1446,7 +1446,6 @@ scan_rtx (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions action,
     CASE_CONST_ANY:
     case SYMBOL_REF:
     case LABEL_REF:
-    case CC0:
     case PC:
       return;
 
diff --git a/gcc/reload.c b/gcc/reload.c
index aa68f7bb50f..8d45081c179 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5264,7 +5264,6 @@ subst_reg_equivs (rtx ad, rtx_insn *insn)
     case SYMBOL_REF:
     case LABEL_REF:
     case PC:
-    case CC0:
       return ad;
 
     case REG:
@@ -6562,8 +6561,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
     }
   else if (MEM_P (x))
     return refers_to_mem_for_reload_p (in);
-  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
-	   || GET_CODE (x) == CC0)
+  else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC)
     return reg_mentioned_p (x, in);
   else
     {
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 19a64f2542a..235b49765e1 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2539,7 +2539,6 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -2962,7 +2961,6 @@ elimination_effects (rtx x, machine_mode mem_mode)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
@@ -4341,7 +4339,6 @@ scan_paradoxical_subregs (rtx x)
     case SYMBOL_REF:
     case LABEL_REF:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case USE:
     case CLOBBER:
diff --git a/gcc/resource.c b/gcc/resource.c
index 0a9d5943abc..8b75cd9192f 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -246,10 +246,6 @@ mark_referenced_resources (rtx x, struct resources *res,
       mark_referenced_resources (XEXP (x, 0), res, false);
       return;
 
-    case CC0:
-      res->cc = 1;
-      return;
-
     case UNSPEC_VOLATILE:
     case TRAP_IF:
     case ASM_INPUT:
@@ -643,11 +639,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
       /* These don't set any resources.  */
       return;
 
-    case CC0:
-      if (in_dest)
-	res->cc = 1;
-      return;
-
     case CALL_INSN:
       /* Called routine modifies the condition code, memory, any registers
 	 that aren't saved across calls, global registers and anything
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 4411e067ba8..6030bb1a52c 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -295,7 +295,6 @@ copy_rtx (rtx orig)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
@@ -388,7 +387,6 @@ shallow_copy_rtx (const_rtx orig MEM_STAT_DECL)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case RETURN:
     case SIMPLE_RETURN:
     case SCRATCH:
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 9754333eafb..64c9529bdb6 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -287,7 +287,7 @@ DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
    ---------------------------------------------------------------------- */
 
 /* Assignment.
-   Operand 1 is the location (REG, MEM, PC, CC0 or whatever) assigned to.
+   Operand 1 is the location (REG, MEM, PC or whatever) assigned to.
    Operand 2 is the value stored there.
    ALL assignment must use SET.
    Instructions that do multiple assignments must use multiple SET,
@@ -436,13 +436,6 @@ DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
    This is either a DECL node, or some kind of constant.  */
 DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
 
-/* The condition code register is represented, in our imagination,
-   as a register holding a value that can be compared to zero.
-   In fact, the machine has already compared them and recorded the
-   results; but instructions that look at the condition code
-   pretend to be looking at the entire value and comparing it.  */
-DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
-
 /* ----------------------------------------------------------------------
    Expressions for operators in an rtl pattern
    ---------------------------------------------------------------------- */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 93170a4394e..aa3f47d338d 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -990,7 +990,6 @@ count_occurrences (const_rtx x, const_rtx find, int count_dest)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
       return 0;
 
     case EXPR_LIST:
@@ -1084,7 +1083,6 @@ reg_mentioned_p (const_rtx reg, const_rtx in)
       /* These codes have no constituent expressions
 	 and are unique.  */
     case SCRATCH:
-    case CC0:
     case PC:
       return 0;
 
@@ -1167,11 +1165,10 @@ reg_referenced_p (const_rtx x, const_rtx body)
       if (reg_overlap_mentioned_p (x, SET_SRC (body)))
 	return 1;
 
-      /* If the destination is anything other than CC0, PC, a REG or a SUBREG
+      /* If the destination is anything other than PC, a REG or a SUBREG
 	 of a REG that occupies all of the REG, the insn references X if
 	 it is mentioned in the destination.  */
-      if (GET_CODE (SET_DEST (body)) != CC0
-	  && GET_CODE (SET_DEST (body)) != PC
+      if (GET_CODE (SET_DEST (body)) != PC
 	  && !REG_P (SET_DEST (body))
 	  && ! (GET_CODE (SET_DEST (body)) == SUBREG
 		&& REG_P (SUBREG_REG (SET_DEST (body)))
@@ -1318,7 +1315,6 @@ modified_between_p (const_rtx x, const rtx_insn *start, const rtx_insn *end)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1373,7 +1369,6 @@ modified_in_p (const_rtx x, const_rtx insn)
       return 0;
 
     case PC:
-    case CC0:
       return 1;
 
     case MEM:
@@ -1876,7 +1871,6 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
 
     case SCRATCH:
     case PC:
-    case CC0:
       return reg_mentioned_p (x, in);
 
     case PARALLEL:
@@ -1902,7 +1896,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
    ignored by note_stores, but passed to FUN.
 
    FUN receives three arguments:
-   1. the REG, MEM, CC0 or PC being stored in or clobbered,
+   1. the REG, MEM or PC being stored in or clobbered,
    2. the SET or CLOBBER rtx that does the store,
    3. the pointer DATA provided to note_stores.
 
@@ -2618,7 +2612,6 @@ volatile_insn_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2679,7 +2672,6 @@ volatile_refs_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2739,7 +2731,6 @@ side_effects_p (const_rtx x)
     case SYMBOL_REF:
     case CONST:
     CASE_CONST_ANY:
-    case CC0:
     case PC:
     case REG:
     case SCRATCH:
@@ -2827,7 +2818,6 @@ may_trap_p_1 (const_rtx x, unsigned flags)
     case LABEL_REF:
     case CONST:
     case PC:
-    case CC0:
     case REG:
     case SCRATCH:
       return 0;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 1bc75074e5d..92bffb28d56 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2579,21 +2579,6 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn)
 
       return;
 
-    case CC0:
-      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
-        same flag for previous CC0 users which is safe).  */
-      CANT_MOVE (prev_nonnote_insn (insn)) = 1;
-
-      if (cslr_p && sched_deps_info->finish_rhs)
-	sched_deps_info->finish_rhs ();
-
-      return;
-
     case REG:
       {
 	int regno = REGNO (x);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index a92eb2ee4e9..3dc2c3d0583 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2591,15 +2591,12 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	  rtx xop00 = XEXP (op0, 0);
 	  rtx xop10 = XEXP (op1, 0);
 
-	  if (GET_CODE (xop00) == CC0 && GET_CODE (xop10) == CC0)
-	      return xop00;
-
-	    if (REG_P (xop00) && REG_P (xop10)
-		&& REGNO (xop00) == REGNO (xop10)
-		&& GET_MODE (xop00) == mode
-		&& GET_MODE (xop10) == mode
-		&& GET_MODE_CLASS (mode) == MODE_CC)
-	      return xop00;
+	  if (REG_P (xop00) && REG_P (xop10)
+	      && REGNO (xop00) == REGNO (xop10)
+	      && GET_MODE (xop00) == mode
+	      && GET_MODE (xop10) == mode
+	      && GET_MODE_CLASS (mode) == MODE_CC)
+	    return xop00;
 	}
       break;
 
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 42c5950aca1..f4d10a45bce 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -68,7 +68,6 @@ cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED)
     case SYMBOL_REF:
     case CODE_LABEL:
     case PC:
-    case CC0:
     case SCRATCH:
       /* SCRATCH must be shared because they represent distinct values.  */
       return x;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index fc861a0d8ce..fc0d57b3882 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2442,7 +2442,6 @@ unsuitable_loc (rtx loc)
     {
     case PC:
     case SCRATCH:
-    case CC0:
     case ASM_INPUT:
     case ASM_OPERANDS:
       return true;
@@ -5653,7 +5652,6 @@ non_suitable_const (const_rtx x)
 	case DEBUG_EXPR:
 	case PC:
 	case SCRATCH:
-	case CC0:
 	case ASM_INPUT:
 	case ASM_OPERANDS:
 	  return true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-15 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 21:55 [gcc(refs/users/segher/heads/cc0)] delete CC0 rtl code Segher Boessenkool
2020-06-15 19:23 Segher Boessenkool
2020-12-15 15:51 Segher Boessenkool
2020-12-15 17:04 Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).