This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 16/18] Use SYMBOL_REF_P macro. Autogenerated patch by running ../contrib/rtl-pred.sh SYMBOL_REF


2019-08-05  Arvind Sankar  <nivedita@alum.mit.edu>
	gcc/ChangeLog:

	* alias.c: Convert GET_CODE (..) == SYMBOL_REF to
	SYMBOL_REF_P (..).
	* asan.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* combine.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/aarch64/predicates.md: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/alpha/alpha.md: Likewise.
	* config/alpha/predicates.md: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arc/arc.h: Likewise.
	* config/arc/predicates.md: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.h: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/thumb1.md: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/bfin/bfin.h: Likewise.
	* config/bfin/bfin.md: Likewise.
	* config/bfin/predicates.md: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/c6x/predicates.md: Likewise.
	* config/cr16/cr16.c: Likewise.
	* config/cr16/cr16.h: Likewise.
	* config/cris/cris.c: Likewise.
	* config/cris/cris.md: Likewise.
	* config/csky/csky.c: Likewise.
	* config/csky/csky.h: Likewise.
	* config/csky/csky.md: Likewise.
	* config/csky/predicates.md: Likewise.
	* config/darwin.c: Likewise.
	* config/darwin.h: Likewise.
	* config/epiphany/epiphany.c: Likewise.
	* config/epiphany/epiphany.h: Likewise.
	* config/epiphany/predicates.md: Likewise.
	* config/fr30/predicates.md: Likewise.
	* config/frv/frv.c: Likewise.
	* config/frv/predicates.md: Likewise.
	* config/ft32/constraints.md: Likewise.
	* config/ft32/ft32.c: Likewise.
	* config/ft32/ft32.md: Likewise.
	* config/ft32/predicates.md: Likewise.
	* config/gcn/gcn.c: Likewise.
	* config/gcn/gcn.md: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/h8300/h8300.h: Likewise.
	* config/h8300/h8300.md: Likewise.
	* config/h8300/predicates.md: Likewise.
	* config/i386/i386-expand.c: Likewise.
	* config/i386/i386-features.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/i386.h: Likewise.
	* config/i386/i386.md: Likewise.
	* config/i386/predicates.md: Likewise.
	* config/i386/winnt.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/ia64/predicates.md: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/iq2000/iq2000.h: Likewise.
	* config/lm32/lm32.c: Likewise.
	* config/lm32/lm32.h: Likewise.
	* config/lm32/lm32.md: Likewise.
	* config/m32c/addsub.md: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32r/m32r.c: Likewise.
	* config/m32r/m32r.h: Likewise.
	* config/m32r/predicates.md: Likewise.
	* config/m68k/constraints.md: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/m68k/m68k.h: Likewise.
	* config/m68k/m68k.md: Likewise.
	* config/m68k/predicates.md: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/microblaze/microblaze.c: Likewise.
	* config/microblaze/microblaze.md: Likewise.
	* config/microblaze/predicates.md: Likewise.
	* config/mips/mips.c: Likewise.
	* config/mips/predicates.md: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mmix/predicates.md: Likewise.
	* config/mn10300/constraints.md: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/mn10300/mn10300.h: Likewise.
	* config/mn10300/mn10300.md: Likewise.
	* config/mn10300/predicates.md: Likewise.
	* config/moxie/constraints.md: Likewise.
	* config/moxie/moxie.c: Likewise.
	* config/msp430/msp430.c: Likewise.
	* config/nds32/nds32-md-auxiliary.c: Likewise.
	* config/nds32/nds32-predicates.c: Likewise.
	* config/nds32/nds32-utils.c: Likewise.
	* config/nds32/nds32.c: Likewise.
	* config/nds32/nds32.h: Likewise.
	* config/nios2/nios2.c: Likewise.
	* config/nvptx/nvptx.c: Likewise.
	* config/or1k/or1k.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/pa/pa.h: Likewise.
	* config/pa/pa.md: Likewise.
	* config/pa/predicates.md: Likewise.
	* config/riscv/riscv.c: Likewise.
	* config/rl78/constraints.md: Likewise.
	* config/rl78/rl78-expand.md: Likewise.
	* config/rl78/rl78.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/constraints.md: Likewise.
	* config/rx/rx.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/s390/s390.h: Likewise.
	* config/s390/s390.md: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.h: Likewise.
	* config/sh/sh.md: Likewise.
	* config/sparc/predicates.md: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/constraints.md: Likewise.
	* config/spu/spu.c: Likewise.
	* config/spu/spu.h: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/tilegx/predicates.md: Likewise.
	* config/tilegx/tilegx.c: Likewise.
	* config/tilegx/tilegx.md: Likewise.
	* config/tilepro/predicates.md: Likewise.
	* config/tilepro/tilepro.c: Likewise.
	* config/v850/constraints.md: Likewise.
	* config/v850/predicates.md: Likewise.
	* config/v850/v850.c: Likewise.
	* config/vax/predicates.md: Likewise.
	* config/vax/vax.c: Likewise.
	* config/vax/vax.md: Likewise.
	* config/xtensa/predicates.md: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* config/xtensa/xtensa.h: Likewise.
	* config/xtensa/xtensa.md: Likewise.
	* cselib.c: Likewise.
	* dbxout.c: Likewise.
	* dse.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2out.c: Likewise.
	* explow.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.c: Likewise.
	* ifcvt.c: Likewise.
	* lower-subreg.c: Likewise.
	* optabs.c: Likewise.
	* postreload.c: Likewise.
	* print-rtl.c: Likewise.
	* reginfo.c: Likewise.
	* reload.c: Likewise.
	* rtl.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* simplify-rtx.c: Likewise.
	* symtab.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* xcoffout.h: Likewise.

 163 files changed, 701 insertions(+), 701 deletions(-)

diff --git a/gcc/alias.c b/gcc/alias.c
index 24eaeae86f3..86ada16b6ae 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2222,7 +2222,7 @@ base_alias_check (rtx x, rtx x_base, rtx y, rtx y_base,
     return 1;
 
   /* Differing symbols not accessed via AND never alias.  */
-  if (GET_CODE (x_base) == SYMBOL_REF && GET_CODE (y_base) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x_base) && SYMBOL_REF_P (y_base))
     return compare_base_symbol_refs (x_base, y_base) != 0;
 
   if (GET_CODE (x_base) != ADDRESS && GET_CODE (y_base) != ADDRESS)
@@ -2444,7 +2444,7 @@ memrefs_conflict_p (poly_int64 xsize, rtx x, poly_int64 ysize, rtx y,
   else
     y = addr_side_effect_eval (y, maybe_lt (ysize, 0) ? -ysize : ysize, 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && GET_CODE (y) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_P (y))
     {
       int cmp = compare_base_symbol_refs (x,y);
 
@@ -2955,7 +2955,7 @@ true_dependence_1 (const_rtx mem, machine_mode mem_mode, rtx mem_addr,
 
   base = find_base_term (x_addr);
   if (base && (LABEL_REF_P (base)
-	       || (GET_CODE (base) == SYMBOL_REF
+	       || (SYMBOL_REF_P (base)
 		   && CONSTANT_POOL_ADDRESS_P (base))))
     return 0;
 
@@ -3064,7 +3064,7 @@ write_dependence_p (const_rtx mem,
   if (! writep
       && base
       && (LABEL_REF_P (base)
-	  || (GET_CODE (base) == SYMBOL_REF
+	  || (SYMBOL_REF_P (base)
 	      && CONSTANT_POOL_ADDRESS_P (base))))
     return 0;
 
diff --git a/gcc/asan.c b/gcc/asan.c
index a731bd490b4..9976f709a88 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -1805,7 +1805,7 @@ asan_protect_global (tree decl, bool ignore_decl_rtl_set_p)
     {
 
       rtl = DECL_RTL (decl);
-      if (!MEM_P (rtl) || GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF)
+      if (!MEM_P (rtl) || !SYMBOL_REF_P (XEXP (rtl, 0)))
 	return false;
       symbol = XEXP (rtl, 0);
 
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 695a9d191af..c01c9d4c789 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1796,7 +1796,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
   /* Ensure address is valid.  SYMBOL_REF is already valid, so no need,
      and we don't want to load it into a register as an optimization,
      because prepare_call_address already did it if it should be done.  */
-  if (GET_CODE (function) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (function))
     function = memory_address (FUNCTION_MODE, function);
 
   /* Generate the actual call instruction and save the return value.  */
diff --git a/gcc/calls.c b/gcc/calls.c
index 453308f1ca1..7be7d3b7211 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -217,7 +217,7 @@ prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value,
 {
   /* Make a valid memory address and copy constants through pseudo-regs,
      but not for a constant address if -fno-function-cse.  */
-  if (GET_CODE (funexp) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (funexp))
     {
       /* If it's an indirect call by descriptor, generate code to perform
 	 runtime identification of the pointer and load the descriptor.  */
@@ -393,7 +393,7 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
   /* Ensure address is valid.  SYMBOL_REF is already valid, so no need,
      and we don't want to load it into a register as an optimization,
      because prepare_call_address already did it if it should be done.  */
-  if (GET_CODE (funexp) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (funexp))
     funexp = memory_address (FUNCTION_MODE, funexp);
 
   funmem = gen_rtx_MEM (FUNCTION_MODE, funexp);
@@ -4286,7 +4286,7 @@ expand_call (tree exp, rtx target, int ignore)
 	    {
 	      datum = XEXP (DECL_RTL (fndecl), 0);
 	      gcc_assert (datum != NULL_RTX
-			  && GET_CODE (datum) == SYMBOL_REF);
+			  && SYMBOL_REF_P (datum));
 	    }
 	  last = last_call_insn ();
 	  add_reg_note (last, REG_CALL_DECL, datum);
@@ -5333,7 +5333,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
   if (flag_ipa_ra)
     {
       rtx datum = orgfun;
-      gcc_assert (GET_CODE (datum) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (datum));
       rtx_call_insn *last = last_call_insn ();
       add_reg_note (last, REG_CALL_DECL, datum);
     }
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index b9307631e1c..e6d3b00364f 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1209,7 +1209,7 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx_insn *i1, rtx_insn *i2)
       if (flag_sanitize & SANITIZE_ADDRESS)
 	{
 	  rtx call = get_call_rtx_from (i1);
-	  if (call && GET_CODE (XEXP (XEXP (call, 0), 0)) == SYMBOL_REF)
+	  if (call && SYMBOL_REF_P (XEXP (XEXP (call, 0), 0)))
 	    {
 	      rtx symbol = XEXP (XEXP (call, 0), 0);
 	      if (SYMBOL_REF_DECL (symbol)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index f4832c6d2bb..8f573140d62 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4411,7 +4411,7 @@ expand_debug_expr (tree exp)
 
 	  op0 = make_decl_rtl_for_debug (exp);
 	  if (!MEM_P (op0)
-	      || GET_CODE (XEXP (op0, 0)) != SYMBOL_REF
+	      || !SYMBOL_REF_P (XEXP (op0, 0))
 	      || SYMBOL_REF_DECL (XEXP (op0, 0)) != exp)
 	    return NULL;
 	}
diff --git a/gcc/combine.c b/gcc/combine.c
index f1e786d5678..1f43dd02dab 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4971,7 +4971,7 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
       /* If we have (mem (const ..)) or (mem (symbol_ref ...)), split it
 	 using LO_SUM and HIGH.  */
       if (HAVE_lo_sum && (GET_CODE (XEXP (x, 0)) == CONST
-			  || GET_CODE (XEXP (x, 0)) == SYMBOL_REF))
+			  || SYMBOL_REF_P (XEXP (x, 0))))
 	{
 	  machine_mode address_mode = get_address_mode (x);
 
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 4927ee9320f..dc39554a25b 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1717,7 +1717,7 @@ aarch64_simd_call_p (rtx_insn *insn)
   gcc_assert (CALL_P (insn));
   call = get_call_rtx_from (insn);
   symbol = XEXP (XEXP (call, 0), 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return false;
   fndecl = SYMBOL_REF_DECL (symbol);
   if (!fndecl)
@@ -1955,10 +1955,10 @@ tls_symbolic_operand_type (rtx addr)
     {
       poly_int64 addend;
       rtx sym = strip_offset (addr, &addend);
-      if (GET_CODE (sym) == SYMBOL_REF)
+      if (SYMBOL_REF_P (sym))
 	tls_kind = SYMBOL_REF_TLS_MODEL (sym);
     }
-  else if (GET_CODE (addr) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (addr))
     tls_kind = SYMBOL_REF_TLS_MODEL (addr);
 
   return tls_kind;
@@ -3290,7 +3290,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm,
 
   /* Check on what type of symbol it is.  */
   scalar_int_mode int_mode;
-  if ((GET_CODE (imm) == SYMBOL_REF
+  if ((SYMBOL_REF_P (imm)
        || LABEL_REF_P (imm)
        || GET_CODE (imm) == CONST
        || GET_CODE (imm) == CONST_POLY_INT)
@@ -6126,7 +6126,7 @@ aarch64_tls_referenced_p (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+      if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	return true;
       /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
 	 TLS offsets, not real symbol references.  */
@@ -6329,7 +6329,7 @@ aarch64_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
       return true;
 
   split_const (x, &base, &offset);
-  if (GET_CODE (base) == SYMBOL_REF || LABEL_REF_P (base))
+  if (SYMBOL_REF_P (base) || LABEL_REF_P (base))
     {
       if (aarch64_classify_symbol (base, INTVAL (offset))
 	  != SYMBOL_FORCE_TO_MEM)
@@ -6855,7 +6855,7 @@ aarch64_classify_address (struct aarch64_address_info *info,
 
 	  split_const (x, &sym, &addend);
 	  return ((LABEL_REF_P (sym)
-		   || (GET_CODE (sym) == SYMBOL_REF
+		   || (SYMBOL_REF_P (sym)
 		       && CONSTANT_POOL_ADDRESS_P (sym)
 		       && aarch64_pcrelative_literal_loads)));
 	}
@@ -6870,7 +6870,7 @@ aarch64_classify_address (struct aarch64_address_info *info,
 	{
 	  rtx sym, offs;
 	  split_const (info->offset, &sym, &offs);
-	  if (GET_CODE (sym) == SYMBOL_REF
+	  if (SYMBOL_REF_P (sym)
 	      && (aarch64_classify_symbol (sym, INTVAL (offs))
 		  == SYMBOL_SMALL_ABSOLUTE))
 	    {
@@ -6932,7 +6932,7 @@ aarch64_symbolic_address_p (rtx x)
   rtx offset;
 
   split_const (x, &x, &offset);
-  return GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x);
+  return SYMBOL_REF_P (x) || LABEL_REF_P (x);
 }
 
 /* Classify the base of symbolic expression X.  */
@@ -7654,7 +7654,7 @@ aarch64_print_operand (FILE *f, rtx x, int code)
 
 	case CONST:
 	  if (GET_CODE (XEXP (x, 0)) == PLUS
-	      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+	      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0)))
 	    {
 	      output_addr_const (f, x);
 	      break;
@@ -8408,7 +8408,7 @@ aarch64_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x,
 
   /* If we have to disable direct literal pool loads and stores because the
      function is too big, then we need a scratch register.  */
-  if (MEM_P (x) && GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)
+  if (MEM_P (x) && SYMBOL_REF_P (x) && CONSTANT_POOL_ADDRESS_P (x)
       && (SCALAR_FLOAT_MODE_P (GET_MODE (x))
 	  || targetm.vector_mode_supported_p (GET_MODE (x)))
       && !aarch64_pcrelative_literal_loads)
@@ -9067,7 +9067,7 @@ aarch64_address_cost (rtx x,
 
   if (!aarch64_classify_address (&info, x, mode, false))
     {
-      if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF)
+      if (GET_CODE (x) == CONST || SYMBOL_REF_P (x))
 	{
 	  /* This is a CONST or SYMBOL ref which will be split
 	     in a different way depending on the code model in use.
@@ -13036,7 +13036,7 @@ aarch64_tls_symbol_p (rtx x)
   if (! TARGET_HAVE_TLS)
     return false;
 
-  if (GET_CODE (x) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (x))
     return false;
 
   return SYMBOL_REF_TLS_MODEL (x) != 0;
@@ -13112,7 +13112,7 @@ aarch64_classify_symbol (rtx x, HOST_WIDE_INT offset)
 	}
     }
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     {
       if (aarch64_tls_symbol_p (x))
 	return aarch64_classify_tls_symbol (x);
@@ -13185,10 +13185,10 @@ aarch64_constant_address_p (rtx x)
 bool
 aarch64_legitimate_pic_operand_p (rtx x)
 {
-  if (GET_CODE (x) == SYMBOL_REF
+  if (SYMBOL_REF_P (x)
       || (GET_CODE (x) == CONST
 	  && GET_CODE (XEXP (x, 0)) == PLUS
-	  && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF))
+	  && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))))
      return false;
 
   return true;
@@ -14764,7 +14764,7 @@ aarch64_mov_operand_p (rtx x, machine_mode mode)
   if (VECTOR_MODE_P (GET_MODE (x)))
     return aarch64_simd_valid_immediate (x, NULL);
 
-  if (GET_CODE (x) == SYMBOL_REF && mode == DImode && CONSTANT_ADDRESS_P (x))
+  if (SYMBOL_REF_P (x) && mode == DImode && CONSTANT_ADDRESS_P (x))
     return true;
 
   if (aarch64_sve_cnt_immediate_p (x))
diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md
index ef01faed19c..ca33b0fda1f 100644
--- a/gcc/config/aarch64/predicates.md
+++ b/gcc/config/aarch64/predicates.md
@@ -264,7 +264,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       op = XEXP (op, 0);
@@ -286,7 +286,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       op = XEXP (op, 0);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index f0e4061fb00..46cd61b472a 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -654,7 +654,7 @@ tls_symbolic_operand_1 (rtx op, int size, int unspec)
     return 0;
   op = XVECEXP (op, 0, 0);
 
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return 0;
 
   switch (SYMBOL_REF_TLS_MODEL (op))
@@ -738,7 +738,7 @@ tls_symbolic_operand_type (rtx symbol)
 {
   enum tls_model model;
 
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return TLS_MODEL_NONE;
   model = SYMBOL_REF_TLS_MODEL (symbol);
 
@@ -829,11 +829,11 @@ alpha_linkage_symbol_p (const char *symname)
 }
 
 #define LINKAGE_SYMBOL_REF_P(X) \
-  ((GET_CODE (X) == SYMBOL_REF   \
+  ((SYMBOL_REF_P (X)   \
     && alpha_linkage_symbol_p (XSTR (X, 0))) \
    || (GET_CODE (X) == CONST                 \
        && GET_CODE (XEXP (X, 0)) == PLUS     \
-       && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \
+       && SYMBOL_REF_P (XEXP (XEXP (X, 0), 0)) \
        && alpha_linkage_symbol_p (XSTR (XEXP (XEXP (X, 0), 0), 0))))
 #endif
 
@@ -2143,7 +2143,7 @@ alpha_legitimate_constant_p (machine_mode mode, rtx x)
       else
 	return true;
 
-      if (GET_CODE (x) != SYMBOL_REF)
+      if (!SYMBOL_REF_P (x))
 	return true;
       /* FALLTHRU */
 
@@ -5455,7 +5455,7 @@ alpha_print_operand_address (FILE *file, machine_mode /*mode*/, rtx addr)
     case CONST:
       gcc_assert(TARGET_ABI_OPEN_VMS || this_is_asm_operands);
       gcc_assert (GET_CODE (XEXP (addr, 0)) == PLUS
-		  && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF);
+		  && SYMBOL_REF_P (XEXP (XEXP (addr, 0), 0)));
       fprintf (file, "%s+" HOST_WIDE_INT_PRINT_DEC,
 	       XSTR (XEXP (XEXP (addr, 0), 0), 0),
 	       INTVAL (XEXP (XEXP (addr, 0), 1)));
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index b195eb9c698..2cd36b8cc82 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -3303,7 +3303,7 @@
      both cases.  */
 
   emit_move_insn (gen_rtx_REG (DImode, 25), operands[1]);
-  if (GET_CODE (operands[0]) == SYMBOL_REF)
+  if (SYMBOL_REF_P (operands[0]))
     {
       operands[2] = const0_rtx;
     }
@@ -3378,7 +3378,7 @@
      both cases.  */
 
   emit_move_insn (gen_rtx_REG (DImode, 25), operands[2]);
-  if (GET_CODE (operands[1]) == SYMBOL_REF)
+  if (SYMBOL_REF_P (operands[1]))
     {
       operands[3] = const0_rtx;
     }
diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md
index f96c16b533c..3e756353600 100644
--- a/gcc/config/alpha/predicates.md
+++ b/gcc/config/alpha/predicates.md
@@ -299,7 +299,7 @@
   if (LABEL_REF_P (op))
     return 1;
 
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return 0;
 
   return (SYMBOL_REF_LOCAL_P (op)
@@ -325,7 +325,7 @@
       op = XEXP (XEXP (op, 0), 0);
     }
 
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return false;
 
   /* ??? There's no encode_section_info equivalent for the rtl
@@ -368,7 +368,7 @@
       && CONST_INT_P (XEXP (XEXP (op, 0), 1)))
     op = XEXP (XEXP (op, 0), 0);
 
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return 0;
 
   return ((!SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_WEAK (op))
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 13cb4706ae5..ee10dd39a38 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -470,7 +470,7 @@ legitimate_small_data_address_p (rtx x)
       return SYMBOL_REF_SMALL_P (x);
     case PLUS:
       {
-	bool p0 = (GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+	bool p0 = (SYMBOL_REF_P (XEXP (x, 0)))
 	  && SYMBOL_REF_SMALL_P (XEXP (x, 0));
 	bool p1 = CONST_INT_P (XEXP (x, 1))
 	  && (INTVAL (XEXP (x, 1)) <= g_switch_value);
@@ -557,7 +557,7 @@ legitimate_offset_address_p (machine_mode mode, rtx x, bool index, bool strict)
 
   /* Check for [Rx + symbol].  */
   if (!flag_pic
-      && (GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
+      && (SYMBOL_REF_P (XEXP (x, 1)))
       /* Avoid this type of address for double or larger modes.  */
       && (GET_MODE_SIZE (mode) <= 4)
       /* Avoid small data which ends in something like GP +
@@ -2263,7 +2263,7 @@ gen_compare_reg (rtx comparison, machine_mode omode)
 	  else
 	    x = copy_to_mode_reg (SImode, x);
 	}
-      if (GET_CODE (y) == SYMBOL_REF && flag_pic)
+      if (SYMBOL_REF_P (y) && flag_pic)
 	y = copy_to_mode_reg (SImode, y);
     }
   else
@@ -4634,7 +4634,7 @@ arc_print_operand (FILE *file, rtx x, int code)
       return;
     case 'j':
     case 'S' :
-      if (GET_CODE (x) == SYMBOL_REF
+      if (SYMBOL_REF_P (x)
 	  && arc_is_jli_call_p (x))
 	{
 	  if (SYMBOL_REF_DECL (x))
@@ -4659,7 +4659,7 @@ arc_print_operand (FILE *file, rtx x, int code)
 	    arc_add_jli_section (x);
 	  return;
 	}
-      if (GET_CODE (x) == SYMBOL_REF
+      if (SYMBOL_REF_P (x)
 	  && arc_is_secure_call_p (x))
 	{
 	  /* No special treatment for secure functions.  */
@@ -4845,7 +4845,7 @@ arc_print_operand (FILE *file, rtx x, int code)
 	}
       output_operand_lossage ("invalid operand to %%O code"); return;
     case 'o':
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  assemble_name (file, XSTR (x, 0));
 	  return;
@@ -5003,7 +5003,7 @@ arc_print_operand_address (FILE *file , rtx addr)
 	    break;
 	  }
 	gcc_assert (GET_CODE (c) == PLUS);
-	gcc_assert (GET_CODE (XEXP (c, 0)) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (XEXP (c, 0)));
 	gcc_assert (CONST_INT_P (XEXP (c, 1)));
 
 	output_address (VOIDmode, XEXP (addr, 0));
@@ -6031,7 +6031,7 @@ arc_legitimate_pic_addr_p (rtx addr)
       && XINT (addr, 1) != UNSPEC_TLS_IE)
     return false;
 
-  if (GET_CODE (XVECEXP (addr, 0, 0)) != SYMBOL_REF
+  if (!SYMBOL_REF_P (XVECEXP (addr, 0, 0))
       && !LABEL_REF_P (XVECEXP (addr, 0, 0)))
     return false;
 
@@ -6048,7 +6048,7 @@ symbolic_reference_mentioned_p (rtx op)
   register const char *fmt;
   register int i;
 
-  if (GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op))
+  if (SYMBOL_REF_P (op) || LABEL_REF_P (op))
     return true;
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -6084,7 +6084,7 @@ arc_raw_symbolic_reference_mentioned_p (rtx op, bool skip_local)
   if (GET_CODE(op) == UNSPEC)
     return false;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     {
       if (SYMBOL_REF_TLS_MODEL (op))
 	return true;
@@ -6677,7 +6677,7 @@ arc_legitimate_address_p (machine_mode mode, rtx x, bool strict)
   if (!flag_pic && optimize_size && !reload_completed
       && (GET_CODE (x) == CONST)
       && (GET_CODE (XEXP (x, 0)) == PLUS)
-      && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+      && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0)))
       && SYMBOL_REF_TLS_MODEL (XEXP (XEXP (x, 0), 0)) == 0
       && !SYMBOL_REF_FUNCTION_P (XEXP (XEXP (x, 0), 0)))
     {
@@ -7528,7 +7528,7 @@ arc_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
 bool
 arc_is_longcall_p (rtx sym_ref)
 {
-  if (GET_CODE (sym_ref) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (sym_ref))
     return false;
 
   return (SYMBOL_REF_LONG_CALL_P (sym_ref)
@@ -7543,7 +7543,7 @@ arc_is_longcall_p (rtx sym_ref)
 bool
 arc_is_shortcall_p (rtx sym_ref)
 {
-  if (GET_CODE (sym_ref) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (sym_ref))
     return false;
 
   return (SYMBOL_REF_SHORT_CALL_P (sym_ref)
@@ -8231,7 +8231,7 @@ jli_call_scan (void)
 	pat = SET_SRC (pat);
 
       pat = XEXP (XEXP (pat, 0), 0);
-      if (GET_CODE (pat) == SYMBOL_REF
+      if (SYMBOL_REF_P (pat)
 	  && arc_is_jli_call_p (pat))
 	arc_add_jli_section (pat);
     }
@@ -9168,7 +9168,7 @@ prepare_move_operands (rtx *operands, machine_mode mode)
 	  else
 	    {
 	      tmp = XEXP (operands[1], 0);
-	      gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
+	      gcc_assert (SYMBOL_REF_P (tmp));
 	    }
 	  /* Load operation.  */
 	  gcc_assert (REG_P (operands[0]));
@@ -9180,7 +9180,7 @@ prepare_move_operands (rtx *operands, machine_mode mode)
 	}
     }
 
-  if (GET_CODE (operands[1]) == SYMBOL_REF)
+  if (SYMBOL_REF_P (operands[1]))
     {
       enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]);
       if (MEM_P (operands[0]))
@@ -9688,7 +9688,7 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED,
 
   if (GET_CODE (addr) == PLUS
       && CONST_INT_P (XEXP (addr, 1))
-      && ((GET_CODE (XEXP (addr, 0)) == SYMBOL_REF
+      && ((SYMBOL_REF_P (XEXP (addr, 0))
 	   && !SYMBOL_REF_FUNCTION_P (XEXP (addr, 0)))
 	  || (REG_P (XEXP (addr, 0))
 	      && (INTVAL (XEXP (addr, 1)) & 252))))
@@ -9706,7 +9706,7 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED,
       addr = plus_constant (Pmode, force_reg (Pmode, inner), offs - upper);
       x = addr;
     }
-  else if (GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_FUNCTION_P (addr))
+  else if (SYMBOL_REF_P (addr) && !SYMBOL_REF_FUNCTION_P (addr))
     x = force_reg (Pmode, x);
   if (memory_address_p ((machine_mode) mode, x))
      return x;
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 94101cff349..e680c88f586 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -841,7 +841,7 @@ extern int arc_initial_elimination_offset(int from, int to);
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X)					\
   (flag_pic ? (arc_legitimate_pic_addr_p (X) || LABEL_P (X)):	\
-   (LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF	\
+   (LABEL_REF_P (X) || SYMBOL_REF_P (X)	\
     || CONST_INT_P (X) || GET_CODE (X) == CONST))
 
 /* Is the argument a const_int rtx, containing an exact power of 2 */
diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md
index a5537ec73e4..7195ca3e6f0 100644
--- a/gcc/config/arc/predicates.md
+++ b/gcc/config/arc/predicates.md
@@ -143,7 +143,7 @@
 		  && (size <= 1 || size > 4
 		      || (INTVAL (x) & (size - 1)) != 0
 		      || !SMALL_INT (INTVAL (x) / size)));
-	else if (GET_CODE (x) == SYMBOL_REF)
+	else if (SYMBOL_REF_P (x))
 	  return TARGET_NO_SDATA_SET || !SYMBOL_REF_SMALL_P (x);
 	return 0;
       }
@@ -367,7 +367,7 @@
 	    && (GET_CODE (XEXP (addr, 0)) == MULT
 		|| (!CONST_INT_P (XEXP (addr, 1))
 		    && (TARGET_NO_SDATA_SET
-			|| GET_CODE (XEXP (addr, 1)) != SYMBOL_REF
+			|| !SYMBOL_REF_P (XEXP (addr, 1))
 			|| !SYMBOL_REF_SMALL_P (XEXP (addr, 1))))))
 	  return 0;
 	if ((GET_CODE (addr) == PRE_MODIFY || GET_CODE (addr) == POST_MODIFY)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 2f8d68507ec..d3dd54c2990 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -7406,10 +7406,10 @@ arm_function_ok_for_sibcall (tree decl, tree exp)
 int
 legitimate_pic_operand_p (rtx x)
 {
-  if (GET_CODE (x) == SYMBOL_REF
+  if (SYMBOL_REF_P (x)
       || (GET_CODE (x) == CONST
 	  && GET_CODE (XEXP (x, 0)) == PLUS
-	  && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF))
+	  && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))))
     return 0;
 
   return 1;
@@ -7517,7 +7517,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg,
 {
   gcc_assert (compute_now == (pic_reg != NULL_RTX));
 
-  if (GET_CODE (orig) == SYMBOL_REF
+  if (SYMBOL_REF_P (orig)
       || LABEL_REF_P (orig))
     {
       if (reg == 0)
@@ -7536,7 +7536,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg,
 	 may be overridden by a non-weak definition at link time.  */
       rtx_insn *insn;
       if ((LABEL_REF_P (orig)
-	   || (GET_CODE (orig) == SYMBOL_REF
+	   || (SYMBOL_REF_P (orig)
 	       && SYMBOL_REF_LOCAL_P (orig)
 	       && (SYMBOL_REF_DECL (orig)
 		   ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1)))
@@ -7957,7 +7957,7 @@ can_avoid_literal_pool_for_label_p (rtx x)
      (set (reg r0) (mem (reg r0))).
      No extra register is required, and (mem (reg r0)) won't cause the use
      of literal pools.  */
-  if (arm_disable_literal_pool && GET_CODE (x) == SYMBOL_REF
+  if (arm_disable_literal_pool && SYMBOL_REF_P (x)
       && CONSTANT_POOL_ADDRESS_P (x))
     return 1;
   return 0;
@@ -8330,7 +8330,7 @@ thumb1_legitimate_address_p (machine_mode mode, rtx x, int strict_p)
 
   /* This is PC relative data before arm_reorg runs.  */
   else if (GET_MODE_SIZE (mode) >= 4 && CONSTANT_P (x)
-	   && GET_CODE (x) == SYMBOL_REF
+	   && SYMBOL_REF_P (x)
            && CONSTANT_POOL_ADDRESS_P (x) && !flag_pic)
     return 1;
 
@@ -8397,7 +8397,7 @@ thumb1_legitimate_address_p (machine_mode mode, rtx x, int strict_p)
 
   else if (GET_MODE_CLASS (mode) != MODE_FLOAT
 	   && GET_MODE_SIZE (mode) == 4
-	   && GET_CODE (x) == SYMBOL_REF
+	   && SYMBOL_REF_P (x)
 	   && CONSTANT_POOL_ADDRESS_P (x)
 	   && ! (flag_pic
 		 && symbol_mentioned_p (get_pool_constant (x))
@@ -8679,7 +8679,7 @@ arm_legitimize_address (rtx x, rtx orig_x, machine_mode mode)
 	  x = XEXP (XEXP (x, 0), 0);
 	}
 
-      if (GET_CODE (x) != SYMBOL_REF)
+      if (!SYMBOL_REF_P (x))
 	return x;
 
       gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0);
@@ -8890,7 +8890,7 @@ arm_tls_referenced_p (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+      if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	{
 	  /* ARM currently does not provide relocations to encode TLS variables
 	     into AArch32 instructions, only data, so there is no way to
@@ -8936,7 +8936,7 @@ thumb_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
   return (CONST_INT_P (x)
 	  || CONST_DOUBLE_P (x)
 	  || CONSTANT_ADDRESS_P (x)
-	  || (TARGET_HAVE_MOVT && GET_CODE (x) == SYMBOL_REF)
+	  || (TARGET_HAVE_MOVT && SYMBOL_REF_P (x))
 	  || flag_pic);
 }
 
@@ -9082,7 +9082,7 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
       /* Memory costs quite a lot for the first word, but subsequent words
 	 load at the equivalent of a single insn each.  */
       return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
-	      + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
+	      + ((SYMBOL_REF_P (x) && CONSTANT_POOL_ADDRESS_P (x))
 		 ? 4 : 0));
 
     case IF_THEN_ELSE:
@@ -9237,7 +9237,7 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
       return (COSTS_N_INSNS (1)
 	      + COSTS_N_INSNS (1)
 		* ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
-              + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
+              + ((SYMBOL_REF_P (x) && CONSTANT_POOL_ADDRESS_P (x))
                  ? COSTS_N_INSNS (1) : 0));
 
     case IF_THEN_ELSE:
@@ -11742,7 +11742,7 @@ arm_adjust_cost (rtx_insn *insn, int dep_type, rtx_insn *dep, int cost,
 	 constant pool are cached, and that others will miss.  This is a
 	 hack.  */
 
-      if ((GET_CODE (src_mem) == SYMBOL_REF
+      if ((SYMBOL_REF_P (src_mem)
 	   && CONSTANT_POOL_ADDRESS_P (src_mem))
 	  || reg_mentioned_p (stack_pointer_rtx, src_mem)
 	  || reg_mentioned_p (frame_pointer_rtx, src_mem)
@@ -12825,7 +12825,7 @@ symbol_mentioned_p (rtx x)
   const char * fmt;
   int i;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return 1;
 
   /* UNSPEC_TLS entries for a symbol include the SYMBOL_REF, but they
@@ -16931,7 +16931,7 @@ note_invalid_constants (rtx_insn *insn, HOST_WIDE_INT address, int do_pushes)
 				   recog_data.operand_mode[opno], op);
 	    }
 	  else if (MEM_P (op)
-		   && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+		   && SYMBOL_REF_P (XEXP (op, 0))
 		   && CONSTANT_POOL_ADDRESS_P (XEXP (op, 0)))
 	    {
 	      if (do_pushes)
@@ -18215,7 +18215,7 @@ arm_emit_call_insn (rtx pat, rtx addr, bool sibcall)
   if (TARGET_VXWORKS_RTP
       && flag_pic
       && !sibcall
-      && GET_CODE (addr) == SYMBOL_REF
+      && SYMBOL_REF_P (addr)
       && (SYMBOL_REF_DECL (addr)
 	  ? !targetm.binds_local_p (SYMBOL_REF_DECL (addr))
 	  : !SYMBOL_REF_LOCAL_P (addr)))
@@ -22298,7 +22298,7 @@ arm_print_operand (FILE *stream, rtx x, int code)
 
 	case CONST:
 	  if (GET_CODE (XEXP (x, 0)) == PLUS
-	      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+	      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0)))
 	    {
 	      output_addr_const (stream, x);
 	      break;
@@ -23034,7 +23034,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
       /* Mark symbols as position independent.  We only do this in the
 	 .text segment, not in the .data segment.  */
       if (NEED_GOT_RELOC && flag_pic && making_const_table &&
-	  (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x)))
+	  (SYMBOL_REF_P (x) || LABEL_REF_P (x)))
 	{
 	  /* See legitimize_pic_address for an explanation of the
 	     TARGET_VXWORKS_RTP check.  */
@@ -23042,7 +23042,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
 	     they may be overridden by a non-weak definition at link
 	     time.  */
 	  if (!arm_pic_data_is_text_relative
-	      || (GET_CODE (x) == SYMBOL_REF
+	      || (SYMBOL_REF_P (x)
 		  && (!SYMBOL_REF_LOCAL_P (x)
 		      || (SYMBOL_REF_DECL (x)
 			  ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0))))
@@ -29914,7 +29914,7 @@ arm_valid_symbolic_address_p (rtx addr)
   if (target_word_relocations)
     return false;
 
-  if (GET_CODE (tmp) == SYMBOL_REF || LABEL_REF_P (tmp))
+  if (SYMBOL_REF_P (tmp) || LABEL_REF_P (tmp))
     return true;
 
   /* (const (plus: symbol_ref const_int))  */
@@ -29926,7 +29926,7 @@ arm_valid_symbolic_address_p (rtx addr)
       xop0 = XEXP (tmp, 0);
       xop1 = XEXP (tmp, 1);
 
-      if (GET_CODE (xop0) == SYMBOL_REF && CONST_INT_P (xop1))
+      if (SYMBOL_REF_P (xop0) && CONST_INT_P (xop1))
 	  return IN_RANGE (INTVAL (xop1), -0x8000, 0x7fff);
     }
 
@@ -30643,11 +30643,11 @@ arm_const_not_ok_for_debug_p (rtx p)
     return true;
   if (GET_CODE (p) == MINUS)
     {
-      if (GET_CODE (XEXP (p, 1)) == SYMBOL_REF)
+      if (SYMBOL_REF_P (XEXP (p, 1)))
 	{
 	  decl_op1 = SYMBOL_REF_DECL (XEXP (p, 1));
 	  if (decl_op1
-	      && GET_CODE (XEXP (p, 0)) == SYMBOL_REF
+	      && SYMBOL_REF_P (XEXP (p, 0))
 	      && (decl_op0 = SYMBOL_REF_DECL (XEXP (p, 0))))
 	    {
 	      if ((VAR_P (decl_op1)
@@ -30675,7 +30675,7 @@ extern bool
 arm_is_constant_pool_ref (rtx x)
 {
   return (MEM_P (x)
-	  && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (x, 0))
 	  && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
 }
 
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index b2a2bc8cf39..04d04f33da4 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1682,7 +1682,7 @@ enum arm_auto_incmodes
 /* XXX We can address any constant, eventually...  */
 /* ??? Should the TARGET_ARM here also apply to thumb2?  */
 #define CONSTANT_ADDRESS_P(X)  			\
-  (GET_CODE (X) == SYMBOL_REF 			\
+  (SYMBOL_REF_P (X) 			\
    && (CONSTANT_POOL_ADDRESS_P (X)		\
        || (TARGET_ARM && optimize > 0 && SYMBOL_REF_FLAG (X))))
 
@@ -1954,7 +1954,7 @@ extern unsigned arm_pic_register;
 #define LEGITIMATE_PIC_OPERAND_P(X)					\
 	(!(symbol_mentioned_p (X)					\
 	   || label_mentioned_p (X)					\
-	   || (GET_CODE (X) == SYMBOL_REF				\
+	   || (SYMBOL_REF_P (X)				\
 	       && CONSTANT_POOL_ADDRESS_P (X)				\
 	       && (symbol_mentioned_p (get_pool_constant (X))		\
 		   || label_mentioned_p (get_pool_constant (X)))))	\
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 5eadcc58df6..4484ae0e51f 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -6133,7 +6133,7 @@
    && TARGET_HAVE_MOVT
    && arm_disable_literal_pool
    && reload_completed
-   && GET_CODE (operands[1]) == SYMBOL_REF"
+   && SYMBOL_REF_P (operands[1])"
   [(clobber (const_int 0))]
   "
     int offset = INTVAL (operands[2]);
@@ -6161,7 +6161,7 @@
 (define_split
   [(set (match_operand:SI 0 "arm_general_register_operand" "")
        (match_operand:SI 1 "general_operand" ""))]
-  "TARGET_USE_MOVT && GET_CODE (operands[1]) == SYMBOL_REF
+  "TARGET_USE_MOVT && SYMBOL_REF_P (operands[1])
    && !target_word_relocations
    && !arm_tls_referenced_p (operands[1])"
   [(clobber (const_int 0))]
@@ -8155,7 +8155,7 @@
        32-bit address of the callee into a register before performing the
        branch and link.  */
     callee = XEXP (operands[0], 0);
-    if (GET_CODE (callee) == SYMBOL_REF
+    if (SYMBOL_REF_P (callee)
 	? arm_is_long_call_p (SYMBOL_REF_DECL (callee))
 	: !REG_P (callee))
       XEXP (operands[0], 0) = force_reg (Pmode, callee);
@@ -8243,7 +8243,7 @@
        32-bit address of the callee into a register before performing the
        branch and link.  */
     callee = XEXP (operands[1], 0);
-    if (GET_CODE (callee) == SYMBOL_REF
+    if (SYMBOL_REF_P (callee)
 	? arm_is_long_call_p (SYMBOL_REF_DECL (callee))
 	: !REG_P (callee))
       XEXP (operands[1], 0) = force_reg (Pmode, callee);
@@ -8324,7 +8324,7 @@
    (clobber (reg:SI LR_REGNUM))]
   "TARGET_32BIT
    && !SIBLING_CALL_P (insn)
-   && (GET_CODE (operands[0]) == SYMBOL_REF)
+   && (SYMBOL_REF_P (operands[0]))
    && !arm_is_long_call_p (SYMBOL_REF_DECL (operands[0]))"
   "*
   {
@@ -8348,7 +8348,7 @@
    (clobber (reg:SI LR_REGNUM))]
   "TARGET_32BIT
    && !SIBLING_CALL_P (insn)
-   && (GET_CODE (operands[1]) == SYMBOL_REF)
+   && (SYMBOL_REF_P (operands[1]))
    && !arm_is_long_call_p (SYMBOL_REF_DECL (operands[1]))"
   "*
   {
@@ -8382,8 +8382,8 @@
     rtx pat;
 
     if ((!REG_P (XEXP (operands[0], 0))
-	 && GET_CODE (XEXP (operands[0], 0)) != SYMBOL_REF)
-	|| (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
+	 && !SYMBOL_REF_P (XEXP (operands[0], 0)))
+	|| (SYMBOL_REF_P (XEXP (operands[0], 0))
 	    && arm_is_long_call_p (SYMBOL_REF_DECL (XEXP (operands[0], 0)))))
      XEXP (operands[0], 0) = force_reg (SImode, XEXP (operands[0], 0));
 
@@ -8415,8 +8415,8 @@
     rtx pat;
 
     if ((!REG_P (XEXP (operands[1], 0))
-	 && GET_CODE (XEXP (operands[1], 0)) != SYMBOL_REF)
-	|| (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
+	 && !SYMBOL_REF_P (XEXP (operands[1], 0)))
+	|| (SYMBOL_REF_P (XEXP (operands[1], 0))
 	    && arm_is_long_call_p (SYMBOL_REF_DECL (XEXP (operands[1], 0)))))
      XEXP (operands[1], 0) = force_reg (SImode, XEXP (operands[1], 0));
 
diff --git a/gcc/config/arm/thumb1.md b/gcc/config/arm/thumb1.md
index 13ac28d0d85..61c30f2567b 100644
--- a/gcc/config/arm/thumb1.md
+++ b/gcc/config/arm/thumb1.md
@@ -1816,7 +1816,7 @@
    (use (match_operand 2 "" ""))
    (clobber (reg:SI LR_REGNUM))]
   "TARGET_THUMB1
-   && GET_CODE (operands[0]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[0])
    && !arm_is_long_call_p (SYMBOL_REF_DECL (operands[0]))"
   "bl\\t%a0"
   [(set_attr "length" "4")
@@ -1830,7 +1830,7 @@
    (use (match_operand 3 "" ""))
    (clobber (reg:SI LR_REGNUM))]
   "TARGET_THUMB1
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && !arm_is_long_call_p (SYMBOL_REF_DECL (operands[1]))"
   "bl\\t%a1"
   [(set_attr "length" "4")
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index cf0986b2f13..14f63496e93 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -138,14 +138,14 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
   rtx addr = orig;
   rtx new_rtx = orig;
 
-  if (GET_CODE (addr) == SYMBOL_REF || LABEL_REF_P (addr))
+  if (SYMBOL_REF_P (addr) || LABEL_REF_P (addr))
     {
       int unspec;
       rtx tmp;
 
       if (TARGET_ID_SHARED_LIBRARY)
 	unspec = UNSPEC_MOVE_PIC;
-      else if (GET_CODE (addr) == SYMBOL_REF
+      else if (SYMBOL_REF_P (addr)
 	       && SYMBOL_REF_FUNCTION_P (addr))
 	unspec = UNSPEC_FUNCDESC_GOT17M4;
       else
@@ -1097,7 +1097,7 @@ bfin_expand_prologue (void)
 	  emit_move_insn (p2reg, gen_rtx_MEM (Pmode, p2reg));
 	  lim = p2reg;
 	}
-      if (GET_CODE (lim) == SYMBOL_REF)
+      if (SYMBOL_REF_P (lim))
 	{
 	  if (TARGET_ID_SHARED_LIBRARY)
 	    {
@@ -1791,7 +1791,7 @@ symbolic_reference_mentioned_p (rtx op)
   register const char *fmt;
   register int i;
 
-  if (GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op))
+  if (SYMBOL_REF_P (op) || LABEL_REF_P (op))
     return 1;
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -1936,7 +1936,7 @@ expand_move (rtx *operands, machine_mode mode)
     emit_pic_move (operands, mode);
   else if (mode == SImode && GET_CODE (op) == CONST
 	   && GET_CODE (XEXP (op, 0)) == PLUS
-	   && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+	   && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 	   && !targetm.legitimate_constant_p (mode, op))
     {
       rtx dest = operands[0];
@@ -1998,7 +1998,7 @@ split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[])
 bool
 bfin_longcall_p (rtx op, int call_cookie)
 {
-  gcc_assert (GET_CODE (op) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (op));
   if (SYMBOL_REF_WEAK (op))
     return 1;
   if (call_cookie & CALL_SHORT)
@@ -2031,7 +2031,7 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
 
   /* Static functions and indirect calls don't need the pic register.  */
   if (!TARGET_FDPIC && flag_pic
-      && GET_CODE (callee) == SYMBOL_REF
+      && SYMBOL_REF_P (callee)
       && !SYMBOL_REF_LOCAL_P (callee))
     use_reg (&use, pic_offset_table_rtx);
 
@@ -2049,7 +2049,7 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
 				 DECL_ATTRIBUTES (cfun->decl)) != NULL_TREE)
 	caller_in_sram = 2;
 
-      if (GET_CODE (callee) == SYMBOL_REF
+      if (SYMBOL_REF_P (callee)
 	  && SYMBOL_REF_DECL (callee) && DECL_P (SYMBOL_REF_DECL (callee)))
 	{
 	  if (lookup_attribute
@@ -2062,14 +2062,14 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
 	    callee_in_sram = 2;
 	}
 
-      if (GET_CODE (callee) != SYMBOL_REF
+      if (!SYMBOL_REF_P (callee)
 	  || bfin_longcall_p (callee, INTVAL (cookie))
-	  || (GET_CODE (callee) == SYMBOL_REF
+	  || (SYMBOL_REF_P (callee)
 	      && !SYMBOL_REF_LOCAL_P (callee)
 	      && TARGET_INLINE_PLT)
 	  || caller_in_sram != callee_in_sram
 	  || (caller_in_sram && callee_in_sram
-	      && (GET_CODE (callee) != SYMBOL_REF
+	      && (!SYMBOL_REF_P (callee)
 		  || !SYMBOL_REF_LOCAL_P (callee))))
 	{
 	  rtx addr = callee;
@@ -2088,8 +2088,8 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
       nelts++;
     }
   else if ((!register_no_elim_operand (callee, Pmode)
-	    && GET_CODE (callee) != SYMBOL_REF)
-	   || (GET_CODE (callee) == SYMBOL_REF
+	    && !SYMBOL_REF_P (callee))
+	   || (SYMBOL_REF_P (callee)
 	       && ((TARGET_ID_SHARED_LIBRARY && !TARGET_LEAF_ID_SHARED_LIBRARY)
 		   || bfin_longcall_p (callee, INTVAL (cookie)))))
     {
@@ -2801,7 +2801,7 @@ bfin_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
 
   sym = XEXP (x, 0);
   x = XEXP (x, 1);
-  if (GET_CODE (sym) != SYMBOL_REF
+  if (!SYMBOL_REF_P (sym)
       || !CONST_INT_P (x))
     return true;
   offset = INTVAL (x);
@@ -4946,7 +4946,7 @@ bfin_assemble_integer (rtx value, unsigned int size, int aligned_p)
 {
   if (TARGET_FDPIC && size == UNITS_PER_WORD)
     {
-      if (GET_CODE (value) == SYMBOL_REF
+      if (SYMBOL_REF_P (value)
 	  && SYMBOL_REF_FUNCTION_P (value))
 	{
 	  fputs ("\t.picptr\tfuncdesc(", asm_out_file);
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 2ee2abbd226..d4babb2f89d 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -782,7 +782,7 @@ typedef struct {
 #define LEGITIMATE_PIC_OPERAND_P(X) ! SYMBOLIC_CONST (X)
 
 #define SYMBOLIC_CONST(X)	\
-(GET_CODE (X) == SYMBOL_REF						\
+(SYMBOL_REF_P (X)						\
  || LABEL_REF_P (X)						\
  || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index 627b5a4b47c..d93ddc45363 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -2077,7 +2077,7 @@
    (use (match_operand 3 "" ""))
    (clobber (reg:SI REG_RETS))]
   "! SIBLING_CALL_P (insn)
-   && GET_CODE (operands[0]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[0])
    && !bfin_longcall_p (operands[0], INTVAL (operands[3]))"
   "call %0;"
   [(set_attr "type" "call")
@@ -2090,7 +2090,7 @@
    (use (match_operand 3 "" ""))
    (return)]
   "SIBLING_CALL_P (insn)
-   && GET_CODE (operands[0]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[0])
    && !bfin_longcall_p (operands[0], INTVAL (operands[3]))"
   "jump.l %0;"
   [(set_attr "type" "br")
@@ -2104,7 +2104,7 @@
    (use (match_operand 4 "" ""))
    (clobber (reg:SI REG_RETS))]
   "! SIBLING_CALL_P (insn)
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && !bfin_longcall_p (operands[1], INTVAL (operands[4]))"
   "call %1;"
   [(set_attr "type" "call")
@@ -2118,7 +2118,7 @@
    (use (match_operand 4 "" ""))
    (return)]
   "SIBLING_CALL_P (insn)
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && !bfin_longcall_p (operands[1], INTVAL (operands[4]))"
   "jump.l %1;"
   [(set_attr "type" "br")
@@ -2177,7 +2177,7 @@
    (clobber (reg:SI REG_RETS))]
   "! SIBLING_CALL_P (insn)
    && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
-   && GET_CODE (operands[0]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[0])
    && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
   "call %0;"
   [(set_attr "type" "call")
@@ -2190,7 +2190,7 @@
    (return)]
   "SIBLING_CALL_P (insn)
    && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
-   && GET_CODE (operands[0]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[0])
    && !bfin_longcall_p (operands[0], INTVAL (operands[2]))"
   "jump.l %0;"
   [(set_attr "type" "br")
@@ -2204,7 +2204,7 @@
    (clobber (reg:SI REG_RETS))]
   "! SIBLING_CALL_P (insn)
    && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
   "call %1;"
   [(set_attr "type" "call")
@@ -2218,7 +2218,7 @@
    (return)]
   "SIBLING_CALL_P (insn)
    && (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && !bfin_longcall_p (operands[1], INTVAL (operands[3]))"
   "jump.l %1;"
   [(set_attr "type" "br")
diff --git a/gcc/config/bfin/predicates.md b/gcc/config/bfin/predicates.md
index 261323a41b2..c13f7cd544a 100644
--- a/gcc/config/bfin/predicates.md
+++ b/gcc/config/bfin/predicates.md
@@ -162,7 +162,7 @@
   (ior (match_code "symbol_ref,label_ref")
        (and (match_code "const")
 	    (match_test "GET_CODE (XEXP (op,0)) == PLUS
-			 && (GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+			 && (SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 			     || LABEL_REF_P (XEXP (XEXP (op, 0), 0)))
 			 && CONST_INT_P (XEXP (XEXP (op, 0), 1))"))))
 
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 7e52de17a4b..2ebbfd8ac54 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -1290,7 +1290,7 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
   rtx addr = orig;
   rtx new_rtx = orig;
 
-  if (GET_CODE (addr) == SYMBOL_REF || LABEL_REF_P (addr))
+  if (SYMBOL_REF_P (addr) || LABEL_REF_P (addr))
     {
       int unspec = UNSPEC_LOAD_GOT;
       rtx tmp;
@@ -2237,7 +2237,7 @@ c6x_print_operand (FILE *file, rtx x, int code)
 	  x = XEXP (x, 0);
 
 	}
-      gcc_assert (GET_CODE (x) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (x));
 
       t = SYMBOL_REF_DECL (x);
       if (DECL_P (t))
@@ -2259,7 +2259,7 @@ c6x_print_operand (FILE *file, rtx x, int code)
 	  if (GET_CODE (x) == PLUS
 	      || GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
 	    x = XEXP (x, 0);
-	  if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF)
+	  if (GET_CODE (x) == CONST || SYMBOL_REF_P (x))
 	    {
 	      gcc_assert (sdata_symbolic_operand (x, Pmode));
 	      fputs ("2", file);
@@ -2429,7 +2429,7 @@ c6x_legitimate_address_p_1 (machine_mode mode, rtx x, bool strict,
 	  && GET_CODE (XEXP (x, 1)) == UNSPEC
 	  && XINT (XEXP (x, 1), 1) == UNSPEC_LOAD_GOT
 	  && XEXP (x, 0) == pic_offset_table_rtx
-	  && (GET_CODE (XVECEXP (XEXP (x, 1), 0, 0)) == SYMBOL_REF
+	  && (SYMBOL_REF_P (XVECEXP (XEXP (x, 1), 0, 0))
 	      || LABEL_REF_P (XVECEXP (XEXP (x, 1), 0, 0))))
 	return !no_large_offset;
       if (!CONST_INT_P (XEXP (x, 1)))
diff --git a/gcc/config/c6x/predicates.md b/gcc/config/c6x/predicates.md
index 1670df870cc..c0b2c60d91d 100644
--- a/gcc/config/c6x/predicates.md
+++ b/gcc/config/c6x/predicates.md
@@ -73,7 +73,7 @@
 {
   /* The linker transforms jumps to undefined weak symbols in a way that
      is incompatible with our code generation.  */
-  return (GET_CODE (op) != SYMBOL_REF
+  return (!SYMBOL_REF_P (op)
 	  || (!SYMBOL_REF_WEAK (op)
 	      && !c6x_long_call_p (op)));
 })
@@ -84,7 +84,7 @@
   (ior (match_code "symbol_ref,label_ref")
        (and (match_code "const")
 	    (match_test "GET_CODE (XEXP (op,0)) == PLUS
-			 && (GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+			 && (SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 			     || LABEL_REF_P (XEXP (XEXP (op, 0), 0)))
 			 && CONST_INT_P (XEXP (XEXP (op, 0), 1))"))))
 
@@ -187,7 +187,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       offset = INTVAL (XEXP (op, 1));
diff --git a/gcc/config/cr16/cr16.c b/gcc/config/cr16/cr16.c
index 1fc95285ba5..8da6bbd1c52 100644
--- a/gcc/config/cr16/cr16.c
+++ b/gcc/config/cr16/cr16.c
@@ -1162,7 +1162,7 @@ legitimate_pic_operand_p (rtx x)
     case CONST:
       /* REVISIT: Use something like symbol_referenced_p.  */
       if (GET_CODE (XEXP (x, 0)) == PLUS
-	  && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+	  && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	      || LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
 	  && (CONST_INT_P (XEXP (XEXP (x, 0), 1))))
 	return 0;
@@ -1191,7 +1191,7 @@ legitimize_pic_address (rtx orig, machine_mode mode ATTRIBUTE_UNUSED,
 			rtx reg)
 {
   /* First handle a simple SYMBOL_REF or LABEL_REF.  */
-  if (GET_CODE (orig) == SYMBOL_REF || LABEL_REF_P (orig))
+  if (SYMBOL_REF_P (orig) || LABEL_REF_P (orig))
     {
       if (reg == 0)
 	reg = gen_reg_rtx (Pmode);
diff --git a/gcc/config/cr16/cr16.h b/gcc/config/cr16/cr16.h
index 9814b725aec..8df4b4cd95b 100644
--- a/gcc/config/cr16/cr16.h
+++ b/gcc/config/cr16/cr16.h
@@ -415,7 +415,7 @@ struct cumulative_args
 
 #define CONSTANT_ADDRESS_P(X)       \
   (LABEL_REF_P (X)        \
-   || GET_CODE (X) == SYMBOL_REF    \
+   || SYMBOL_REF_P (X)    \
    || GET_CODE (X) == CONST         \
    || CONST_INT_P (X))
 
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 6a573dda1ab..aa8db75e2c5 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -3910,7 +3910,7 @@ cris_output_addr_const (FILE *file, rtx x)
 void
 cris_asm_output_symbol_ref (FILE *file, rtx x)
 {
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
 
   if (flag_pic && in_code > 0)
     {
@@ -3956,7 +3956,7 @@ cris_output_addr_const_extra (FILE *file, rtx xconst)
 
     case UNSPEC:
       x = XVECEXP (xconst, 0, 0);
-      CRIS_ASSERT (GET_CODE (x) == SYMBOL_REF
+      CRIS_ASSERT (SYMBOL_REF_P (x)
 		   || LABEL_REF_P (x)
 		   || GET_CODE (x) == CONST);
       output_addr_const (file, x);
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 94ebb9d8539..a0243bc0c27 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -1087,7 +1087,7 @@
       if (TARGET_V32)
        {
 	 if (!flag_pic
-	     && (GET_CODE (operands[1]) == SYMBOL_REF
+	     && (SYMBOL_REF_P (operands[1])
 		 || LABEL_REF_P (operands[1])
 		 || (GET_CODE (operands[1]) == CONST
 		     && (GET_CODE (XEXP (operands[1], 0)) != UNSPEC
diff --git a/gcc/config/csky/csky.c b/gcc/config/csky/csky.c
index a41b8ed431e..d562d9fdf09 100644
--- a/gcc/config/csky/csky.c
+++ b/gcc/config/csky/csky.c
@@ -1578,7 +1578,7 @@ csky_emit_constant_pools (void)
 		rtx insn_body = PATTERN (this_fix->insn);
 		rtx src = XEXP (insn_body, 1);
 		*this_fix->loc = gen_rtx_MEM (this_fix->mode, addr);
-		if (GET_CODE (this_fix->value) == SYMBOL_REF)
+		if (SYMBOL_REF_P (this_fix->value))
 		  emit_insn_after (gen_rtx_UNSPEC_VOLATILE (VOIDmode,
 							    gen_rtvec (1, src),
 							    VUNSPEC_SYMBOL_REF),
@@ -2649,7 +2649,7 @@ csky_tls_referenced_p (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+      if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	return true;
 
       /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
@@ -2716,7 +2716,7 @@ csky_tls_symbol_p (rtx x)
   if (!TARGET_TLS)
     return false;
 
-  if (GET_CODE (x) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (x))
     return false;
 
   return SYMBOL_REF_TLS_MODEL (x) != 0;
@@ -4035,7 +4035,7 @@ csky_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
 	  else
 	    return "lrw\t%0, %x1\t";
 	}
-      else if (TARGET_ANCHOR && GET_CODE (src) == SYMBOL_REF)
+      else if (TARGET_ANCHOR && SYMBOL_REF_P (src))
 	{
 	  if (SYMBOL_REF_FUNCTION_P (src))
 	    return "lrw\t%0, %1@BTEXT";
@@ -4156,7 +4156,7 @@ csky_output_ck801_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
 	  else
 	    return "lrw\t%0, %x1\t";
 	}
-      else if (TARGET_ANCHOR && GET_CODE (src) == SYMBOL_REF)
+      else if (TARGET_ANCHOR && SYMBOL_REF_P (src))
 	{
 	  if (SYMBOL_REF_FUNCTION_P (src))
 	    return "lrw\t%0, %1@BTEXT";
@@ -4731,7 +4731,7 @@ csky_symbolic_address_p (rtx x)
       return 1;
     case CONST:
       x = XEXP (x, 0);
-      return ((GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      return ((SYMBOL_REF_P (XEXP (x, 0))
 	       || LABEL_REF_P (XEXP (x, 0)))
 	      && CONST_INT_P (XEXP (x, 1)));
     default:
@@ -5592,7 +5592,7 @@ csky_symbol_mentioned_p (rtx x)
   const char *fmt;
   int i;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return true;
 
   fmt = GET_RTX_FORMAT (GET_CODE (x));
@@ -5679,7 +5679,7 @@ csky_legitimize_pic_address (rtx orig, rtx reg, bool gotrel_p)
   rtx pic_reg = gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM);
   bool optimize_p = false;
 
-  if (GET_CODE (orig) == SYMBOL_REF || LABEL_REF_P (orig))
+  if (SYMBOL_REF_P (orig) || LABEL_REF_P (orig))
     {
       rtx pic_ref, address, rtx_tmp;
       rtx insn;
@@ -5698,7 +5698,7 @@ csky_legitimize_pic_address (rtx orig, rtx reg, bool gotrel_p)
       else
 	address = reg;
 
-      if (GET_CODE (orig) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (orig))
+      if (SYMBOL_REF_P (orig) && !SYMBOL_REF_LOCAL_P (orig))
 	{
 	  /* When gotrel_p generate sym@GOT, otherwise generate sym@PLT.  */
 	  rtx_tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig),
@@ -5725,7 +5725,7 @@ csky_legitimize_pic_address (rtx orig, rtx reg, bool gotrel_p)
 	      return pic_ref;
 	    }
 	  /* grs rx, symbol */
-	  else if (flag_pic == 1 && (GET_CODE (orig) == SYMBOL_REF)
+	  else if (flag_pic == 1 && (SYMBOL_REF_P (orig))
 		   && SYMBOL_REF_FUNCTION_P (orig))
 	    {
 	      pic_ref = gen_rtx_UNSPEC (Pmode,
diff --git a/gcc/config/csky/csky.h b/gcc/config/csky/csky.h
index 1c86fd10b18..56feefbd7f2 100644
--- a/gcc/config/csky/csky.h
+++ b/gcc/config/csky/csky.h
@@ -686,7 +686,7 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
 
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X) \
-  (LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF)
+  (LABEL_REF_P (X) || SYMBOL_REF_P (X))
 
 /* Maximum number of registers that can appear in a valid memory address.
    Shifts in addresses can't be by a register.  */
diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md
index 6e680c14ac2..a2fdc9c8122 100644
--- a/gcc/config/csky/csky.md
+++ b/gcc/config/csky/csky.md
@@ -173,7 +173,7 @@
 	    tmp = XEXP (XEXP (tmp, 0), 0);
 	  }
 
-	gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (tmp));
 	gcc_assert (SYMBOL_REF_TLS_MODEL (tmp) != 0);
 
 	tmp = csky_legitimize_tls_address (tmp, scratch);
diff --git a/gcc/config/csky/predicates.md b/gcc/config/csky/predicates.md
index c2dadba3d27..81d0e5bdb3b 100644
--- a/gcc/config/csky/predicates.md
+++ b/gcc/config/csky/predicates.md
@@ -161,7 +161,7 @@
 (define_predicate "csky_call_address_operand"
   (match_code "reg,subreg,symbol_ref")
   {
-    if (!flag_pic && (GET_CODE (op) == SYMBOL_REF))
+    if (!flag_pic && (SYMBOL_REF_P (op)))
       return 1;
     if (register_operand (op, mode))
       return 1;
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 4ca16520080..fc055919acc 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -644,7 +644,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
   if (! MACHOPIC_INDIRECT)
     return orig;
 
-  if (GET_CODE (orig) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig))
     {
       int defined = machopic_data_defined_p (orig);
 
@@ -795,7 +795,7 @@ machopic_indirect_call_target (rtx target)
     return target;
 
   if (MACHOPIC_INDIRECT
-      && GET_CODE (XEXP (target, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (target, 0))
       && !(SYMBOL_REF_FLAGS (XEXP (target, 0))
 	   & MACHO_SYMBOL_FLAG_DEFINED))
     {
@@ -823,7 +823,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 
   /* First handle a simple SYMBOL_REF or LABEL_REF */
   if (LABEL_REF_P (orig)
-      || GET_CODE (orig) == SYMBOL_REF)
+      || SYMBOL_REF_P (orig))
     {
       /* addr(foo) = &func+(foo-func) */
       orig = machopic_indirect_data_reference (orig, reg);
@@ -848,7 +848,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 
 #if HAVE_lo_sum
 	  if (MACHO_DYNAMIC_NO_PIC_P
-	      && (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
+	      && (SYMBOL_REF_P (XEXP (orig, 0))
 		  || LABEL_REF_P (XEXP (orig, 0))))
 	    {
 #if defined (TARGET_TOC)	/* ppc  */
@@ -871,7 +871,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 	      pic_ref = reg;
 	    }
 	  else
-	  if (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
+	  if (SYMBOL_REF_P (XEXP (orig, 0))
 	      || LABEL_REF_P (XEXP (orig, 0)))
 	    {
 	      rtx offset = machopic_gen_offset (XEXP (orig, 0));
@@ -941,7 +941,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 	{
 
 #if HAVE_lo_sum
-	  if (GET_CODE (orig) == SYMBOL_REF
+	  if (SYMBOL_REF_P (orig)
 	      || LABEL_REF_P (orig))
 	    {
 	      rtx offset = machopic_gen_offset (orig);
@@ -1024,7 +1024,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
     }
   else if (GET_CODE (orig) == PLUS
 	   && (MEM_P (XEXP (orig, 0))
-	       || GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
+	       || SYMBOL_REF_P (XEXP (orig, 0))
 	       || LABEL_REF_P (XEXP (orig, 0)))
 	   && XEXP (orig, 0) != pic_offset_table_rtx
 	   && !REG_P (XEXP (orig, 1)))
@@ -1056,7 +1056,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
       return machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg);
     }
   else if (MEM_P (orig)
-	   && GET_CODE (XEXP (orig, 0)) == SYMBOL_REF)
+	   && SYMBOL_REF_P (XEXP (orig, 0)))
     {
       rtx addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg);
       addr = replace_equiv_address (orig, addr);
@@ -1196,7 +1196,7 @@ int
 machopic_operand_p (rtx op)
 {
   if (MACHOPIC_JUST_INDIRECT)
-    return (GET_CODE (op) == SYMBOL_REF
+    return (SYMBOL_REF_P (op)
 	    && machopic_symbol_defined_p (op));
   else
     return (GET_CODE (op) == CONST
@@ -1768,7 +1768,7 @@ machopic_select_rtx_section (machine_mode mode, rtx x,
 	       || CONST_VECTOR_P (x)))
     return darwin_sections[literal16_section];
   else if (MACHOPIC_INDIRECT
-	   && (GET_CODE (x) == SYMBOL_REF
+	   && (SYMBOL_REF_P (x)
 	       || GET_CODE (x) == CONST
 	       || LABEL_REF_P (x)))
     return darwin_sections[const_data_section];
@@ -2164,7 +2164,7 @@ darwin_non_lazy_pcrel (FILE *file, rtx addr)
 {
   const char *nlp_name;
 
-  gcc_assert (GET_CODE (addr) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (addr));
 
   nlp_name = machopic_indirection_name (addr, /*stub_p=*/false);
   fputs ("\t.long\t", file);
@@ -2208,7 +2208,7 @@ darwin_asm_declare_object_name (FILE *file,
 				      && (!DECL_COMMON (decl)
 					  || !TREE_PUBLIC (decl)));
 
-  if (GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (XEXP (DECL_RTL (decl), 0)))
     xname = IDENTIFIER_POINTER (DECL_NAME (decl));
 
   if (local_def)
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index ab5ad03f175..85c5ffc03db 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -652,7 +652,7 @@ extern GTY(()) int darwin_ms_struct;
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
   do {									\
     const char *xname = NAME;						\
-    if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF)		\
+    if (!SYMBOL_REF_P (XEXP (DECL_RTL (DECL), 0)))		\
       xname = IDENTIFIER_POINTER (DECL_NAME (DECL));			\
     if (! DECL_WEAK (DECL)						\
         && ((TREE_STATIC (DECL)						\
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index ea1c137a881..442cd4d02c1 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -2135,7 +2135,7 @@ epiphany_small16 (rtx x)
       base = XEXP (XEXP (x, 0), 0);
       offs = XEXP (XEXP (x, 0), 1);
     }
-  if (GET_CODE (base) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (base)
+  if (SYMBOL_REF_P (base) && SYMBOL_REF_FUNCTION_P (base)
       && epiphany_is_long_call_p (base))
     return false;
   return TARGET_SMALL16 != 0;
@@ -2197,7 +2197,7 @@ epiphany_call_uninterruptible_p (rtx mem)
   rtx addr = XEXP (mem, 0);
   tree t = NULL_TREE;
 
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     t = SYMBOL_REF_DECL (addr);
   if (!t)
     t = MEM_EXPR (mem);
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
index 8d5a9c55616..8ac1100358a 100644
--- a/gcc/config/epiphany/epiphany.h
+++ b/gcc/config/epiphany/epiphany.h
@@ -602,7 +602,7 @@ typedef struct GTY (()) machine_function
 
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X) \
-(LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF	\
+(LABEL_REF_P (X) || SYMBOL_REF_P (X)	\
  || CONST_INT_P (X) || GET_CODE (X) == CONST)
 
 #define RTX_OK_FOR_OFFSET_P(MODE, X) \
diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md
index b59c23b9c10..33dd8847cfe 100644
--- a/gcc/config/epiphany/predicates.md
+++ b/gcc/config/epiphany/predicates.md
@@ -24,7 +24,7 @@
 (define_predicate "symbolic_operand"
   (match_code "symbol_ref,label_ref,const")
 {
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return (!epiphany_is_long_call_p (op)
 	    && (!flag_pic || SYMBOL_REF_LOCAL_P (op)));
   if (LABEL_REF_P (op))
diff --git a/gcc/config/fr30/predicates.md b/gcc/config/fr30/predicates.md
index 1fa5f167f27..597330ce2e1 100644
--- a/gcc/config/fr30/predicates.md
+++ b/gcc/config/fr30/predicates.md
@@ -57,7 +57,7 @@
   (match_code "mem")
 {
   return (MEM_P (op)
-	  && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+	  && (SYMBOL_REF_P (XEXP (op, 0))
 	      || REG_P (XEXP (op, 0))));
 })
 
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 13e8dafbc7d..5392082034f 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -534,7 +534,7 @@ static bool frv_modes_tieable_p			(machine_mode, machine_mode);
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #define FRV_SYMBOL_REF_TLS_P(RTX) \
-  (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0)
+  (SYMBOL_REF_P (RTX) && SYMBOL_REF_TLS_MODEL (RTX) != 0)
 
 
 /* Any function call that satisfies the machine-independent
@@ -553,7 +553,7 @@ frv_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
 static FRV_INLINE bool
 frv_small_data_reloc_p (rtx symbol, int reloc)
 {
-  return (GET_CODE (symbol) == SYMBOL_REF
+  return (SYMBOL_REF_P (symbol)
 	  && SYMBOL_REF_SMALL_P (symbol)
 	  && (!TARGET_FDPIC || flag_pic == 1)
 	  && (reloc == R_FRV_GOTOFF12 || reloc == R_FRV_GPREL12));
@@ -3063,7 +3063,7 @@ frv_init_cumulative_args (CUMULATIVE_ARGS *cum,
 		   get_tree_code_name (TREE_CODE (ret_type)));
 	}
 
-      if (libname && GET_CODE (libname) == SYMBOL_REF)
+      if (libname && SYMBOL_REF_P (libname))
 	fprintf (stderr, " libname=%s", XSTR (libname, 0));
 
       if (cfun->returns_struct)
@@ -3603,7 +3603,7 @@ frv_legitimize_address (rtx x,
 			rtx oldx ATTRIBUTE_UNUSED,
 			machine_mode mode ATTRIBUTE_UNUSED)
 {
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     {
       enum tls_model model = SYMBOL_REF_TLS_MODEL (x);
       if (model != 0)
@@ -3775,7 +3775,7 @@ frv_expand_fdpic_call (rtx *operands, bool ret_value, bool sibcall)
      all external functions, so one would have to also mark function
      declarations available in the same module with non-default
      visibility, which is advantageous in itself.  */
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       && ((!SYMBOL_REF_LOCAL_P (addr) && TARGET_INLINE_PLT)
 	  || sibcall))
     {
@@ -3791,7 +3791,7 @@ frv_expand_fdpic_call (rtx *operands, bool ret_value, bool sibcall)
       crtl->uses_pic_offset_table = TRUE;
       addr = dest;
     }
-  else if (GET_CODE (addr) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (addr))
     {
       /* These are always either local, or handled through a local
 	 PLT.  */
@@ -3832,7 +3832,7 @@ frv_function_symbol_referenced_p (rtx x)
   int length;
   int j;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return SYMBOL_REF_FUNCTION_P (x);
 
   length = GET_RTX_LENGTH (GET_CODE (x));
@@ -3917,7 +3917,7 @@ direct_return_p (void)
 void
 frv_emit_move (machine_mode mode, rtx dest, rtx src)
 {
-  if (GET_CODE (src) == SYMBOL_REF)
+  if (SYMBOL_REF_P (src))
     {
       enum tls_model model = SYMBOL_REF_TLS_MODEL (src);
       if (model != 0)
@@ -4041,10 +4041,10 @@ frv_emit_movsi (rtx dest, rtx src)
 	{
 	  sym = XEXP (sym, 0);
 	  if (GET_CODE (sym) == PLUS
-	      && GET_CODE (XEXP (sym, 0)) == SYMBOL_REF
+	      && SYMBOL_REF_P (XEXP (sym, 0))
 	      && CONST_INT_P (XEXP (sym, 1)))
 	    sym = XEXP (sym, 0);
-	  if (GET_CODE (sym) == SYMBOL_REF)
+	  if (SYMBOL_REF_P (sym))
 	    goto handle_sym;
 	  else if (LABEL_REF_P (sym))
 	    goto handle_label;
@@ -4140,7 +4140,7 @@ frv_emit_movsi (rtx dest, rtx src)
 
   if (base_regno >= 0)
     {
-      if (GET_CODE (sym) == SYMBOL_REF && SYMBOL_REF_SMALL_P (sym))
+      if (SYMBOL_REF_P (sym) && SYMBOL_REF_SMALL_P (sym))
 	emit_insn (gen_symGOTOFF2reg (dest, src,
 				      gen_rtx_REG (Pmode, base_regno),
 				      GEN_INT (R_FRV_GPREL12)));
@@ -4279,7 +4279,7 @@ output_move_single (rtx operands[], rtx insn)
 	      return "#";
 	    }
 
-          else if (GET_CODE (src) == SYMBOL_REF
+          else if (SYMBOL_REF_P (src)
 		   || LABEL_REF_P (src)
 		   || GET_CODE (src) == CONST)
 	    {
@@ -6824,10 +6824,10 @@ frv_assemble_integer (rtx value, unsigned int size, int aligned_p)
   if ((flag_pic || TARGET_FDPIC) && size == UNITS_PER_WORD)
     {
       if (GET_CODE (value) == CONST
-	  || GET_CODE (value) == SYMBOL_REF
+	  || SYMBOL_REF_P (value)
 	  || LABEL_REF_P (value))
 	{
-	  if (TARGET_FDPIC && GET_CODE (value) == SYMBOL_REF
+	  if (TARGET_FDPIC && SYMBOL_REF_P (value)
 	      && SYMBOL_REF_FUNCTION_P (value))
 	    {
 	      fputs ("\t.picptr\tfuncdesc(", asm_out_file);
diff --git a/gcc/config/frv/predicates.md b/gcc/config/frv/predicates.md
index 9fd855646c8..63e570a9056 100644
--- a/gcc/config/frv/predicates.md
+++ b/gcc/config/frv/predicates.md
@@ -524,7 +524,7 @@
       op = XEXP (op, 0);
       if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1)))
 	op = XEXP (op, 0);
-      return GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op);
+      return SYMBOL_REF_P (op) || LABEL_REF_P (op);
 
     case SYMBOL_REF:
       if (TARGET_FDPIC)
@@ -1069,7 +1069,7 @@
   if (GET_MODE (op) != mode && mode != VOIDmode && !CONST_INT_P (op))
     return FALSE;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return !TARGET_LONG_CALLS || SYMBOL_REF_LOCAL_P (op);
 
   /* Note this doesn't allow reg+reg or reg+imm12 addressing (which should
@@ -1130,7 +1130,7 @@
       /* Allow (const:SI (plus:SI (symbol_ref) (const_int))).  */
       return GET_MODE (op) == SImode
 	&& GET_CODE (XEXP (op, 0)) == PLUS
-	&& GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+	&& SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 	&& CONST_INT_P (XEXP (XEXP (op, 0), 1));
     }
 
diff --git a/gcc/config/ft32/constraints.md b/gcc/config/ft32/constraints.md
index b6f2bb1ba87..23a25dd122f 100644
--- a/gcc/config/ft32/constraints.md
+++ b/gcc/config/ft32/constraints.md
@@ -26,14 +26,14 @@
   "An absolute address."
   (and (match_code "mem")
        (match_test "(!ft32_is_mem_pm(op))")
-       (ior (match_test "GET_CODE (XEXP (op, 0)) == SYMBOL_REF")
+       (ior (match_test "SYMBOL_REF_P (XEXP (op, 0))")
             (match_test "LABEL_REF_P (XEXP (op, 0))")
             (match_test "CONST_INT_P (XEXP (op, 0))")
             (and (match_test "(GET_CODE (XEXP (op, 0)) == PLUS)")
-                 (ior (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF")
+                 (ior (match_test "SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))")
                       (match_test "LABEL_REF_P (XEXP (XEXP (op, 0), 0))")
                       (match_test "CONST_INT_P (XEXP (XEXP (op, 0), 0))"))
-                 (ior (match_test "GET_CODE (XEXP (XEXP (op, 0), 1)) == SYMBOL_REF")
+                 (ior (match_test "SYMBOL_REF_P (XEXP (XEXP (op, 0), 1))")
                       (match_test "LABEL_REF_P (XEXP (XEXP (op, 0), 1))")
                       (match_test "CONST_INT_P (XEXP (XEXP (op, 0), 1))"))))))
 
@@ -54,7 +54,7 @@
   "An offset address."
   (and (match_code "mem")
        (match_test "ft32_is_mem_pm(op) && (
-          (GET_CODE (XEXP (op, 0)) == SYMBOL_REF) ||
+          (SYMBOL_REF_P (XEXP (op, 0))) ||
           (LABEL_REF_P (XEXP (op, 0))) ||
           (CONST_INT_P (XEXP (op, 0))) ||
           (GET_CODE (XEXP (op, 0)) == CONST))"
@@ -99,7 +99,7 @@
     (and (match_code "const_int")
          (match_test "ival >= -524288 && ival <= 524287"))
     (match_test "LABEL_REF_P (op)")
-    (match_test "GET_CODE (op) == SYMBOL_REF")
+    (match_test "SYMBOL_REF_P (op)")
     (match_test "GET_CODE (op) == CONST")))
 
 (define_constraint "b"
diff --git a/gcc/config/ft32/ft32.c b/gcc/config/ft32/ft32.c
index 87defc3824f..b9fcec1344b 100644
--- a/gcc/config/ft32/ft32.c
+++ b/gcc/config/ft32/ft32.c
@@ -135,7 +135,7 @@ ft32_print_operand_address (FILE * file, rtx x)
         case CONST:
           {
             rtx plus = XEXP (XEXP (x, 1), 0);
-            if (GET_CODE (XEXP (plus, 0)) == SYMBOL_REF
+            if (SYMBOL_REF_P (XEXP (plus, 0))
                 && CONST_INT_P (XEXP (plus, 1)))
               {
                 output_addr_const (file, XEXP (plus, 0));
@@ -884,12 +884,12 @@ ft32_addr_space_legitimate_address_p (machine_mode mode, rtx x, bool strict,
               && (INTVAL (op2) < max_offset)
               && reg_ok_for_base_p (op1, strict))
             goto yes;
-          if (GET_CODE (op1) == SYMBOL_REF && CONST_INT_P (op2))
+          if (SYMBOL_REF_P (op1) && CONST_INT_P (op2))
             goto yes;
         }
       if (REG_P (x) && reg_ok_for_base_p (x, strict))
         goto yes;
-      if (GET_CODE (x) == SYMBOL_REF
+      if (SYMBOL_REF_P (x)
           || LABEL_REF_P (x) || CONST_INT_P (x))
         goto yes;
     }
@@ -917,7 +917,7 @@ ft32_elf_encode_section_info (tree decl, rtx rtl, int first)
   if (!MEM_P (rtl))
     return;
   symbol = XEXP (rtl, 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return;
 
   default_encode_section_info (decl, rtl, first);
diff --git a/gcc/config/ft32/ft32.md b/gcc/config/ft32/ft32.md
index cf30c11848d..498a2ea62bc 100644
--- a/gcc/config/ft32/ft32.md
+++ b/gcc/config/ft32/ft32.md
@@ -300,7 +300,7 @@
         rtx o = XEXP (operands[0], 0);
         if (!REG_P(o) &&
             !CONST_INT_P(o) &&
-            GET_CODE(o) != SYMBOL_REF &&
+            !SYMBOL_REF_P (o) &&
             !LABEL_REF_P (o)) {
           operands[0] = gen_rtx_MEM (SImode, force_reg (SImode, XEXP (operands[0], 0)));
         }
@@ -439,7 +439,7 @@
           rtx o = XEXP (operands[0], 0);
           if (!REG_P(o) &&
               !CONST_INT_P(o) &&
-              GET_CODE(o) != SYMBOL_REF &&
+              !SYMBOL_REF_P (o) &&
               !LABEL_REF_P (o)) {
             operands[0] = gen_rtx_MEM (HImode, force_reg (SImode, XEXP (operands[0], 0)));
           }
diff --git a/gcc/config/ft32/predicates.md b/gcc/config/ft32/predicates.md
index 51bdedd60ef..9c93eff7508 100644
--- a/gcc/config/ft32/predicates.md
+++ b/gcc/config/ft32/predicates.md
@@ -53,7 +53,7 @@
       && REG_P (XEXP (XEXP (op, 0), 0))
       && CONST_INT_P (XEXP (XEXP (op, 0), 1)))
     return 1;
-  if (MEM_P (op) && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
+  if (MEM_P (op) && SYMBOL_REF_P (XEXP (op, 0)))
     return 1;
   return REG_P(op) ||
          (MEM_P(op) && REG_P(XEXP (op, 0)));
diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index 402713135d4..9cb7285c795 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -2111,14 +2111,14 @@ gcn_valid_move_p (machine_mode mode, rtx dest, rtx src)
   if (MEM_P (dest)
       && AS_FLAT_P (MEM_ADDR_SPACE (dest))
       && (gcn_flat_address_p (XEXP (dest, 0), mode)
-	  || GET_CODE (XEXP (dest, 0)) == SYMBOL_REF
+	  || SYMBOL_REF_P (XEXP (dest, 0))
 	  || LABEL_REF_P (XEXP (dest, 0)))
       && gcn_vgpr_register_operand (src, mode))
     return true;
   else if (MEM_P (src)
 	   && AS_FLAT_P (MEM_ADDR_SPACE (src))
 	   && (gcn_flat_address_p (XEXP (src, 0), mode)
-	       || GET_CODE (XEXP (src, 0)) == SYMBOL_REF
+	       || SYMBOL_REF_P (XEXP (src, 0))
 	       || LABEL_REF_P (XEXP (src, 0)))
 	   && gcn_vgpr_register_operand (dest, mode))
     return true;
@@ -2126,14 +2126,14 @@ gcn_valid_move_p (machine_mode mode, rtx dest, rtx src)
   if (MEM_P (dest)
       && AS_GLOBAL_P (MEM_ADDR_SPACE (dest))
       && (gcn_global_address_p (XEXP (dest, 0))
-	  || GET_CODE (XEXP (dest, 0)) == SYMBOL_REF
+	  || SYMBOL_REF_P (XEXP (dest, 0))
 	  || LABEL_REF_P (XEXP (dest, 0)))
       && gcn_vgpr_register_operand (src, mode))
     return true;
   else if (MEM_P (src)
 	   && AS_GLOBAL_P (MEM_ADDR_SPACE (src))
 	   && (gcn_global_address_p (XEXP (src, 0))
-	       || GET_CODE (XEXP (src, 0)) == SYMBOL_REF
+	       || SYMBOL_REF_P (XEXP (src, 0))
 	       || LABEL_REF_P (XEXP (src, 0)))
 	   && gcn_vgpr_register_operand (dest, mode))
     return true;
@@ -2141,14 +2141,14 @@ gcn_valid_move_p (machine_mode mode, rtx dest, rtx src)
   if (MEM_P (dest)
       && MEM_ADDR_SPACE (dest) == ADDR_SPACE_SCALAR_FLAT
       && (gcn_scalar_flat_address_p (XEXP (dest, 0))
-	  || GET_CODE (XEXP (dest, 0)) == SYMBOL_REF
+	  || SYMBOL_REF_P (XEXP (dest, 0))
 	  || LABEL_REF_P (XEXP (dest, 0)))
       && gcn_ssrc_register_operand (src, mode))
     return true;
   else if (MEM_P (src)
 	   && MEM_ADDR_SPACE (src) == ADDR_SPACE_SCALAR_FLAT
 	   && (gcn_scalar_flat_address_p (XEXP (src, 0))
-	       || GET_CODE (XEXP (src, 0)) == SYMBOL_REF
+	       || SYMBOL_REF_P (XEXP (src, 0))
 	       || LABEL_REF_P (XEXP (src, 0)))
 	   && gcn_sdst_register_operand (dest, mode))
     return true;
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index 202805b486a..20a55628824 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -406,7 +406,7 @@
       }
 
     if (<MODE>mode == DImode
-	&& (GET_CODE (operands[1]) == SYMBOL_REF
+	&& (SYMBOL_REF_P (operands[1])
 	    || LABEL_REF_P (operands[1])))
       {
 	if (lra_in_progress)
@@ -564,7 +564,7 @@
 			  "=SD,SD,SD,RS,Sm,v, v,Sg, v, v,RF,RLRG,   v, v,RM")
 	(match_operand:DIDF 1 "general_operand"
 			  "SSA, C,DB,Sm,RS,v,DB, v,Sv,RF, v,   v,RLRG,RM, v"))]
-  "GET_CODE(operands[1]) != SYMBOL_REF"
+  "!SYMBOL_REF_P (operands[1])"
   "@
   s_mov_b64\t%0, %1
   s_mov_b64\t%0, %1
@@ -819,7 +819,7 @@
  [(set (match_operand:DI 0 "nonimmediate_operand" "=Sg")
        (match_operand:DI 1 "general_operand" "Y"))
   (clobber (reg:BI SCC_REG))]
- "GET_CODE (operands[1]) == SYMBOL_REF || LABEL_REF_P (operands[1])"
+ "SYMBOL_REF_P (operands[1]) || LABEL_REF_P (operands[1])"
   {
     if (SYMBOL_REF_P (operands[1])
 	&& SYMBOL_REF_WEAK (operands[1]))
@@ -840,7 +840,7 @@
  [(set (match_operand:DI 0 "nonimmediate_operand" "=Sg")
        (match_operand:DI 1 "general_operand" "Y"))
   (clobber (reg:BI CC_SAVE_REG))]
- "(GET_CODE (operands[1]) == SYMBOL_REF || LABEL_REF_P (operands[1]))
+ "(SYMBOL_REF_P (operands[1]) || LABEL_REF_P (operands[1]))
   && (lra_in_progress || reload_completed)"
   {
     /* !!! These sequences clobber CC_SAVE_REG.  */
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index d9d69e4791e..bfa2d349ea3 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -5620,12 +5620,12 @@ h8300_eightbit_constant_address_p (rtx x)
   unsigned HOST_WIDE_INT addr;
 
   /* We accept symbols declared with eightbit_data.  */
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0;
 
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
       && (SYMBOL_REF_FLAGS (XEXP (XEXP (x, 0), 0)) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0)
     return 1;
 
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index f0f95125404..5aaa26eabad 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -477,7 +477,7 @@ struct cum_arg
 /* 1 if X is an rtx for a constant that is a valid address.  */
 
 #define CONSTANT_ADDRESS_P(X)					\
-  (LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF	\
+  (LABEL_REF_P (X) || SYMBOL_REF_P (X)	\
    || (CONST_INT_P (X)				\
        /* We handle signed and unsigned offsets here.  */	\
        && INTVAL (X) > (TARGET_H8300 ? -0x10000 : -0x1000000)	\
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 401420c42f1..b4dbcb0b16b 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -2071,7 +2071,7 @@
   ""
   {
     if (!register_operand (XEXP (operands[0], 0), Pmode)
-	&& GET_CODE (XEXP (operands[0], 0)) != SYMBOL_REF)
+	&& !SYMBOL_REF_P (XEXP (operands[0], 0)))
       XEXP (operands[0], 0) = force_reg (Pmode, XEXP (operands[0], 0));
   })
 
@@ -2083,7 +2083,7 @@
   rtx xoperands[1];
   xoperands[0] = gen_rtx_MEM (QImode, operands[0]);
   gcc_assert (GET_MODE (operands[0]) == Pmode);
-  if (GET_CODE (XEXP (xoperands[0], 0)) == SYMBOL_REF
+  if (SYMBOL_REF_P (XEXP (xoperands[0], 0))
       && (SYMBOL_REF_FLAGS (XEXP (xoperands[0], 0)) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     output_asm_insn ("jsr\\t@%0:8", xoperands);
   else
@@ -2108,7 +2108,7 @@
   ""
   {
     if (!register_operand (XEXP (operands[1], 0), Pmode)
-	&& GET_CODE (XEXP (operands[1], 0)) != SYMBOL_REF)
+	&& !SYMBOL_REF_P (XEXP (operands[1], 0)))
       XEXP (operands[1], 0) = force_reg (Pmode, XEXP (operands[1], 0));
   })
 
@@ -2122,7 +2122,7 @@
   gcc_assert (GET_MODE (operands[1]) == Pmode);
   xoperands[0] = operands[0];
   xoperands[1] = gen_rtx_MEM (QImode, operands[1]);
-  if (GET_CODE (XEXP (xoperands[1], 0)) == SYMBOL_REF
+  if (SYMBOL_REF_P (XEXP (xoperands[1], 0))
       && (SYMBOL_REF_FLAGS (XEXP (xoperands[1], 0)) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     output_asm_insn ("jsr\\t@%1:8", xoperands);
   else
diff --git a/gcc/config/h8300/predicates.md b/gcc/config/h8300/predicates.md
index b71bdde6de8..dc78188bce9 100644
--- a/gcc/config/h8300/predicates.md
+++ b/gcc/config/h8300/predicates.md
@@ -251,7 +251,7 @@
     return 1;
 
   /* A call through the function vector is a small call too.  */
-  if (GET_CODE (op) == SYMBOL_REF
+  if (SYMBOL_REF_P (op)
       && (SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     return 1;
 
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index e83ab66a598..6750c3e5d29 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -185,7 +185,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
       tmp = XEXP (op1, 0);
 
       if (GET_CODE (tmp) != PLUS
-	  || GET_CODE (XEXP (tmp, 0)) != SYMBOL_REF)
+	  || !SYMBOL_REF_P (XEXP (tmp, 0)))
 	break;
 
       op1 = XEXP (tmp, 0);
@@ -5262,7 +5262,7 @@ ix86_split_long_move (rtx operands[])
 	 fp moves, that force all constants to memory to allow combining.  */
 
       if (MEM_P (operands[1])
-	  && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (operands[1], 0))
 	  && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0)))
 	operands[1] = get_pool_constant (XEXP (operands[1], 0));
       if (push_operand (operands[0], VOIDmode))
@@ -7911,7 +7911,7 @@ construct_plt_address (rtx symbol)
 {
   rtx tmp, unspec;
 
-  gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (symbol));
   gcc_assert (ix86_cmodel == CM_LARGE_PIC && !TARGET_PECOFF);
   gcc_assert (Pmode == DImode);
 
@@ -7944,7 +7944,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
   unsigned int vec_len = 0;
   tree fndecl;
 
-  if (GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF)
+  if (SYMBOL_REF_P (XEXP (fnaddr, 0)))
     {
       fndecl = SYMBOL_REF_DECL (XEXP (fnaddr, 0));
       if (fndecl
@@ -7962,7 +7962,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
   if (TARGET_MACHO && !TARGET_64BIT)
     {
 #if TARGET_MACHO
-      if (flag_pic && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF)
+      if (flag_pic && SYMBOL_REF_P (XEXP (fnaddr, 0)))
 	fnaddr = machopic_indirect_call_target (fnaddr);
 #endif
     }
@@ -7973,7 +7973,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
 	 it an indirect call.  */
       rtx addr = XEXP (fnaddr, 0);
       if (flag_pic
-	  && GET_CODE (addr) == SYMBOL_REF
+	  && SYMBOL_REF_P (addr)
 	  && !SYMBOL_REF_LOCAL_P (addr))
 	{
 	  if (flag_plt
@@ -8037,7 +8037,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
   if (ix86_cmodel == CM_LARGE_PIC
       && !TARGET_PECOFF
       && MEM_P (fnaddr)
-      && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (fnaddr, 0))
       && !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode))
     fnaddr = gen_rtx_MEM (QImode, construct_plt_address (XEXP (fnaddr, 0)));
   /* Since x32 GOT slot is 64 bit with zero upper 32 bits, indirect
@@ -19847,7 +19847,7 @@ ix86_notrack_prefixed_insn_p (rtx insn)
 
       /* Do not emit 'notrack' if it's not an indirect call.  */
       if (MEM_P (addr)
-	  && GET_CODE (XEXP (addr, 0)) == SYMBOL_REF)
+	  && SYMBOL_REF_P (XEXP (addr, 0)))
 	return false;
       else
 	return find_reg_note (insn, REG_CALL_NOCF_CHECK, 0);
diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c
index fcac684f7b5..c2d6e597f63 100644
--- a/gcc/config/i386/i386-features.c
+++ b/gcc/config/i386/i386-features.c
@@ -1853,7 +1853,7 @@ rest_of_insert_endbranch (void)
 
 		  /* Also generate ENDBRANCH for non-tail call which
 		     may return via indirect branch.  */
-		  if (GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF)
+		  if (SYMBOL_REF_P (XEXP (fnaddr, 0)))
 		    fndecl = SYMBOL_REF_DECL (XEXP (fnaddr, 0));
 		  if (fndecl == NULL_TREE)
 		    fndecl = MEM_EXPR (fnaddr);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4b74e1fe0f2..d485c4cdce8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4941,7 +4941,7 @@ symbolic_reference_mentioned_p (rtx op)
   const char *fmt;
   int i;
 
-  if (GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op))
+  if (SYMBOL_REF_P (op) || LABEL_REF_P (op))
     return true;
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -9834,7 +9834,7 @@ ix86_force_load_from_GOT_p (rtx x)
 	  && !TARGET_PECOFF && !TARGET_MACHO
 	  && !flag_pic
 	  && ix86_cmodel != CM_LARGE
-	  && GET_CODE (x) == SYMBOL_REF
+	  && SYMBOL_REF_P (x)
 	  && SYMBOL_REF_FUNCTION_P (x)
 	  && (!flag_plt
 	      || (SYMBOL_REF_DECL (x)
@@ -9875,11 +9875,11 @@ ix86_legitimate_constant_p (machine_mode mode, rtx x)
 	  case UNSPEC_TPOFF:
 	  case UNSPEC_NTPOFF:
 	    x = XVECEXP (x, 0, 0);
-	    return (GET_CODE (x) == SYMBOL_REF
+	    return (SYMBOL_REF_P (x)
 		    && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC);
 	  case UNSPEC_DTPOFF:
 	    x = XVECEXP (x, 0, 0);
-	    return (GET_CODE (x) == SYMBOL_REF
+	    return (SYMBOL_REF_P (x)
 		    && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC);
 	  default:
 	    return false;
@@ -9888,7 +9888,7 @@ ix86_legitimate_constant_p (machine_mode mode, rtx x)
       /* We must have drilled down to a symbol.  */
       if (LABEL_REF_P (x))
 	return true;
-      if (GET_CODE (x) != SYMBOL_REF)
+      if (!SYMBOL_REF_P (x))
 	return false;
       /* FALLTHRU */
 
@@ -9970,7 +9970,7 @@ static bool
 is_imported_p (rtx x)
 {
   if (!TARGET_DLLIMPORT_DECL_ATTRIBUTES
-      || GET_CODE (x) != SYMBOL_REF)
+      || !SYMBOL_REF_P (x))
     return false;
 
   return SYMBOL_REF_DLLIMPORT_P (x) || SYMBOL_REF_STUBVAR_P (x);
@@ -10004,7 +10004,7 @@ legitimate_pic_operand_p (rtx x)
 	    return TARGET_64BIT;
 	  case UNSPEC_TPOFF:
 	    x = XVECEXP (inner, 0, 0);
-	    return (GET_CODE (x) == SYMBOL_REF
+	    return (SYMBOL_REF_P (x)
 		    && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC);
 	  case UNSPEC_MACHOPIC_OFFSET:
 	    return legitimate_pic_address_disp_p (x);
@@ -10065,7 +10065,7 @@ legitimate_pic_address_disp_p (rtx disp)
 	  if (GET_CODE (op0) == UNSPEC
 	      && XINT (op0, 1) == UNSPEC_PCREL)
 	    return true;
-	  if (GET_CODE (op0) != SYMBOL_REF)
+	  if (!SYMBOL_REF_P (op0))
 	    break;
 	  /* FALLTHRU */
 
@@ -10129,7 +10129,7 @@ legitimate_pic_address_disp_p (rtx disp)
 	      && XINT (disp, 1) != UNSPEC_PLTOFF))
 	return false;
 
-      if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
+      if (!SYMBOL_REF_P (XVECEXP (disp, 0, 0))
 	  && !LABEL_REF_P (XVECEXP (disp, 0, 0)))
 	return false;
       return true;
@@ -10158,13 +10158,13 @@ legitimate_pic_address_disp_p (rtx disp)
       /* We need to check for both symbols and labels because VxWorks loads
 	 text labels with @GOT rather than @GOTOFF.  See gotoff_operand for
 	 details.  */
-      return (GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF
+      return (SYMBOL_REF_P (XVECEXP (disp, 0, 0))
 	      || LABEL_REF_P (XVECEXP (disp, 0, 0)));
     case UNSPEC_GOTOFF:
       /* Refuse GOTOFF in 64bit mode since it is always 64bit when used.
 	 While ABI specify also 32bit relocation but we don't produce it in
 	 small PIC model at all.  */
-      if ((GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF
+      if ((SYMBOL_REF_P (XVECEXP (disp, 0, 0))
 	   || LABEL_REF_P (XVECEXP (disp, 0, 0)))
 	  && !TARGET_64BIT)
         return !TARGET_PECOFF && gotoff_operand (XVECEXP (disp, 0, 0), Pmode);
@@ -10175,15 +10175,15 @@ legitimate_pic_address_disp_p (rtx disp)
       if (saw_plus)
 	return false;
       disp = XVECEXP (disp, 0, 0);
-      return (GET_CODE (disp) == SYMBOL_REF
+      return (SYMBOL_REF_P (disp)
 	      && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_INITIAL_EXEC);
     case UNSPEC_NTPOFF:
       disp = XVECEXP (disp, 0, 0);
-      return (GET_CODE (disp) == SYMBOL_REF
+      return (SYMBOL_REF_P (disp)
 	      && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_EXEC);
     case UNSPEC_DTPOFF:
       disp = XVECEXP (disp, 0, 0);
-      return (GET_CODE (disp) == SYMBOL_REF
+      return (SYMBOL_REF_P (disp)
 	      && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_DYNAMIC);
     }
 
@@ -10412,7 +10412,7 @@ ix86_legitimate_address_p (machine_mode, rtx addr, bool strict)
 	       && !CONST_INT_P (disp)
 	       && (GET_CODE (disp) != CONST
 		   || !ix86_legitimate_constant_p (Pmode, disp))
-	       && (GET_CODE (disp) != SYMBOL_REF
+	       && (!SYMBOL_REF_P (disp)
 		   || !ix86_legitimate_constant_p (Pmode, disp)))
 	/* Displacement is not constant.  */
 	return false;
@@ -10527,7 +10527,7 @@ legitimize_pic_address (rtx orig, rtx reg)
       else
 	new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
     }
-  else if ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (addr) == 0)
+  else if ((SYMBOL_REF_P (addr) && SYMBOL_REF_TLS_MODEL (addr) == 0)
 	   /* We can't use @GOTOFF for text labels
 	      on VxWorks, see gotoff_operand.  */
 	   || (TARGET_VXWORKS_RTP && LABEL_REF_P (addr)))
@@ -10653,7 +10653,7 @@ legitimize_pic_address (rtx orig, rtx reg)
 		  /* For %rip addressing, we have to use
 		     just disp32, not base nor index.  */
 		  if (TARGET_64BIT
-		      && (GET_CODE (base) == SYMBOL_REF
+		      && (SYMBOL_REF_P (base)
 			  || LABEL_REF_P (base)))
 		    base = force_reg (mode, base);
 		  if (GET_CODE (new_rtx) == PLUS
@@ -11189,11 +11189,11 @@ legitimize_pe_coff_symbol (rtx addr, bool inreg)
 
   if (TARGET_DLLIMPORT_DECL_ATTRIBUTES)
     {
-      if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DLLIMPORT_P (addr))
+      if (SYMBOL_REF_P (addr) && SYMBOL_REF_DLLIMPORT_P (addr))
 	return legitimize_dllimport_symbol (addr, inreg);
       if (GET_CODE (addr) == CONST
 	  && GET_CODE (XEXP (addr, 0)) == PLUS
-	  && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (XEXP (addr, 0), 0))
 	  && SYMBOL_REF_DLLIMPORT_P (XEXP (XEXP (addr, 0), 0)))
 	{
 	  rtx t = legitimize_dllimport_symbol (XEXP (XEXP (addr, 0), 0), inreg);
@@ -11203,7 +11203,7 @@ legitimize_pe_coff_symbol (rtx addr, bool inreg)
 
   if (ix86_cmodel != CM_LARGE_PIC && ix86_cmodel != CM_MEDIUM_PIC)
     return NULL_RTX;
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       && !is_imported_p (addr)
       && SYMBOL_REF_EXTERNAL_P (addr)
       && SYMBOL_REF_DECL (addr))
@@ -11211,7 +11211,7 @@ legitimize_pe_coff_symbol (rtx addr, bool inreg)
 
   if (GET_CODE (addr) == CONST
       && GET_CODE (XEXP (addr, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (addr, 0), 0))
       && !is_imported_p (XEXP (XEXP (addr, 0), 0))
       && SYMBOL_REF_EXTERNAL_P (XEXP (XEXP (addr, 0), 0))
       && SYMBOL_REF_DECL (XEXP (XEXP (addr, 0), 0)))
@@ -11246,12 +11246,12 @@ ix86_legitimize_address (rtx x, rtx, machine_mode mode)
   bool changed = false;
   unsigned log;
 
-  log = GET_CODE (x) == SYMBOL_REF ? SYMBOL_REF_TLS_MODEL (x) : 0;
+  log = SYMBOL_REF_P (x) ? SYMBOL_REF_TLS_MODEL (x) : 0;
   if (log)
     return legitimize_tls_address (x, (enum tls_model) log, false);
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
       && (log = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (x, 0), 0))))
     {
       rtx t = legitimize_tls_address (XEXP (XEXP (x, 0), 0),
@@ -11659,7 +11659,7 @@ ix86_delegitimize_tls_address (rtx orig_x)
   if (GET_CODE (unspec) != UNSPEC || XINT (unspec, 1) != UNSPEC_NTPOFF)
     return orig_x;
   x = XVECEXP (unspec, 0, 0);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
   if (unspec != XEXP (addr.disp, 0))
     x = gen_rtx_PLUS (Pmode, x, XEXP (XEXP (addr.disp, 0), 1));
   if (addr.index)
@@ -12956,7 +12956,7 @@ ix86_print_operand (FILE *file, rtx x, int code)
 	      if (ASSEMBLER_DIALECT == ASM_ATT)
 		putc ('$', file);
 	    }
-	  else if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF
+	  else if (GET_CODE (x) == CONST || SYMBOL_REF_P (x)
 		   || LABEL_REF_P (x))
 	    {
 	      if (ASSEMBLER_DIALECT == ASM_ATT)
@@ -13053,7 +13053,7 @@ ix86_print_operand_address_as (FILE *file, rtx addr,
 	symbol = XEXP (XEXP (disp, 0), 0);
 
       if (LABEL_REF_P (symbol)
-	  || (GET_CODE (symbol) == SYMBOL_REF
+	  || (SYMBOL_REF_P (symbol)
 	      && SYMBOL_REF_TLS_MODEL (symbol) == 0))
 	base = pc_rtx;
     }
@@ -15664,7 +15664,7 @@ ix86_rip_relative_addr_p (struct ix86_address *parts)
 	    symbol = XEXP (symbol, 0);
 
 	  if (LABEL_REF_P (symbol)
-	      || (GET_CODE (symbol) == SYMBOL_REF
+	      || (SYMBOL_REF_P (symbol)
 		  && SYMBOL_REF_TLS_MODEL (symbol) == 0)
 	      || (GET_CODE (symbol) == UNSPEC
 		  && (XINT (symbol, 1) == UNSPEC_GOTPCREL
@@ -22120,7 +22120,7 @@ extract_base_offset_in_addr (rtx mem, rtx *base, rtx *offset)
   if (GET_CODE (addr) == CONST)
     addr = XEXP (addr, 0);
 
-  if (REG_P (addr) || GET_CODE (addr) == SYMBOL_REF)
+  if (REG_P (addr) || SYMBOL_REF_P (addr))
     {
       *base = addr;
       *offset = const0_rtx;
@@ -22129,7 +22129,7 @@ extract_base_offset_in_addr (rtx mem, rtx *base, rtx *offset)
 
   if (GET_CODE (addr) == PLUS
       && (REG_P (XEXP (addr, 0))
-	  || GET_CODE (XEXP (addr, 0)) == SYMBOL_REF)
+	  || SYMBOL_REF_P (XEXP (addr, 0)))
       && CONST_INT_P (XEXP (addr, 1)))
     {
       *base = XEXP (addr, 0);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 3f037a72b18..1b787f86968 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1843,7 +1843,7 @@ typedef struct ix86_args {
 #define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)
 
 #define SYMBOLIC_CONST(X)	\
-  (GET_CODE (X) == SYMBOL_REF						\
+  (SYMBOL_REF_P (X)						\
    || LABEL_REF_P (X)						\
    || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 785a0d11b1b..44b0822c02c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -8476,7 +8476,7 @@
 		   (zero_extend:DI (and:SI (match_dup 1) (match_dup 2))))
 	      (clobber (reg:CC FLAGS_REG))])]
 {
-  if (GET_CODE (operands[2]) == SYMBOL_REF
+  if (SYMBOL_REF_P (operands[2])
       || LABEL_REF_P (operands[2]))
     {
       operands[2] = shallow_copy_rtx (operands[2]);
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 9cf0473bd97..33df906ec92 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -510,7 +510,7 @@
 
     case CONST:
       op = XEXP (op, 0);
-      if (GET_CODE (op) == SYMBOL_REF
+      if (SYMBOL_REF_P (op)
 	  || LABEL_REF_P (op)
 	  || (GET_CODE (op) == UNSPEC
 	      && (XINT (op, 1) == UNSPEC_GOT
@@ -523,7 +523,7 @@
 	return false;
 
       op = XEXP (op, 0);
-      if (GET_CODE (op) == SYMBOL_REF
+      if (SYMBOL_REF_P (op)
 	  || LABEL_REF_P (op))
 	return true;
       /* Only @GOTOFF gets offsets.  */
@@ -532,7 +532,7 @@
 	return false;
 
       op = XVECEXP (op, 0, 0);
-      if (GET_CODE (op) == SYMBOL_REF
+      if (SYMBOL_REF_P (op)
 	  || LABEL_REF_P (op))
 	return true;
       return false;
@@ -554,7 +554,7 @@
   if (LABEL_REF_P (op))
     return true;
 
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return false;
 
   if (SYMBOL_REF_TLS_MODEL (op))
@@ -1131,7 +1131,7 @@
 	}
       if (TARGET_64BIT
 	  && flag_pic
-	  && (GET_CODE (disp) == SYMBOL_REF
+	  && (SYMBOL_REF_P (disp)
 	      || LABEL_REF_P (disp)))
 	return false;
     }
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 1b439552f9c..cb27b101506 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -306,7 +306,7 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
     return;
 
   symbol = XEXP (rtl, 0);
-  gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (symbol));
 
   switch (TREE_CODE (decl))
     {
@@ -651,7 +651,7 @@ i386_pe_maybe_record_exported_symbol (tree decl, const char *name, int is_data)
     return;
 
   symbol = XEXP (DECL_RTL (decl), 0);
-  gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (symbol));
   if (!SYMBOL_REF_DLLEXPORT_P (symbol))
     return;
 
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 86ef8bc0078..de5d47459ed 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -878,7 +878,7 @@ ia64_encode_section_info (tree decl, rtx rtl, int first)
   /* Careful not to prod global register variables.  */
   if (TREE_CODE (decl) == VAR_DECL
       && MEM_P (DECL_RTL (decl))
-      && GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (DECL_RTL (decl), 0))
       && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
     ia64_encode_addr_area (decl, XEXP (rtl, 0));
 }
@@ -974,10 +974,10 @@ tls_symbolic_operand_type (rtx addr)
   if (GET_CODE (addr) == CONST)
     {
       if (GET_CODE (XEXP (addr, 0)) == PLUS
-	  && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF)
+	  && SYMBOL_REF_P (XEXP (XEXP (addr, 0), 0)))
         tls_kind = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (addr, 0), 0));
     }
-  else if (GET_CODE (addr) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (addr))
     tls_kind = SYMBOL_REF_TLS_MODEL (addr);
 
   return tls_kind;
@@ -1133,7 +1133,7 @@ ia64_expand_load_address (rtx dest, rtx src)
 
   if (TARGET_AUTO_PIC)
     emit_insn (gen_load_gprel64 (dest, src));
-  else if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (src))
+  else if (SYMBOL_REF_P (src) && SYMBOL_REF_FUNCTION_P (src))
     emit_insn (gen_load_fptr (dest, src));
   else if (sdata_symbolic_operand (src, VOIDmode))
     emit_insn (gen_load_gprel (dest, src));
@@ -4351,7 +4351,7 @@ ia64_assemble_integer (rtx x, unsigned int size, int aligned_p)
 {
   if (size == POINTER_SIZE / BITS_PER_UNIT
       && !(TARGET_NO_PIC || TARGET_AUTO_PIC)
-      && GET_CODE (x) == SYMBOL_REF
+      && SYMBOL_REF_P (x)
       && SYMBOL_REF_FUNCTION_P (x))
     {
       static const char * const directive[2][2] = {
diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md
index 4b78dcf4971..9af0e4761c6 100644
--- a/gcc/config/ia64/predicates.md
+++ b/gcc/config/ia64/predicates.md
@@ -44,7 +44,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       offset = INTVAL (XEXP (op, 1));
@@ -109,7 +109,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       op = XEXP (op, 0);
@@ -132,7 +132,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
       op = XEXP (op, 0);
@@ -183,7 +183,7 @@
       /* Accept only (plus (symbol_ref) (const_int)).  */
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
           || !CONST_INT_P (XEXP (op, 1)))
         return false;
 
@@ -226,7 +226,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1)))
 	return false;
 
@@ -266,7 +266,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-	  || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (op, 0))
 	  || !CONST_INT_P (XEXP (op, 1))
 	  || (INTVAL (XEXP (op, 1)) & 0x3fff) != 0)
 	return false;
@@ -290,7 +290,7 @@
     case CONST:
       op = XEXP (op, 0);
       if (GET_CODE (op) != PLUS
-          || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+          || !SYMBOL_REF_P (XEXP (op, 0))
           || !CONST_INT_P (XEXP (op, 1)))
         return false;
       op = XEXP (op, 0);
@@ -336,7 +336,7 @@
 	/* Accept only (plus (symbol_ref) (const_int)).  */
 	op = XEXP (op, 0);
 	if (GET_CODE (op) != PLUS
-	    || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+	    || !SYMBOL_REF_P (XEXP (op, 0))
             || !CONST_INT_P (XEXP (op, 1)))
 	  return false;
 
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 44a6fbfe122..f2916b69bcd 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -289,9 +289,9 @@ iq2000_check_split (rtx address, machine_mode mode)
   if (GET_MODE_SIZE (mode) > (unsigned) UNITS_PER_WORD)
     return 0;
 
-  if ((GET_CODE (address) == SYMBOL_REF)
+  if ((SYMBOL_REF_P (address))
       || (GET_CODE (address) == CONST
-	  && GET_CODE (XEXP (XEXP (address, 0), 0)) == SYMBOL_REF)
+	  && SYMBOL_REF_P (XEXP (XEXP (address, 0), 0)))
       || LABEL_REF_P (address))
     return 1;
 
@@ -825,7 +825,7 @@ iq2000_address_cost (rtx addr, machine_mode mode, addr_space_t as,
 	if (LABEL_REF_P (addr))
 	  return 2;
 
-	if (GET_CODE (addr) != SYMBOL_REF)
+	if (!SYMBOL_REF_P (addr))
 	  return 4;
 
 	if (! SMALL_INT (offset))
@@ -3443,7 +3443,7 @@ iq2000_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED,
 
 	if (LABEL_REF_P (symref))
 	  * total = COSTS_N_INSNS (2);
-	else if (GET_CODE (symref) != SYMBOL_REF)
+	else if (!SYMBOL_REF_P (symref))
 	  * total = COSTS_N_INSNS (4);
 	/* Let's be paranoid....  */
 	else if (INTVAL (offset) < -32768 || INTVAL (offset) > 32767)
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index 5224b0a49be..d96159a54d1 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -345,7 +345,7 @@ typedef struct iq2000_args
 /* Addressing Modes.  */
 
 #define CONSTANT_ADDRESS_P(X)						\
-  (   (LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF		\
+  (   (LABEL_REF_P (X) || SYMBOL_REF_P (X)		\
     || CONST_INT_P (X) || GET_CODE (X) == HIGH		\
     || (GET_CODE (X) == CONST)))
 
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index 9f7c4cc54aa..0ad519e91d6 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -899,7 +899,7 @@ nonpic_symbol_mentioned_p (rtx x)
   const char *fmt;
   int i;
 
-  if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x)
+  if (SYMBOL_REF_P (x) || LABEL_REF_P (x)
       || GET_CODE (x) == PC)
     return 1;
 
@@ -1222,7 +1222,7 @@ lm32_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x, bool stric
     return true;
               
   /* gp(sym)  */   
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_SMALL_P (x)) 
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_SMALL_P (x)) 
     return true;
     
   return false;                                
diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h
index 636e13e25e7..514e47358f3 100644
--- a/gcc/config/lm32/lm32.h
+++ b/gcc/config/lm32/lm32.h
@@ -305,7 +305,7 @@ enum reg_class
 /*---------------------*/
 
 #define CONSTANT_ADDRESS_P(X)						\
-  ((LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF		\
+  ((LABEL_REF_P (X) || SYMBOL_REF_P (X)		\
     || CONST_INT_P (X) || GET_CODE (X) == HIGH		\
     || (GET_CODE (X) == CONST)))
 
diff --git a/gcc/config/lm32/lm32.md b/gcc/config/lm32/lm32.md
index 31337484f13..357e0749b0b 100644
--- a/gcc/config/lm32/lm32.md
+++ b/gcc/config/lm32/lm32.md
@@ -149,7 +149,7 @@
   if (flag_pic && symbolic_operand (operands[1], SImode)) 
     {
       if (LABEL_REF_P (operands[1])
-          || (GET_CODE (operands[1]) == SYMBOL_REF 
+          || (SYMBOL_REF_P (operands[1]) 
               && SYMBOL_REF_LOCAL_P (operands[1])
               && !SYMBOL_REF_WEAK (operands[1])))
         {
@@ -174,7 +174,7 @@
           rtx arg0 = XEXP (op, 0);
           rtx arg1 = XEXP (op, 1);
           if (LABEL_REF_P (arg0)
-              || (GET_CODE (arg0) == SYMBOL_REF 
+              || (SYMBOL_REF_P (arg0) 
                   && SYMBOL_REF_LOCAL_P (arg0)
                   && !SYMBOL_REF_WEAK (arg0)))
             {
diff --git a/gcc/config/m32c/addsub.md b/gcc/config/m32c/addsub.md
index 90f86fd935b..ba18bfcd48a 100644
--- a/gcc/config/m32c/addsub.md
+++ b/gcc/config/m32c/addsub.md
@@ -92,7 +92,7 @@
     case 1:
       return \"add.w %X2,%h0\;adcf.w %H0\";
     case 2:
-      if (GET_CODE (operands[2]) == SYMBOL_REF)
+      if (SYMBOL_REF_P (operands[2]))
         {
           output_asm_insn (\"add.w #%%lo(%d2),%h0\",operands);
           return \"adc.w #%%hi(%d2),%H0\";
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 4a122a76908..b524c8eadd4 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -2353,7 +2353,7 @@ m32c_asm_integer (rtx x, unsigned int size, int aligned_p)
       fputc ('\n', asm_out_file);
       return true;
     case 4:
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  fprintf (asm_out_file, "\t.long\t");
 	  output_addr_const (asm_out_file, x);
@@ -2972,7 +2972,7 @@ current_function_special_page_vector (rtx x)
 {
   int num;
 
-  if ((GET_CODE(x) == SYMBOL_REF)
+  if ((SYMBOL_REF_P (x))
       && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     {
       tree list;
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 19533fa4323..5bb40ad2a44 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -549,12 +549,12 @@ small_data_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
   if (! TARGET_SDATA_USE)
     return 0;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return SYMBOL_REF_SMALL_P (op);
 
   if (GET_CODE (op) == CONST
       && GET_CODE (XEXP (op, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
       && satisfies_constraint_J (XEXP (XEXP (op, 0), 1)))
     return SYMBOL_REF_SMALL_P (XEXP (XEXP (op, 0), 0));
 
@@ -574,11 +574,11 @@ addr24_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
   if (LABEL_REF_P (op))
     return TARGET_ADDR24;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     sym = op;
   else if (GET_CODE (op) == CONST
 	   && GET_CODE (XEXP (op, 0)) == PLUS
-	   && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+	   && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 	   && satisfies_constraint_M (XEXP (XEXP (op, 0), 1)))
     sym = XEXP (XEXP (op, 0), 0);
   else
@@ -605,11 +605,11 @@ addr32_operand (rtx op, machine_mode mode)
   if (LABEL_REF_P (op))
     return TARGET_ADDR32;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     sym = op;
   else if (GET_CODE (op) == CONST
 	   && GET_CODE (XEXP (op, 0)) == PLUS
-	   && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+	   && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 	   && CONST_INT_P (XEXP (XEXP (op, 0), 1))
 	   && ! flag_pic)
     sym = XEXP (XEXP (op, 0), 0);
@@ -628,7 +628,7 @@ call26_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
   if (flag_pic)
     return 1;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return SYMBOL_REF_MODEL (op) != M32R_MODEL_LARGE;
 
   return TARGET_CALL26;
@@ -1931,12 +1931,12 @@ direct_return (void)
 int
 m32r_legitimate_pic_operand_p (rtx x)
 {
-  if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+  if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
     return 0;
 
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
           || LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
       && (CONST_INT_P (XEXP (XEXP (x, 0), 1))))
     return 0;
@@ -1951,7 +1951,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
   printf("m32r_legitimize_pic_address()\n");
 #endif
 
-  if (GET_CODE (orig) == SYMBOL_REF || LABEL_REF_P (orig))
+  if (SYMBOL_REF_P (orig) || LABEL_REF_P (orig))
     {
       rtx pic_ref, address;
       int subregs = 0;
@@ -1972,7 +1972,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
       crtl->uses_pic_offset_table = 1;
 
       if (LABEL_REF_P (orig)
-          || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig)))
+          || (SYMBOL_REF_P (orig) && SYMBOL_REF_LOCAL_P (orig)))
         {
           emit_insn (gen_gotoff_load_addr (reg, orig));
           emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx));
@@ -2343,7 +2343,7 @@ m32r_print_operand_address (FILE * file, machine_mode /*mode*/, rtx addr)
 	    fprintf (file, "%s,%s",
 		     reg_names[REGNO (base)], reg_names[REGNO (index)]);
 	  /* Not sure this can happen, but leave in for now.  */
-	  else if (GET_CODE (index) == SYMBOL_REF)
+	  else if (SYMBOL_REF_P (index))
 	    {
 	      output_addr_const (file, index);
 	      fputc (',', file);
@@ -2963,7 +2963,7 @@ m32r_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
 {
   return !(GET_CODE (x) == CONST
 	   && GET_CODE (XEXP (x, 0)) == PLUS
-	   && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+	   && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	       || LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
 	   && CONST_INT_P (XEXP (XEXP (x, 0), 1))
 	   && UINTVAL (XEXP (XEXP (x, 0), 1)) > 32767);
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 99b976523a8..84fdac2d018 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -686,7 +686,7 @@ L2:     .word STATIC
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X)   \
   (    LABEL_REF_P (X)  \
-   ||  GET_CODE (X) == SYMBOL_REF \
+   ||  SYMBOL_REF_P (X) \
    ||  CONST_INT_P (X)  \
    || (GET_CODE (X) == CONST      \
        && ! (flag_pic && ! m32r_legitimate_pic_operand_p (X))))
diff --git a/gcc/config/m32r/predicates.md b/gcc/config/m32r/predicates.md
index e180aee143e..09550362809 100644
--- a/gcc/config/m32r/predicates.md
+++ b/gcc/config/m32r/predicates.md
@@ -426,13 +426,13 @@
   if (flag_pic)
     return 0;
 
-  if (GET_CODE (op) == SYMBOL_REF
+  if (SYMBOL_REF_P (op)
       || LABEL_REF_P (op))
     return 1;
 
   if (GET_CODE (op) == CONST
       && GET_CODE (XEXP (op, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
       && satisfies_constraint_J (XEXP (XEXP (op, 0), 1)))
     return 1;
 
diff --git a/gcc/config/m68k/constraints.md b/gcc/config/m68k/constraints.md
index c0318055286..14caa0d623d 100644
--- a/gcc/config/m68k/constraints.md
+++ b/gcc/config/m68k/constraints.md
@@ -87,7 +87,7 @@
   "Used for operands that satisfy 'm' when -mpcrel is in effect."
   (and (match_code "mem")
        (match_test "TARGET_PCREL
-		    && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+		    && (SYMBOL_REF_P (XEXP (op, 0))
 			|| LABEL_REF_P (XEXP (op, 0))
 			|| GET_CODE (XEXP (op, 0)) == CONST)")))
 
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 64cedf626e9..21568d51fea 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -1033,7 +1033,7 @@ m68k_expand_prologue (void)
   /* If the stack limit is a symbol, we can check it here,
      before actually allocating the space.  */
   if (crtl->limit_stack
-      && GET_CODE (stack_limit_rtx) == SYMBOL_REF)
+      && SYMBOL_REF_P (stack_limit_rtx))
     {
       limit = plus_constant (Pmode, stack_limit_rtx, current_frame.size + 4);
       if (!m68k_legitimate_constant_p (Pmode, limit))
@@ -1132,7 +1132,7 @@ m68k_expand_prologue (void)
 			         stack_pointer_rtx, stack_limit_rtx,
 			         const1_rtx));
 
-      else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF)
+      else if (!SYMBOL_REF_P (stack_limit_rtx))
 	warning (0, "stack limit expression is not supported");
     }
 
@@ -1936,7 +1936,7 @@ m68k_illegitimate_symbolic_constant_p (rtx x)
   if (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
     {
       split_const (x, &base, &offset);
-      if (GET_CODE (base) == SYMBOL_REF
+      if (SYMBOL_REF_P (base)
 	  && !offset_within_block_p (base, INTVAL (offset)))
 	return true;
     }
@@ -1971,7 +1971,7 @@ m68k_legitimate_constant_address_p (rtx x, unsigned int reach, bool strict_p)
   if (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P && reach > 1)
     {
       split_const (x, &base, &offset);
-      if (GET_CODE (base) == SYMBOL_REF
+      if (SYMBOL_REF_P (base)
 	  && !offset_within_block_p (base, INTVAL (offset) + reach - 1))
 	return false;
     }
@@ -2471,7 +2471,7 @@ legitimize_pic_address (rtx orig, machine_mode mode ATTRIBUTE_UNUSED,
   rtx pic_ref = orig;
 
   /* First handle a simple SYMBOL_REF or LABEL_REF */
-  if (GET_CODE (orig) == SYMBOL_REF || LABEL_REF_P (orig))
+  if (SYMBOL_REF_P (orig) || LABEL_REF_P (orig))
     {
       gcc_assert (reg);
 
@@ -2704,7 +2704,7 @@ m68k_tls_symbol_p (rtx x)
   if (!TARGET_HAVE_TLS)
     return false;
 
-  if (GET_CODE (x) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (x))
     return false;
 
   return SYMBOL_REF_TLS_MODEL (x) != 0;
@@ -2728,7 +2728,7 @@ m68k_tls_reference_p (rtx x, bool legitimate_p)
 	  rtx x = *iter;
 
 	  /* Note: this is not the same as m68k_tls_symbol_p.  */
-	  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+	  if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	    return true;
 
 	  /* Don't recurse into legitimate TLS references.  */
@@ -3064,11 +3064,11 @@ output_move_simode (rtx *operands)
 {
   if (CONST_INT_P (operands[1]))
     return output_move_simode_const (operands);
-  else if ((GET_CODE (operands[1]) == SYMBOL_REF
+  else if ((SYMBOL_REF_P (operands[1])
 	    || GET_CODE (operands[1]) == CONST)
 	   && push_operand (operands[0], SImode))
     return "pea %a1";
-  else if ((GET_CODE (operands[1]) == SYMBOL_REF
+  else if ((SYMBOL_REF_P (operands[1])
 	    || GET_CODE (operands[1]) == CONST)
 	   && ADDRESS_REG_P (operands[0]))
     return "lea %a1,%0";
@@ -4486,7 +4486,7 @@ print_operand (FILE *file, rtx op, int letter)
   else if (letter == 'p')
     {
       output_addr_const (file, op);
-      if (!(GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (op)))
+      if (!(SYMBOL_REF_P (op) && SYMBOL_REF_LOCAL_P (op)))
 	fprintf (file, "@PLTPC");
     }
   else if (REG_P (op))
@@ -4533,7 +4533,7 @@ print_operand (FILE *file, rtx op, int letter)
 	 to ensure that we print relevant PIC stuff.  */
       asm_fprintf (file, "%I");
       if (TARGET_PCREL
-	  && (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST))
+	  && (SYMBOL_REF_P (op) || GET_CODE (op) == CONST))
 	print_operand_address (file, op);
       else
 	output_addr_const (file, op);
@@ -4662,7 +4662,7 @@ m68k_delegitimize_address (rtx orig_x)
 	  && XINT (unspec, 1) != UNSPEC_RELOC32))
     return orig_x;
   x = XVECEXP (unspec, 0, 0);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x));
+  gcc_assert (SYMBOL_REF_P (x) || LABEL_REF_P (x));
   if (unspec != XEXP (addr.offset, 0))
     x = gen_rtx_PLUS (Pmode, x, XEXP (XEXP (addr.offset, 0), 1));
   if (addr.index)
@@ -4737,7 +4737,7 @@ print_operand_address (FILE *file, rtx addr)
 	  /* (xxx).l.  We need a special case for SYMBOL_REF if the symbol
 	     name ends in `.<letter>', as the last 2 characters can be
 	     mistaken as a size suffix.  Put the name in parentheses.  */
-	  if (GET_CODE (addr) == SYMBOL_REF
+	  if (SYMBOL_REF_P (addr)
 	      && strlen (XSTR (addr, 0)) > 2
 	      && XSTR (addr, 0)[strlen (XSTR (addr, 0)) - 2] == '.')
 	    {
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index cd74628fe55..7a1112378e2 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -630,7 +630,7 @@ __transfer_from_trampoline ()					\
 #define MAX_REGS_PER_ADDRESS 2
 
 #define CONSTANT_ADDRESS_P(X)						\
-  ((LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF		\
+  ((LABEL_REF_P (X) || SYMBOL_REF_P (X)		\
     || CONST_INT_P (X) || GET_CODE (X) == CONST		\
     || GET_CODE (X) == HIGH)						\
    && m68k_legitimate_constant_p (Pmode, X))
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index c995f4469c3..f3760031131 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -900,7 +900,7 @@
           tmp = XEXP (XEXP (tmp, 0), 0);
         }
 
-      gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (tmp));
       gcc_assert (SYMBOL_REF_TLS_MODEL (tmp) != 0);
 
       tmp = m68k_legitimize_tls_address (tmp);
@@ -944,7 +944,7 @@
   if (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
     {
       split_const (operands[1], &base, &offset);
-      if (GET_CODE (base) == SYMBOL_REF
+      if (SYMBOL_REF_P (base)
 	  && !offset_within_block_p (base, INTVAL (offset)))
 	{
 	  tmp = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (SImode);
diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md
index 6fa1df65938..37be09a47a2 100644
--- a/gcc/config/m68k/predicates.md
+++ b/gcc/config/m68k/predicates.md
@@ -26,7 +26,7 @@
 {
   if (TARGET_PCREL
       && MEM_P (op)
-      && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (op, 0))
 	  || LABEL_REF_P (XEXP (op, 0))
 	  || GET_CODE (XEXP (op, 0)) == CONST))
     return 1;
@@ -41,7 +41,7 @@
   (match_code "subreg,reg,mem")
 {
   if (TARGET_PCREL && MEM_P (op)
-      && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (op, 0))
 	  || LABEL_REF_P (XEXP (op, 0))
 	  || GET_CODE (XEXP (op, 0)) == CONST))
     return 1;
@@ -55,7 +55,7 @@
   (match_code "subreg,mem")
 {
   if (TARGET_PCREL && MEM_P (op)
-      && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (op, 0))
 	  || LABEL_REF_P (XEXP (op, 0))
 	  || GET_CODE (XEXP (op, 0)) == CONST))
     return 1;
@@ -150,7 +150,7 @@
 
     case CONST:
       op = XEXP (op, 0);
-      return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      return ((SYMBOL_REF_P (XEXP (op, 0))
 	       || LABEL_REF_P (XEXP (op, 0)))
 	      && CONST_INT_P (XEXP (op, 1)));
 
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index d7c70861426..c53298387a9 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -698,7 +698,7 @@ mcore_symbolic_address_p (rtx x)
       return 1;
     case CONST:
       x = XEXP (x, 0);
-      return (   (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      return (   (SYMBOL_REF_P (XEXP (x, 0))
 	       || LABEL_REF_P (XEXP (x, 0)))
 	      && CONST_INT_P (XEXP (x, 1)));
     default:
@@ -731,7 +731,7 @@ mcore_output_call (rtx operands[], int index)
       if (TARGET_CG_DATA)
 	{
 	  gcc_assert (mcore_current_function_name);
-	  gcc_assert (GET_CODE (addr) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (addr));
 	  
 	  ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name,
 			      XSTR (addr, 0), 0);
@@ -1991,7 +1991,7 @@ mcore_expand_prolog (void)
       
       x = XEXP (x, 0);
       
-      gcc_assert (GET_CODE (x) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (x));
       
       free (mcore_current_function_name);
       
@@ -2913,7 +2913,7 @@ mcore_mark_dllexport (tree decl)
   
   if (MEM_P (rtlname))
     rtlname = XEXP (rtlname, 0);
-  gcc_assert (GET_CODE (rtlname) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (rtlname));
   oldname = XSTR (rtlname, 0);
   
   if (mcore_dllexport_name_p (oldname))
@@ -2948,7 +2948,7 @@ mcore_mark_dllimport (tree decl)
   
   if (MEM_P (rtlname))
     rtlname = XEXP (rtlname, 0);
-  gcc_assert (GET_CODE (rtlname) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (rtlname));
   oldname = XSTR (rtlname, 0);
   
   gcc_assert (!mcore_dllexport_name_p (oldname));
@@ -3034,7 +3034,7 @@ mcore_encode_section_info (tree decl, rtx rtl ATTRIBUTE_UNUSED, int first ATTRIB
 	   && DECL_RTL (decl) != NULL_RTX
 	   && MEM_P (DECL_RTL (decl))
 	   && MEM_P (XEXP (DECL_RTL (decl), 0))
-	   && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF
+	   && SYMBOL_REF_P (XEXP (XEXP (DECL_RTL (decl), 0), 0))
 	   && mcore_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0)))
     {
       const char * oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index d85030c47da..cc4d3a07607 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -432,7 +432,7 @@ microblaze_tls_symbol_p (rtx x)
   if (!TARGET_HAVE_TLS)
     return false;
 
-  if (GET_CODE (x) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (x))
     return false;
 
   return SYMBOL_REF_TLS_MODEL (x) != 0;
@@ -449,7 +449,7 @@ microblaze_tls_referenced_p (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+      if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	return true;
       /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are
 	 TLS offsets, not real symbol references.  */
@@ -472,7 +472,7 @@ symbol_mentioned_p (rtx x)
   const char * fmt;
   int i;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return 1;
 
   /* UNSPEC entries for a symbol include the SYMBOL_REF, but they
@@ -693,7 +693,7 @@ get_base_reg (rtx x)
     base_reg = MB_ABI_PIC_ADDR_REGNUM;
 
   if (TARGET_XLGPOPT
-      && GET_CODE (x) == SYMBOL_REF
+      && SYMBOL_REF_P (x)
       && SYMBOL_REF_SMALL_P (x) && (decl = SYMBOL_REF_DECL (x)) != NULL)
     {
       if (TREE_READONLY (decl))
@@ -778,7 +778,7 @@ microblaze_classify_address (struct microblaze_address_info *info, rtx x,
 
 		return microblaze_classify_unspec (info, xplus1);
 	      }
-	    else if ((GET_CODE (xplus1) == SYMBOL_REF ||
+	    else if ((SYMBOL_REF_P (xplus1) ||
 		      LABEL_REF_P (xplus1)))
 	      {
 		if (flag_pic == 2 || microblaze_tls_symbol_p(xplus1))
@@ -816,7 +816,7 @@ microblaze_classify_address (struct microblaze_address_info *info, rtx x,
 		    xconst0 = XEXP (xconst0, 0);
 		  }
 
-		if (GET_CODE (xconst0) == SYMBOL_REF
+		if (SYMBOL_REF_P (xconst0)
 		    || LABEL_REF_P (xconst0))
 		  {
 		    if (flag_pic == 2 || microblaze_tls_symbol_p(xconst0))
@@ -883,7 +883,7 @@ microblaze_classify_address (struct microblaze_address_info *info, rtx x,
 
 	/* Avoid error in print_operand_address in case UNSPEC
 	 is removed from SYMBOL or LABEL REFS during optimization.  */
-	if ((GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+	if ((SYMBOL_REF_P (x) || LABEL_REF_P (x))
 	    && flag_pic && TARGET_PIC_DATA_TEXT_REL && strict == 2)
 	  {
 	    info->type = ADDRESS_SYMBOLIC_TXT_REL;
@@ -928,7 +928,7 @@ microblaze_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 bool
 microblaze_constant_address_p (rtx x)
 {
-  return ((LABEL_REF_P (x)) || (GET_CODE (x) == SYMBOL_REF)
+  return ((LABEL_REF_P (x)) || (SYMBOL_REF_P (x))
 	  || CONST_INT_P (x)
 	  || (GET_CODE (x) == CONST
 	  && ! (flag_pic && pic_address_needs_scratch (x))));
@@ -1100,7 +1100,7 @@ microblaze_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
 	}
     }
 
-  if (GET_CODE (xinsn) == SYMBOL_REF)
+  if (SYMBOL_REF_P (xinsn))
     {
       rtx reg;
       if (microblaze_tls_symbol_p(xinsn))
@@ -1505,7 +1505,7 @@ pic_address_needs_scratch (rtx x)
       p0 = XEXP (XEXP (x, 0), 0);
       p1 = XEXP (XEXP (x, 0), 1);
 
-      if ((GET_CODE (p0) == SYMBOL_REF || LABEL_REF_P (p0))
+      if ((SYMBOL_REF_P (p0) || LABEL_REF_P (p0))
           && (CONST_INT_P (p1))
           && (flag_pic == 2 || microblaze_tls_symbol_p (p0) || !SMALL_INT (p1)))
         return 1;
@@ -3291,7 +3291,7 @@ static rtx
 expand_pic_symbol_ref (machine_mode mode ATTRIBUTE_UNUSED, rtx op)
 {
   rtx result;
-  bool isFunc = (GET_CODE (op) == SYMBOL_REF
+  bool isFunc = (SYMBOL_REF_P (op)
 		 && (SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_FUNCTION));
   result = (!TARGET_PIC_DATA_TEXT_REL)
 	    ? gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op), UNSPEC_GOTOFF)
@@ -3396,7 +3396,7 @@ microblaze_expand_move (machine_mode mode, rtx operands[])
     }
   /* If operands[1] is a constant address invalid for pic, then we need to
      handle it just like LEGITIMIZE_ADDRESS does.  */
-  if (GET_CODE (op1) == SYMBOL_REF || LABEL_REF_P (op1))
+  if (SYMBOL_REF_P (op1) || LABEL_REF_P (op1))
     {
       rtx result;
       if (microblaze_tls_symbol_p(op1))
@@ -3451,7 +3451,7 @@ microblaze_expand_move (machine_mode mode, rtx operands[])
 
       if ((CONST_INT_P (p1))
 	  && ((GET_CODE (p0) == UNSPEC)
-	      || ((GET_CODE (p0) == SYMBOL_REF || LABEL_REF_P (p0))
+	      || ((SYMBOL_REF_P (p0) || LABEL_REF_P (p0))
 	          && (flag_pic == 2 || microblaze_tls_symbol_p (p0)
 		      || !SMALL_INT (p1)))))
 	{
@@ -3787,7 +3787,7 @@ microblaze_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
             if ((GET_CODE (p0) == UNSPEC))
               return false;
 
-            if ((GET_CODE (p0) == SYMBOL_REF || LABEL_REF_P (p0))
+            if ((SYMBOL_REF_P (p0) || LABEL_REF_P (p0))
                  && (microblaze_tls_symbol_p (p0) || !SMALL_INT (p1)))
               return false;
           }
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index a83d7ff2d80..cf64c31634b 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -2056,7 +2056,7 @@
     rtx addr = XEXP (operands[0], 0);
 
     if (flag_pic == 2 && !TARGET_PIC_DATA_TEXT_REL
-    && GET_CODE (addr) == SYMBOL_REF
+    && SYMBOL_REF_P (addr)
 	&& !SYMBOL_REF_LOCAL_P (addr)) 
       {
         rtx temp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PLT);
@@ -2125,7 +2125,7 @@
     register rtx target = operands[0];
     register rtx target2 = gen_rtx_REG (Pmode,
 			      GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
-    if (GET_CODE (target) == SYMBOL_REF) {
+    if (SYMBOL_REF_P (target)) {
         if (microblaze_break_function_p (SYMBOL_REF_DECL (target))) {
             gen_rtx_CLOBBER (VOIDmode, target2);
             return "brki\tr16,%0\;%#";
@@ -2160,7 +2160,7 @@
     rtx addr = XEXP (operands[1], 0);
 
     if (flag_pic == 2 && !TARGET_PIC_DATA_TEXT_REL
-    && GET_CODE (addr) == SYMBOL_REF
+    && SYMBOL_REF_P (addr)
 	&& !SYMBOL_REF_LOCAL_P (addr)) 
       {
         rtx temp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PLT);
@@ -2235,7 +2235,7 @@
     register rtx target = operands[1];
     register rtx target2=gen_rtx_REG (Pmode,GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
 
-    if (GET_CODE (target) == SYMBOL_REF)
+    if (SYMBOL_REF_P (target))
     {
       gen_rtx_CLOBBER (VOIDmode,target2);
       if (microblaze_break_function_p (SYMBOL_REF_DECL (target)))
diff --git a/gcc/config/microblaze/predicates.md b/gcc/config/microblaze/predicates.md
index fae269894c4..4aaf6602146 100644
--- a/gcc/config/microblaze/predicates.md
+++ b/gcc/config/microblaze/predicates.md
@@ -63,7 +63,7 @@
                   p0 = XEXP (const0, 0);
                   p1 = XEXP (const0, 1);
 
-                  if ((GET_CODE(p0) == SYMBOL_REF
+                  if ((SYMBOL_REF_P (p0)
                        || LABEL_REF_P (p0))
                       && CONST_INT_P (p1))
                     {
@@ -101,7 +101,7 @@
 
 (define_predicate "call_insn_simple_operand"
   (and (match_test "CALL_INSN_OP (op)")
-       (match_test "REG_P (op) || GET_CODE (op) == SYMBOL_REF || CONST_INT_P (op)")))
+       (match_test "REG_P (op) || SYMBOL_REF_P (op) || CONST_INT_P (op)")))
 
 ;; Return if OPERAND is valid as a source operand for a move instruction.
 (define_predicate "move_src_operand"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 34287cb40e1..016f72ddce1 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1823,7 +1823,7 @@ mips_got_symbol_type_p (enum mips_symbol_type type)
 static bool
 mips_tls_symbol_p (rtx x)
 {
-  return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
+  return SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0;
 }
 
 /* Return true if SYMBOL_REF X is associated with a global symbol
@@ -1848,7 +1848,7 @@ mips_global_symbol_p (const_rtx x)
 static bool
 mips16_stub_function_p (const_rtx x)
 {
-  return (GET_CODE (x) == SYMBOL_REF
+  return (SYMBOL_REF_P (x)
 	  && strncmp (XSTR (x, 0), "__mips16_", 9) == 0);
 }
 
@@ -1858,7 +1858,7 @@ mips16_stub_function_p (const_rtx x)
 static bool
 mips16_local_function_p (const_rtx x)
 {
-  return (GET_CODE (x) == SYMBOL_REF
+  return (SYMBOL_REF_P (x)
 	  && SYMBOL_REF_LOCAL_P (x)
 	  && !SYMBOL_REF_EXTERNAL_P (x)
 	  && (mips_get_compress_mode (SYMBOL_REF_DECL (x)) & MASK_MIPS16));
@@ -2028,7 +2028,7 @@ mips_dangerous_for_la25_p (rtx x)
 {
   return (!TARGET_EXPLICIT_RELOCS
 	  && TARGET_USE_GOT
-	  && GET_CODE (x) == SYMBOL_REF
+	  && SYMBOL_REF_P (x)
 	  && mips_global_symbol_p (x));
 }
 
@@ -2044,7 +2044,7 @@ mips_use_pic_fn_addr_reg_p (const_rtx x)
   if (mips16_stub_function_p (x))
     return false;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     {
       /* If PLTs and copy relocations are available, the static linker
 	 will make sure that $25 is valid on entry to the target function.  */
@@ -2088,7 +2088,7 @@ mips_classify_symbol (const_rtx x, enum mips_symbol_context context)
       return SYMBOL_ABSOLUTE;
     }
 
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
 
   if (SYMBOL_REF_TLS_MODEL (x))
     return SYMBOL_TLS;
@@ -2185,7 +2185,7 @@ mips_symbolic_constant_p (rtx x, enum mips_symbol_context context,
       *symbol_type = UNSPEC_ADDRESS_TYPE (x);
       x = UNSPEC_ADDRESS (x);
     }
-  else if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+  else if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
     {
       *symbol_type = mips_classify_symbol (x, context);
       if (*symbol_type == SYMBOL_TLS)
@@ -7117,7 +7117,7 @@ static bool
 mips_ok_for_lazy_binding_p (rtx x)
 {
   return (TARGET_USE_GOT
-	  && GET_CODE (x) == SYMBOL_REF
+	  && SYMBOL_REF_P (x)
 	  && !SYMBOL_REF_BIND_NOW_P (x)
 	  && !mips_symbol_binds_local_p (x));
 }
@@ -7509,7 +7509,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
   /* If we're calling via a function pointer, use one of the magic
      libgcc.a stubs provided for each (FP_CODE, FP_RET_P) combination.
      Each stub expects the function address to arrive in register $2.  */
-  if (GET_CODE (fn) != SYMBOL_REF
+  if (!SYMBOL_REF_P (fn)
       || !call_insn_operand (fn, VOIDmode))
     {
       char buf[32];
@@ -17426,7 +17426,7 @@ mips16_rewrite_pool_constant (struct mips16_constant_pool *pool, rtx *x)
   rtx_code_label *label;
 
   split_const (*x, &base, &offset);
-  if (GET_CODE (base) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (base))
+  if (SYMBOL_REF_P (base) && CONSTANT_POOL_ADDRESS_P (base))
     {
       label = mips16_add_constant (pool, copy_rtx (get_pool_constant (base)),
 				   get_pool_mode (base));
@@ -17772,7 +17772,7 @@ r10k_needs_protection_p_call (const_rtx x)
       if (MEM_P (mem))
 	{
 	  const_rtx addr = XEXP (mem, 0);
-	  if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DECL (addr))
+	  if (SYMBOL_REF_P (addr) && SYMBOL_REF_DECL (addr))
 	    iter.skip_subrtxes ();
 	  else
 	    return true;
@@ -17974,21 +17974,21 @@ mips_pic_call_symbol_from_set (df_ref def, rtx reg, bool recurse_p)
       /* First see whether the source is a plain symbol.  This is used
 	 when calling symbols that are not lazily bound.  */
       src = SET_SRC (set);
-      if (GET_CODE (src) == SYMBOL_REF)
+      if (SYMBOL_REF_P (src))
 	return src;
 
       /* Handle %call16 references.  */
       symbol = mips_strip_unspec_call (src);
       if (symbol)
 	{
-	  gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (symbol));
 	  return symbol;
 	}
 
       /* If we have something more complicated, look for a
 	 REG_EQUAL or REG_EQUIV note.  */
       note = find_reg_equal_equiv_note (def_insn);
-      if (note && GET_CODE (XEXP (note, 0)) == SYMBOL_REF)
+      if (note && SYMBOL_REF_P (XEXP (note, 0)))
 	return XEXP (note, 0);
 
       /* Follow at most one simple register copy.  Such copies are
@@ -18086,7 +18086,7 @@ mips_get_pic_call_symbol (rtx *operands, int args_size_opno)
   gcc_assert (XINT (args_size, 1) == UNSPEC_CALL_ATTR);
 
   symbol = XVECEXP (args_size, 0, 1);
-  gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (symbol));
 
   operands[args_size_opno] = symbol;
   return true;
diff --git a/gcc/config/mips/predicates.md b/gcc/config/mips/predicates.md
index 0b0b004b4f1..80691253a62 100644
--- a/gcc/config/mips/predicates.md
+++ b/gcc/config/mips/predicates.md
@@ -343,7 +343,7 @@
       /* If -mlong-calls or if this function has an explicit long_call
 	 attribute, we must use register addressing.  The
 	 SYMBOL_FLAG_LONG_CALL bit is set by mips_encode_section_info.  */
-      return !(GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_LONG_CALL_P (op));
+      return !(SYMBOL_REF_P (op) && SYMBOL_REF_LONG_CALL_P (op));
 
     case SYMBOL_GOT_DISP:
       /* Without explicit relocs, there is no special syntax for
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 6f68981f777..d9e9a68ab4b 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1061,7 +1061,7 @@ mmix_constant_address_p (rtx x)
 	  rtx x0 = XEXP (XEXP (x, 0), 0);
 	  rtx x1 = XEXP (XEXP (x, 0), 1);
 
-	  if ((GET_CODE (x0) == SYMBOL_REF
+	  if ((SYMBOL_REF_P (x0)
 	       || LABEL_REF_P (x0))
 	      && (CONST_INT_P (x1)
 		  || (CONST_DOUBLE_P (x1)
@@ -1625,7 +1625,7 @@ mmix_print_operand (FILE *stream, rtx x, int code)
 	  return;
 	}
 
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  output_addr_const (stream, x);
 	  return;
diff --git a/gcc/config/mmix/predicates.md b/gcc/config/mmix/predicates.md
index 41e4f342826..9bdc847c96f 100644
--- a/gcc/config/mmix/predicates.md
+++ b/gcc/config/mmix/predicates.md
@@ -110,7 +110,7 @@
     case CONST:
       /* The reason why this body still is C.  */
       op = XEXP (op, 0);
-      if ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      if ((SYMBOL_REF_P (XEXP (op, 0))
 	   || LABEL_REF_P (XEXP (op, 0)))
 	  && (CONST_INT_P (XEXP (op, 1))
 	      || (CONST_DOUBLE_P (XEXP (op, 1))
diff --git a/gcc/config/mn10300/constraints.md b/gcc/config/mn10300/constraints.md
index b4c7cbed0e5..1e8abd7b296 100644
--- a/gcc/config/mn10300/constraints.md
+++ b/gcc/config/mn10300/constraints.md
@@ -59,7 +59,7 @@
 	     (ior (match_test "XINT (op, 1) == UNSPEC_PLT")
 		  (match_test "XINT (op, 1) == UNSPEC_PIC")
 		  (match_test "XINT (op, 1) == UNSPEC_GOTSYM_OFF")))
-	(match_test "GET_CODE (op) == SYMBOL_REF")))
+	(match_test "SYMBOL_REF_P (op)")))
 
 ;; Integer constraints
 
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 10cce63ca3f..da4d8c3e13d 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -1798,7 +1798,7 @@ mn10300_symbolic_operand (rtx op,
       return 1;
     case CONST:
       op = XEXP (op, 0);
-      return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      return ((SYMBOL_REF_P (XEXP (op, 0))
                || LABEL_REF_P (XEXP (op, 0)))
               && CONST_INT_P (XEXP (op, 1)));
     default:
@@ -1867,7 +1867,7 @@ mn10300_legitimize_pic_address (rtx orig, rtx reg)
   rtx_insn *insn;
 
   if (LABEL_REF_P (orig)
-      || (GET_CODE (orig) == SYMBOL_REF
+      || (SYMBOL_REF_P (orig)
 	  && (CONSTANT_POOL_ADDRESS_P (orig)
 	      || ! MN10300_GLOBAL_P (orig))))
     {
@@ -1880,7 +1880,7 @@ mn10300_legitimize_pic_address (rtx orig, rtx reg)
 
       insn = emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx));
     }
-  else if (GET_CODE (orig) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (orig))
     {
       if (reg == NULL)
 	reg = gen_reg_rtx (Pmode);
@@ -1908,7 +1908,7 @@ mn10300_legitimate_pic_operand_p (rtx x)
   const char *fmt;
   int i;
 
-  if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+  if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
     return 0;
 
   if (GET_CODE (x) == UNSPEC
@@ -2149,7 +2149,7 @@ mn10300_delegitimize_address (rtx orig_x)
   else
     return orig_x;
 
-  gcc_assert (GET_CODE (ret) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (ret));
   if (need_mem != MEM_P (orig_x))
     return orig_x;
   if (need_mem && addend)
@@ -2515,7 +2515,7 @@ mn10300_encode_section_info (tree decl, rtx rtl, int first)
     return;
 
   symbol = XEXP (rtl, 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return;
 
   if (flag_pic)
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 4239598aece..189d0426045 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -538,7 +538,7 @@ do {									     \
 #define GOT_SYMBOL_NAME "*_GLOBAL_OFFSET_TABLE_"
 
 #define SYMBOLIC_CONST_P(X)	\
-((GET_CODE (X) == SYMBOL_REF || LABEL_REF_P (X))	\
+((SYMBOL_REF_P (X) || LABEL_REF_P (X))	\
   && ! LEGITIMATE_PIC_OPERAND_P (X))
 
 /* Non-global SYMBOL_REFs have SYMBOL_REF_FLAG enabled.  */
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index c7c7bbf6174..45fb5cae646 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -1574,7 +1574,7 @@
 {
   rtx fn = XEXP (operands[0], 0);
 
-  if (flag_pic && GET_CODE (fn) == SYMBOL_REF)
+  if (flag_pic && SYMBOL_REF_P (fn))
     {
       if (MN10300_GLOBAL_P (fn))
 	{
@@ -1621,7 +1621,7 @@
 {
   rtx fn = XEXP (operands[1], 0);
 
-  if (flag_pic && GET_CODE (fn) == SYMBOL_REF)
+  if (flag_pic && SYMBOL_REF_P (fn))
     {
       if (MN10300_GLOBAL_P (fn))
 	{
diff --git a/gcc/config/mn10300/predicates.md b/gcc/config/mn10300/predicates.md
index 210d7140111..6ec23f032fc 100644
--- a/gcc/config/mn10300/predicates.md
+++ b/gcc/config/mn10300/predicates.md
@@ -33,7 +33,7 @@
   if (flag_pic)
     return (satisfies_constraint_S (op) || REG_P (op));
 
-  return (GET_CODE (op) == SYMBOL_REF || REG_P (op));
+  return (SYMBOL_REF_P (op) || REG_P (op));
 })
 
 (define_predicate "impossible_plus_operand"
diff --git a/gcc/config/moxie/constraints.md b/gcc/config/moxie/constraints.md
index 554b5cb5105..241815cf60b 100644
--- a/gcc/config/moxie/constraints.md
+++ b/gcc/config/moxie/constraints.md
@@ -25,7 +25,7 @@
 (define_constraint "A"
   "An absolute address."
   (and (match_code "mem")
-       (ior (match_test "GET_CODE (XEXP (op, 0)) == SYMBOL_REF")
+       (ior (match_test "SYMBOL_REF_P (XEXP (op, 0))")
 	    (match_test "LABEL_REF_P (XEXP (op, 0))")
 	    (match_test "GET_CODE (XEXP (op, 0)) == CONST"))))
 
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index ed532244357..78fe9551d93 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -133,7 +133,7 @@ moxie_print_operand_address (FILE *file, machine_mode, rtx x)
 	case CONST:
 	  {
 	    rtx plus = XEXP (XEXP (x, 1), 0);
-	    if (GET_CODE (XEXP (plus, 0)) == SYMBOL_REF 
+	    if (SYMBOL_REF_P (XEXP (plus, 0)) 
 		&& CONST_INT_P (XEXP (plus, 1)))
 	      {
 		output_addr_const(file, XEXP (plus, 0));
@@ -603,7 +603,7 @@ moxie_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED,
     return true;
   if (REG_P (x) && moxie_reg_ok_for_base_p (x, strict_p))
     return true;
-  if (GET_CODE (x) == SYMBOL_REF
+  if (SYMBOL_REF_P (x)
       || LABEL_REF_P (x)
       || GET_CODE (x) == CONST)
     return true;
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index 0d3421a0121..7d93f15c1bc 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -3196,7 +3196,7 @@ msp430_subreg (machine_mode mode, rtx r, machine_mode omode, int byte)
     }
   else if (MEM_P (r))
     rv = adjust_address (r, mode, byte);
-  else if (GET_CODE (r) == SYMBOL_REF
+  else if (SYMBOL_REF_P (r)
 	   && (byte == 0 || byte == 2)
 	   && mode == HImode)
     {
@@ -3222,7 +3222,7 @@ msp430_split_movsi (rtx *operands)
   op02 = msp430_subreg (HImode, operands[0], SImode, 2);
 
   if (GET_CODE (operands[1]) == CONST
-      || GET_CODE (operands[1]) == SYMBOL_REF)
+      || SYMBOL_REF_P (operands[1]))
     {
       op10 = gen_rtx_ZERO_EXTRACT (HImode, operands[1], GEN_INT (16), GEN_INT (0));
       op10 = gen_rtx_CONST (HImode, op10);
diff --git a/gcc/config/nds32/nds32-md-auxiliary.c b/gcc/config/nds32/nds32-md-auxiliary.c
index 90f9c89643c..bc6be927790 100644
--- a/gcc/config/nds32/nds32-md-auxiliary.c
+++ b/gcc/config/nds32/nds32-md-auxiliary.c
@@ -3456,7 +3456,7 @@ symbolic_reference_mentioned_p (rtx op)
   const char *fmt;
   int i;
 
-  if (GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op))
+  if (SYMBOL_REF_P (op) || LABEL_REF_P (op))
     return true;
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -3503,7 +3503,7 @@ nds32_legitimize_pic_address (rtx x)
   int relax_group_id = nds32_alloc_relax_group_id ();
 
   if (LABEL_REF_P (x)
-      || (GET_CODE (x) == SYMBOL_REF
+      || (SYMBOL_REF_P (x)
 	  && (CONSTANT_POOL_ADDRESS_P (x)
 	      || SYMBOL_REF_LOCAL_P (x))))
     {
@@ -3512,7 +3512,7 @@ nds32_legitimize_pic_address (rtx x)
       emit_insn (gen_sym_got (reg, addr, GEN_INT (relax_group_id)));
       x = gen_rtx_PLUS (Pmode, reg, pic_offset_table_rtx);
     }
-  else if (GET_CODE (x) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (x))
     {
       addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, x), UNSPEC_GOT);
       addr = gen_rtx_CONST (SImode, addr);
@@ -3532,7 +3532,7 @@ nds32_legitimize_pic_address (rtx x)
       rtx op1 = XEXP (addr, 1);
 
       if ((LABEL_REF_P (op0)
-	   || (GET_CODE (op0) == SYMBOL_REF
+	   || (SYMBOL_REF_P (op0)
 	       && (CONSTANT_POOL_ADDRESS_P (op0)
 		   || SYMBOL_REF_LOCAL_P (op0))))
 	  && CONST_INT_P (op1))
@@ -3543,7 +3543,7 @@ nds32_legitimize_pic_address (rtx x)
 	  emit_insn (gen_sym_got (reg, pat, GEN_INT (relax_group_id)));
 	  x = gen_rtx_PLUS (Pmode, reg, pic_offset_table_rtx);
 	}
-      else if (GET_CODE (op0) == SYMBOL_REF
+      else if (SYMBOL_REF_P (op0)
 	       && CONST_INT_P (op1))
 	{
 	  /* This is a constant offset from a @GOT symbol reference.  */
@@ -3597,7 +3597,7 @@ nds32_legitimize_ict_address (rtx x)
   rtx symbol = x;
   rtx addr = x;
   rtx reg = gen_reg_rtx (Pmode);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF
+  gcc_assert (SYMBOL_REF_P (x)
 	      && nds32_indirect_call_referenced_p (x));
 
   addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, symbol), UNSPEC_ICT);
@@ -3626,7 +3626,7 @@ nds32_indirect_call_referenced_p (rtx x)
   if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_ICT)
     x = XVECEXP (x, 0, 0);
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     {
       tree decl = SYMBOL_REF_DECL (x);
 
@@ -3659,7 +3659,7 @@ nds32_tls_referenced_p (rtx x)
   if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
     x = XEXP (XEXP (x, 0), 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x))
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x))
     return true;
 
   return false;
@@ -3675,7 +3675,7 @@ nds32_legitimize_tls_address (rtx x)
   rtx pat, insns, reg0;
   int relax_group_id = nds32_alloc_relax_group_id ();
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     switch (SYMBOL_REF_TLS_MODEL (x))
       {
       case TLS_MODEL_GLOBAL_DYNAMIC:
diff --git a/gcc/config/nds32/nds32-predicates.c b/gcc/config/nds32/nds32-predicates.c
index 7cfa77eb5cd..c3b8237803c 100644
--- a/gcc/config/nds32/nds32-predicates.c
+++ b/gcc/config/nds32/nds32-predicates.c
@@ -444,7 +444,7 @@ nds32_symbol_load_store_p (rtx_insn *insn)
 	  || (GET_CODE (mem_src) == SIGN_EXTEND))
 	mem_src = XEXP (mem_src, 0);
 
-      if ((GET_CODE (XEXP (mem_src, 0)) == SYMBOL_REF)
+      if ((SYMBOL_REF_P (XEXP (mem_src, 0)))
 	   || (GET_CODE (XEXP (mem_src, 0)) == LO_SUM))
 	return true;
     }
@@ -460,14 +460,14 @@ nds32_float_mem_operand_p (rtx op)
   rtx addr = XEXP (op, 0);
 
   /* Not support [symbol] [const] memory */
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       || GET_CODE (addr) == CONST
       || GET_CODE (addr) == LO_SUM)
     return false;
 
   if (GET_CODE (addr) == PLUS)
     {
-      if (GET_CODE (XEXP (addr, 0)) == SYMBOL_REF)
+      if (SYMBOL_REF_P (XEXP (addr, 0)))
 	return false;
 
       /* Restrict const range: (imm12s << 2) */
@@ -548,7 +548,7 @@ nds32_const_unspec_p (rtx x)
 	}
     }
 
-  if (GET_CODE (x) == SYMBOL_REF
+  if (SYMBOL_REF_P (x)
       && SYMBOL_REF_TLS_MODEL (x))
     return false;
 
diff --git a/gcc/config/nds32/nds32-utils.c b/gcc/config/nds32/nds32-utils.c
index 327636bbd55..bd89824c847 100644
--- a/gcc/config/nds32/nds32-utils.c
+++ b/gcc/config/nds32/nds32-utils.c
@@ -339,7 +339,7 @@ extract_base_reg (rtx_insn *insn)
 
   plus_rtx = XEXP (mem_rtx, 0);
 
-  if (GET_CODE (plus_rtx) == SYMBOL_REF
+  if (SYMBOL_REF_P (plus_rtx)
       || GET_CODE (plus_rtx) == CONST)
     return NULL_RTX;
 
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 44d2ad83e9f..574c571dc7d 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -2567,7 +2567,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
      /* When using floating-point instructions,
 	we don't allow 'addr' to be [symbol_ref], [CONST] pattern.  */
       if ((mode == DFmode || mode == SFmode)
-	  && (GET_CODE (x) == SYMBOL_REF
+	  && (SYMBOL_REF_P (x)
 	  || GET_CODE(x) == CONST))
 	return false;
 
@@ -2630,7 +2630,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 
       /* Now check [reg], [symbol_ref], and [const].  */
       if (!REG_P (x)
-	  && GET_CODE (x) != SYMBOL_REF
+	  && !SYMBOL_REF_P (x)
 	  && GET_CODE (x) != CONST)
 	return false;
     }
@@ -2681,7 +2681,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 	  rtx op0 = XEXP (plus_op, 0);
 	  rtx op1 = XEXP (plus_op, 1);
 
-	  if (GET_CODE (op0) == SYMBOL_REF && CONST_INT_P (op1))
+	  if (SYMBOL_REF_P (op0) && CONST_INT_P (op1))
 	    {
 	      /* Now we see the [ + const_addr ] pattern, but we need
 		 some further checking.  */
@@ -2781,7 +2781,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 	if (!REG_P (XEXP (x, 0)))
 	  return false;
 
-	if (GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
+	if (SYMBOL_REF_P (XEXP (x, 1)))
 	  sym = XEXP (x, 1);
 	else if (GET_CODE (XEXP (x, 1)) == CONST)
 	  {
@@ -2794,7 +2794,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 	else
 	  return false;
 
-	gcc_assert (GET_CODE (sym) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (sym));
 
 	if (TARGET_ICT_MODEL_LARGE
 	    && nds32_indirect_call_referenced_p (sym))
@@ -3091,7 +3091,7 @@ nds32_encode_section_info (tree decl, rtx rtl, int new_decl_p)
     {
       rtx addr = XEXP (rtl, 0);
 
-      if (GET_CODE (addr) == SYMBOL_REF)
+      if (SYMBOL_REF_P (addr))
 	{
 	  /* For (mem (symbol_ref X)) case.  */
 	  SYMBOL_REF_FLAGS (addr) |= NDS32_SYMBOL_FLAG_RODATA;
@@ -3104,7 +3104,7 @@ nds32_encode_section_info (tree decl, rtx rtl, int new_decl_p)
 	  rtx op0 = XEXP (plus_op, 0);
 	  rtx op1 = XEXP (plus_op, 1);
 
-	  if (GET_CODE (op0) == SYMBOL_REF && CONST_INT_P (op1))
+	  if (SYMBOL_REF_P (op0) && CONST_INT_P (op1))
 	    SYMBOL_REF_FLAGS (op0) |= NDS32_SYMBOL_FLAG_RODATA;
 	}
     }
diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h
index 1a8a6675bba..0a9a69f8536 100644
--- a/gcc/config/nds32/nds32.h
+++ b/gcc/config/nds32/nds32.h
@@ -1491,7 +1491,7 @@ enum reg_class
 #define PIC_OFFSET_TABLE_REGNUM GP_REGNUM
 
 #define SYMBOLIC_CONST_P(X)	\
-(GET_CODE (X) == SYMBOL_REF						\
+(SYMBOL_REF_P (X)						\
  || LABEL_REF_P (X)						\
  || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index d2a85d0ad6f..e19b3823b44 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -562,7 +562,7 @@ nios2_emit_stack_limit_check (int size)
 {
   rtx sum = NULL_RTX;
 
-  if (GET_CODE (stack_limit_rtx) == SYMBOL_REF)
+  if (SYMBOL_REF_P (stack_limit_rtx))
     {
       /* This generates a %hiadj/%lo pair with the constant size
 	 add handled by the relocations.  */
@@ -1362,7 +1362,7 @@ nios2_option_override (void)
   if (flag_pic && !TARGET_LINUX_ABI)
     sorry ("position-independent code requires the Linux ABI");
   if (flag_pic && stack_limit_rtx
-      && GET_CODE (stack_limit_rtx) == SYMBOL_REF)
+      && SYMBOL_REF_P (stack_limit_rtx))
     sorry ("PIC support for %<-fstack-limit-symbol%>");
 
   /* Function to allocate machine-dependent function status.  */
@@ -2078,7 +2078,7 @@ nios2_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
 {
   rtx base, offset;
   split_const (x, &base, &offset);
-  return GET_CODE (base) != SYMBOL_REF || !SYMBOL_REF_TLS_MODEL (base);
+  return !SYMBOL_REF_P (base) || !SYMBOL_REF_TLS_MODEL (base);
 }
 
 /* Implement TARGET_CANNOT_FORCE_CONST_MEM.  */
@@ -2395,7 +2395,7 @@ nios2_symbol_ref_in_small_data_p (rtx sym)
 {
   tree decl;
 
-  gcc_assert (GET_CODE (sym) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (sym));
   decl = SYMBOL_REF_DECL (sym);
 
   /* TLS variables are not accessed through the GP.  */
@@ -2469,7 +2469,7 @@ nios2_symbol_ref_in_r0rel_data_p (rtx sym)
 {
   tree decl;
 
-  gcc_assert (GET_CODE (sym) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (sym));
   decl = SYMBOL_REF_DECL (sym);
 
   /* TLS variables are not accessed through r0.  */
@@ -2532,7 +2532,7 @@ static rtx
 nios2_load_pic_address (rtx sym, int unspec, rtx tmp)
 {
   if (flag_pic == 2
-      && GET_CODE (sym) == SYMBOL_REF
+      && SYMBOL_REF_P (sym)
       && nios2_symbol_binds_local_p (sym))
     /* Under -fPIC, generate a GOTOFF address for local symbols.  */
     {
@@ -2553,7 +2553,7 @@ nios2_legitimate_pic_operand_p (rtx x)
   if (nios2_large_unspec_reloc_p (x))
     return true;
 
-  return ! (GET_CODE (x) == SYMBOL_REF
+  return ! (SYMBOL_REF_P (x)
 	    || LABEL_REF_P (x) || GET_CODE (x) == CONST);
 }
 
@@ -2561,7 +2561,7 @@ nios2_legitimate_pic_operand_p (rtx x)
 static bool
 nios2_tls_symbol_p (rtx x)
 {
-  return (targetm.have_tls && GET_CODE (x) == SYMBOL_REF
+  return (targetm.have_tls && SYMBOL_REF_P (x)
 	  && SYMBOL_REF_TLS_MODEL (x) != 0);
 }
 
@@ -3075,7 +3075,7 @@ nios2_print_operand (FILE *file, rtx op, int letter)
 bool
 gprel_constant_p (rtx op)
 {
-  if (GET_CODE (op) == SYMBOL_REF
+  if (SYMBOL_REF_P (op)
       && nios2_symbol_ref_in_small_data_p (op))
     return true;
   else if (GET_CODE (op) == CONST
@@ -3089,7 +3089,7 @@ gprel_constant_p (rtx op)
 bool
 r0rel_constant_p (rtx op)
 {
-  if (GET_CODE (op) == SYMBOL_REF
+  if (SYMBOL_REF_P (op)
       && nios2_symbol_ref_in_r0rel_data_p (op))
     return true;
   else if (GET_CODE (op) == CONST
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 07180eaad07..9fd8dc3270a 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -1636,7 +1636,7 @@ nvptx_expand_call (rtx retval, rtx address)
       address = change_address (address, QImode, callee);
     }
 
-  if (GET_CODE (callee) == SYMBOL_REF)
+  if (SYMBOL_REF_P (callee))
     {
       tree decl = SYMBOL_REF_DECL (callee);
       if (decl != NULL_TREE)
@@ -2059,7 +2059,7 @@ nvptx_assemble_integer (rtx x, unsigned int size, int ARG_UNUSED (aligned_p))
       gcc_assert (GET_CODE (x) == PLUS);
       val = INTVAL (XEXP (x, 1));
       x = XEXP (x, 0);
-      gcc_assert (GET_CODE (x) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (x));
       /* FALLTHROUGH */
 
     case SYMBOL_REF:
@@ -2375,7 +2375,7 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee)
 	     reg_names[NVPTX_RETURN_REGNUM]);
 
   /* Ensure we have a ptx declaration in the output if necessary.  */
-  if (GET_CODE (callee) == SYMBOL_REF)
+  if (SYMBOL_REF_P (callee))
     {
       decl = SYMBOL_REF_DECL (callee);
       if (!decl
@@ -2565,7 +2565,7 @@ nvptx_print_operand (FILE *file, rtx x, int code)
       if (GET_CODE (x) == PLUS)
 	x = XEXP (x, 0);
 
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	fputs (section_for_sym (x), file);
       break;
 
@@ -2909,7 +2909,7 @@ nvptx_call_insn_is_syscall_p (rtx_insn *insn)
   gcc_checking_assert (GET_CODE (pat) == CALL
 		       && MEM_P (XEXP (pat, 0)));
   rtx addr = XEXP (XEXP (pat, 0), 0);
-  if (GET_CODE (addr) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (addr))
     return false;
   const char *name = XSTR (addr, 0);
   /* Ordinary malloc/free are redirected to __nvptx_{malloc,free), so only the
diff --git a/gcc/config/or1k/or1k.c b/gcc/config/or1k/or1k.c
index f8eed4a7797..26062c87b87 100644
--- a/gcc/config/or1k/or1k.c
+++ b/gcc/config/or1k/or1k.c
@@ -1502,7 +1502,7 @@ or1k_expand_call (rtx retval, rtx fnaddr, rtx callarg1, bool sibcall)
 
   /* Calls via the PLT require the PIC register.  */
   if (flag_pic
-      && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (fnaddr, 0))
       && !SYMBOL_REF_LOCAL_P (XEXP (fnaddr, 0)))
     {
       crtl->uses_pic_offset_table = 1;
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 418dfc8c8f4..56fce41cdb6 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -830,7 +830,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
       crtl->uses_pic_offset_table = 1;
       return reg;
     }
-  if (GET_CODE (orig) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig))
     {
       rtx_insn *insn;
       rtx tmp_reg;
@@ -941,7 +941,7 @@ legitimize_tls_address (rtx addr)
   rtx_insn *insn;
 
   /* Currently, we can't handle anything but a SYMBOL_REF.  */
-  if (GET_CODE (addr) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (addr))
     return addr;
 
   switch (SYMBOL_REF_TLS_MODEL (addr)) 
@@ -1102,7 +1102,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
      That should always be safe.  */
   if (GET_CODE (x) == PLUS
       && REG_P (XEXP (x, 0))
-      && GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (x, 1)))
     {
       rtx reg = force_reg (Pmode, XEXP (x, 1));
       return force_reg (Pmode, gen_rtx_PLUS (Pmode, reg, XEXP (x, 0)));
@@ -1112,7 +1112,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
      since the assembler/linker can't handle arithmetic on plabels.  */
   if (GET_CODE (x) == PLUS
       && CONST_INT_P (XEXP (x, 1))
-      && ((GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      && ((SYMBOL_REF_P (XEXP (x, 0))
 	   && !FUNCTION_NAME_P (XSTR (XEXP (x, 0), 0)))
 	  || REG_P (XEXP (x, 0))))
     {
@@ -1138,7 +1138,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
 	 handle 4->2 or 5->2 combinations, so do not create
 	 them.  */
       if (! VAL_14_BITS_P (newoffset)
-	  && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+	  && SYMBOL_REF_P (XEXP (x, 0)))
 	{
 	  rtx const_part = plus_constant (Pmode, XEXP (x, 0), newoffset);
 	  rtx tmp_reg
@@ -1355,7 +1355,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
 
 	     If const_int is big, but can be divided evenly by shadd_const
 	     and added to (reg).  This allows more scaled indexed addresses.  */
-	  if (GET_CODE (XEXP (y, 0)) == SYMBOL_REF
+	  if (SYMBOL_REF_P (XEXP (y, 0))
 	      && mem_shadd_or_shadd_rtx_p (XEXP (x, 0))
 	      && CONST_INT_P (XEXP (y, 1))
 	      && INTVAL (XEXP (y, 1)) >= -4096
@@ -1387,7 +1387,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
 					 reg1));
 	    }
 	  else if ((mode == DFmode || mode == SFmode)
-		   && GET_CODE (XEXP (y, 0)) == SYMBOL_REF
+		   && SYMBOL_REF_P (XEXP (y, 0))
 		   && mem_shadd_or_shadd_rtx_p (XEXP (x, 0))
 		   && CONST_INT_P (XEXP (y, 1))
 		   && INTVAL (XEXP (y, 1)) % (1 << INTVAL (XEXP (XEXP (x, 0), 1))) == 0)
@@ -2166,7 +2166,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
 	      tmp = XEXP (XEXP (tmp, 0), 0);
 	    }
 
-	  gcc_assert (GET_CODE (tmp) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (tmp));
 	  tmp = legitimize_tls_address (tmp);
 	  if (addend)
 	    {
@@ -3327,7 +3327,7 @@ pa_assemble_integer (rtx x, unsigned int size, int aligned_p)
      calling output_addr_const.  Otherwise, it may call assemble_external
      in the midst of outputing the assembler code for the SYMBOL_REF.
      We restore the SYMBOL_REF_DECL after the output is done.  */
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     {
       decl = SYMBOL_REF_DECL (x);
       if (decl)
@@ -5496,9 +5496,9 @@ pa_output_global_address (FILE *file, rtx x, int round_constant)
   if (GET_CODE (x) == HIGH)
     x = XEXP (x, 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && read_only_operand (x, VOIDmode))
+  if (SYMBOL_REF_P (x) && read_only_operand (x, VOIDmode))
     output_addr_const (file, x);
-  else if (GET_CODE (x) == SYMBOL_REF && !flag_pic)
+  else if (SYMBOL_REF_P (x) && !flag_pic)
     {
       output_addr_const (file, x);
       fputs ("-$global$", file);
@@ -5562,7 +5562,7 @@ pa_output_global_address (FILE *file, rtx x, int round_constant)
 	  break;
 
 	case MINUS:
-	  gcc_assert (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0)));
 	  sep = "-";
 	  break;
 
@@ -8320,7 +8320,7 @@ pa_encode_section_info (tree decl, rtx rtl, int first)
 {
   int old_referenced = 0;
 
-  if (!first && MEM_P (rtl) && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)
+  if (!first && MEM_P (rtl) && SYMBOL_REF_P (XEXP (rtl, 0)))
     old_referenced
       = SYMBOL_REF_FLAGS (XEXP (rtl, 0)) & SYMBOL_FLAG_REFERENCED;
 
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index b6b7ed17a5c..ae0b65c1e39 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -758,7 +758,7 @@ extern int may_call_alloca;
 
 /* TLS symbolic reference.  */
 #define PA_SYMBOL_REF_TLS_P(X) \
-  (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (X) != 0)
+  (SYMBOL_REF_P (X) && SYMBOL_REF_TLS_MODEL (X) != 0)
 
 /* Recognize any constant value that is a valid address except
    for symbolic addresses.  We get better CSE by rejecting them
@@ -767,7 +767,7 @@ extern int may_call_alloca;
 
 #define CONSTANT_ADDRESS_P(X) \
   ((LABEL_REF_P (X) 						\
-   || (GET_CODE (X) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (X))		\
+   || (SYMBOL_REF_P (X) && !SYMBOL_REF_TLS_MODEL (X))		\
    || CONST_INT_P (X)						\
    || (GET_CODE (X) == CONST && !tls_referenced_p (X))			\
    || GET_CODE (X) == HIGH) 						\
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 5f7c45053cf..8d0139120c4 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -7069,7 +7069,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
       op = XEXP (operands[0], 0);
 
       /* Generate indirect long calls to non-local functions. */
-      if (TARGET_LONG_CALLS && GET_CODE (op) == SYMBOL_REF)
+      if (TARGET_LONG_CALLS && SYMBOL_REF_P (op))
 	{
 	  tree call_decl = SYMBOL_REF_DECL (op);
 	  if (!(call_decl && targetm.binds_local_p (call_decl)))
@@ -7133,7 +7133,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   if (TARGET_64BIT)
     {
       rtx r4 = gen_rtx_REG (word_mode, 4);
-      if (GET_CODE (op) == SYMBOL_REF)
+      if (SYMBOL_REF_P (op))
 	emit_call_insn (gen_call_symref_64bit (op, nb, r4));
       else
 	{
@@ -7143,7 +7143,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
     }
   else
     {
-      if (GET_CODE (op) == SYMBOL_REF)
+      if (SYMBOL_REF_P (op))
 	{
 	  if (flag_pic)
 	    {
@@ -7563,7 +7563,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   else
     {
       op = XEXP (operands[1], 0);
-      if (GET_CODE (op) == SYMBOL_REF)
+      if (SYMBOL_REF_P (op))
 	{
 	  /* Handle special call to buggy powf function.  */
 	  if (TARGET_HPUX && !TARGET_DISABLE_FPREGS && !TARGET_SOFT_FLOAT
@@ -7636,7 +7636,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
   if (TARGET_64BIT)
     {
       rtx r4 = gen_rtx_REG (word_mode, 4);
-      if (GET_CODE (op) == SYMBOL_REF)
+      if (SYMBOL_REF_P (op))
 	{
 	  if (call_powf)
 	    emit_call_insn (gen_call_val_powf_64bit (dst, op, nb, r4));
@@ -7651,7 +7651,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
     }
   else
     {
-      if (GET_CODE (op) == SYMBOL_REF)
+      if (SYMBOL_REF_P (op))
 	{
 	  if (flag_pic)
 	    {
diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index a633a276509..17e37b88f35 100644
--- a/gcc/config/pa/predicates.md
+++ b/gcc/config/pa/predicates.md
@@ -520,7 +520,7 @@
 {
   if (GET_CODE (op) == CONST)
     op = XEXP (XEXP (op, 0), 0);
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     {
       if (flag_pic)
         return SYMBOL_REF_FLAG (op) && !CONSTANT_POOL_ADDRESS_P (op);
@@ -628,7 +628,7 @@
     case CONST:
       op = XEXP (op, 0);
       return (GET_CODE (op) == PLUS
-	      && ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+	      && ((SYMBOL_REF_P (XEXP (op, 0))
 		   && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0)))
 		  || LABEL_REF_P (XEXP (op, 0)))
 	      && CONST_INT_P (XEXP (op, 1)));
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index c885bb5f0eb..0c9c4b1af01 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -547,7 +547,7 @@ riscv_classify_symbol (const_rtx x)
   if (riscv_tls_symbol_p (x))
     return SYMBOL_TLS;
 
-  if (GET_CODE (x) == SYMBOL_REF && flag_pic && !riscv_symbol_binds_local_p (x))
+  if (SYMBOL_REF_P (x) && flag_pic && !riscv_symbol_binds_local_p (x))
     return SYMBOL_GOT_DISP;
 
   return riscv_cmodel == CM_MEDLOW ? SYMBOL_ABSOLUTE : SYMBOL_PCREL;
@@ -581,7 +581,7 @@ riscv_symbolic_constant_p (rtx x, enum riscv_symbol_type *symbol_type)
       *symbol_type = UNSPEC_ADDRESS_TYPE (x);
       x = UNSPEC_ADDRESS (x);
     }
-  else if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+  else if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
     *symbol_type = riscv_classify_symbol (x);
   else
     return false;
diff --git a/gcc/config/rl78/constraints.md b/gcc/config/rl78/constraints.md
index e660628df47..21be6ac775f 100644
--- a/gcc/config/rl78/constraints.md
+++ b/gcc/config/rl78/constraints.md
@@ -226,7 +226,7 @@
   "[addr]"
   (and (match_code "mem")
        (ior (match_test "CONSTANT_P (XEXP (op, 0))")
-	    (match_test "GET_CODE (XEXP (op, 0)) == PLUS && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF"))
+	    (match_test "GET_CODE (XEXP (op, 0)) == PLUS && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))"))
 	    )
   )
 (define_memory_constraint "Wab"
@@ -413,5 +413,5 @@
 (define_constraint "Qs8"
   "Integer constant computed from (SUBREG (SYMREF))."
   (and (match_code "subreg")
-       (match_test "GET_CODE (XEXP (op, 0)) == SYMBOL_REF"))
+       (match_test "SYMBOL_REF_P (XEXP (op, 0))"))
 )
diff --git a/gcc/config/rl78/rl78-expand.md b/gcc/config/rl78/rl78-expand.md
index 3706a8c01f6..ea5a0b46b61 100644
--- a/gcc/config/rl78/rl78-expand.md
+++ b/gcc/config/rl78/rl78-expand.md
@@ -35,7 +35,7 @@
        provided that the destination is a register.  If not, then load the
        source into a register first.  */
     if (SUBREG_P (operands[1])
-        && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
+        && SYMBOL_REF_P (XEXP (operands[1], 0))
 	&& ! REG_P (operands[0]))
 	operands[1] = copy_to_mode_reg (QImode, operands[1]);
 
@@ -44,7 +44,7 @@
     if (SUBREG_P (operands[1])
 	&& GET_CODE (XEXP (operands[1], 0)) == CONST
         && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == PLUS
-        && GET_CODE (XEXP (XEXP (XEXP (operands[1], 0), 0), 0)) == SYMBOL_REF
+        && SYMBOL_REF_P (XEXP (XEXP (XEXP (operands[1], 0), 0), 0))
 	&& ! REG_P (operands[0]))
 	operands[1] = copy_to_mode_reg (QImode, operands[1]);
 
@@ -66,13 +66,13 @@
     /* FIXME: Not sure how GCC can generate (SUBREG (SYMBOL_REF)),
        but it does.  Since this makes no sense, reject it here.  */
     if (SUBREG_P (operands[1])
-        && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+        && SYMBOL_REF_P (XEXP (operands[1], 0)))
       FAIL;
     /* Similarly for (SUBREG (CONST (PLUS (SYMBOL_REF)))).  */
     if (SUBREG_P (operands[1])
 	&& GET_CODE (XEXP (operands[1], 0)) == CONST
         && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == PLUS
-        && GET_CODE (XEXP (XEXP (XEXP (operands[1], 0), 0), 0)) == SYMBOL_REF)
+        && SYMBOL_REF_P (XEXP (XEXP (XEXP (operands[1], 0), 0), 0)))
       FAIL;
   }
 )
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index a667ac8f543..4559c5a4780 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -538,7 +538,7 @@ rl78_expand_movsi (rtx *operands)
   op00 = rl78_subreg (HImode, operands[0], SImode, 0);
   op02 = rl78_subreg (HImode, operands[0], SImode, 2);
   if (GET_CODE (operands[1]) == CONST
-      || GET_CODE (operands[1]) == SYMBOL_REF)
+      || SYMBOL_REF_P (operands[1]))
     {
       op10 = gen_rtx_ZERO_EXTRACT (HImode, operands[1], GEN_INT (16), GEN_INT (0));
       op10 = gen_rtx_CONST (HImode, op10);
@@ -575,7 +575,7 @@ rl78_split_movsi (rtx *operands, machine_mode omode)
   op02 = rl78_subreg (HImode, operands[0], omode, 2);
 
   if (GET_CODE (operands[1]) == CONST
-      || GET_CODE (operands[1]) == SYMBOL_REF)
+      || SYMBOL_REF_P (operands[1]))
     {
       op10 = gen_rtx_ZERO_EXTRACT (HImode, operands[1], GEN_INT (16), GEN_INT (0));
       op10 = gen_rtx_CONST (HImode, op10);
@@ -939,7 +939,7 @@ characterize_address (rtx x, rtx *base, rtx *index, rtx *addend)
 
   /* We sometimes get these without the CONST wrapper */
   if (GET_CODE (x) == PLUS
-      && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (x, 0))
       && CONST_INT_P (XEXP (x, 1)))
     {
       *addend = x;
@@ -985,7 +985,7 @@ characterize_address (rtx x, rtx *base, rtx *index, rtx *addend)
   switch (GET_CODE (x))
     {
     case PLUS:
-      if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      if (SYMBOL_REF_P (XEXP (x, 0))
 	  && CONST_INT_P (XEXP (x, 0)))
 	{
 	  *addend = x;
@@ -1232,7 +1232,7 @@ rl78_addr_space_convert (rtx op, tree from_type, tree to_type)
 
       warning (OPT_Waddress, "converting far pointer to near pointer");
       result = gen_reg_rtx (HImode);
-      if (GET_CODE (op) == SYMBOL_REF
+      if (SYMBOL_REF_P (op)
 	  || (REG_P (op) && REGNO (op) >= FIRST_PSEUDO_REGISTER))
 	tmp = gen_rtx_raw_SUBREG (HImode, op, 0);
       else
@@ -1866,7 +1866,7 @@ rl78_print_operand_1 (FILE * file, rtx op, int letter)
 	      rl78_print_operand_1 (file, XEXP (op, 0), letter);
 	    }
 	  else if (GET_CODE (XEXP (op, 0)) == PLUS
-		   && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF)
+		   && SYMBOL_REF_P (XEXP (XEXP (op, 0), 0)))
 	    {
 	      if (!rl78_saddr_p (op))
 		fprintf (file, "!");
@@ -2010,7 +2010,7 @@ rl78_print_operand_1 (FILE * file, rtx op, int letter)
 
       if (GET_CODE (XEXP (op, 0)) == ZERO_EXTEND)
 	{
-	  if (GET_CODE (XEXP (op, 1)) == SYMBOL_REF
+	  if (SYMBOL_REF_P (XEXP (op, 1))
 	      && SYMBOL_REF_DECL (XEXP (op, 1))
 	      && TREE_CODE (SYMBOL_REF_DECL (XEXP (op, 1))) == FUNCTION_DECL)
 	    {
@@ -2029,7 +2029,7 @@ rl78_print_operand_1 (FILE * file, rtx op, int letter)
 	}
       else
 	{
-	  if (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+	  if (SYMBOL_REF_P (XEXP (op, 0))
 	      && SYMBOL_REF_DECL (XEXP (op, 0))
 	      && TREE_CODE (SYMBOL_REF_DECL (XEXP (op, 0))) == FUNCTION_DECL)
 	    {
@@ -2848,7 +2848,7 @@ rl78_lo16 (rtx addr)
 {
   rtx r;
 
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       || GET_CODE (addr) == CONST)
     {
       r = gen_rtx_ZERO_EXTRACT (HImode, addr, GEN_INT (16), GEN_INT (0));
@@ -2867,7 +2867,7 @@ rl78_lo16 (rtx addr)
 static rtx
 rl78_hi8 (rtx addr)
 {
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       || GET_CODE (addr) == CONST)
     {
       rtx r = gen_rtx_ZERO_EXTRACT (QImode, addr, GEN_INT (8), GEN_INT (16));
@@ -4469,7 +4469,7 @@ rl78_saddr_p (rtx x)
     x = XEXP (x, 0);
   if (GET_CODE (x) == PLUS)
     x = XEXP (x, 0);
-  if (GET_CODE (x) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (x))
     return 0;
 
   c = XSTR (x, 0);
@@ -4565,10 +4565,10 @@ rl78_encode_section_info (tree decl, rtx rtl, int first)
 
   rtlname = XEXP (rtl, 0);
 
-  if (GET_CODE (rtlname) == SYMBOL_REF)
+  if (SYMBOL_REF_P (rtlname))
     oldname = XSTR (rtlname, 0);
   else if (MEM_P (rtlname)
-	   && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF)
+	   && SYMBOL_REF_P (XEXP (rtlname, 0)))
     oldname = XSTR (XEXP (rtlname, 0), 0);
   else
     gcc_unreachable ();
@@ -4891,7 +4891,7 @@ rl78_addsi3_internal (rtx * operands, unsigned int alternative)
      that it is invalid to access anything above 64K relative to
      this address.  So we can skip adding in the high bytes.  */
   if (TARGET_ES0
-      && GET_CODE (operands[2]) == SYMBOL_REF
+      && SYMBOL_REF_P (operands[2])
       && TREE_CODE (SYMBOL_REF_DECL (operands[2])) == VAR_DECL
       && TREE_READONLY (SYMBOL_REF_DECL (operands[2]))
       && ! TREE_SIDE_EFFECTS (SYMBOL_REF_DECL (operands[2])))
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index facc468ec7c..0ce89c5878c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -24168,7 +24168,7 @@ rs6000_call_aix (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
   /* Handle longcall attributes.  */
   is_pltseq_longcall = false;
   if ((INTVAL (cookie) & CALL_LONG) != 0
-      && GET_CODE (func_desc) == SYMBOL_REF)
+      && SYMBOL_REF_P (func_desc))
     {
       func = rs6000_longcall_ref (func_desc, tlsarg);
       if (TARGET_PLTSEQ)
@@ -24268,7 +24268,7 @@ rs6000_call_aix (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
 	     originally direct, the 3rd word has not been written since no
 	     trampoline has been built, so we ought not to load it, lest we
 	     override a static chain value.  */
-	  if (!(GET_CODE (func_desc) == SYMBOL_REF
+	  if (!(SYMBOL_REF_P (func_desc)
 		&& SYMBOL_REF_FUNCTION_P (func_desc))
 	      && TARGET_POINTERS_TO_NESTED_FUNCTIONS
 	      && !chain_already_loaded (get_current_sequence ()->next->last))
@@ -24362,7 +24362,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
 
   /* Handle longcall attributes.  */
   if ((INTVAL (cookie) & CALL_LONG) != 0
-      && GET_CODE (func_desc) == SYMBOL_REF)
+      && SYMBOL_REF_P (func_desc))
     {
       func = rs6000_longcall_ref (func_desc, tlsarg);
       /* If the longcall was implemented as an inline PLT call using
@@ -24378,7 +24378,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
     }
 
   /* Handle indirect calls.  */
-  if (GET_CODE (func) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (func))
     {
       func = force_reg (Pmode, func);
 
@@ -24411,7 +24411,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
   n = 2;
   if (TARGET_SECURE_PLT
       && flag_pic
-      && GET_CODE (func_addr) == SYMBOL_REF
+      && SYMBOL_REF_P (func_addr)
       && !SYMBOL_REF_LOCAL_P (func_addr))
     call[n++] = gen_rtx_USE (VOIDmode, pic_offset_table_rtx);
 
@@ -24439,7 +24439,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
 
   /* Handle longcall attributes.  */
   if ((INTVAL (cookie) & CALL_LONG) != 0
-      && GET_CODE (func_desc) == SYMBOL_REF)
+      && SYMBOL_REF_P (func_desc))
     {
       func = rs6000_longcall_ref (func_desc, tlsarg);
       /* If the longcall was implemented as an inline PLT call using
@@ -24455,7 +24455,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
     }
 
   /* Handle indirect calls.  */
-  if (GET_CODE (func) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (func))
     {
       func = force_reg (Pmode, func);
 
@@ -24521,7 +24521,7 @@ rs6000_call_darwin_1 (rtx value, rtx func_desc, rtx tlsarg,
      If we're going to use this, then we need to keep the CALL_LONG bit set,
      so that we can pick up the special insn form later.  */
   if ((cookie_val & CALL_LONG) != 0
-      && GET_CODE (func_desc) == SYMBOL_REF)
+      && SYMBOL_REF_P (func_desc))
     {
       /* FIXME: the longcall opt should not hang off picsymbol stubs.  */
       if (darwin_picsymbol_stubs && TARGET_32BIT)
@@ -24536,7 +24536,7 @@ rs6000_call_darwin_1 (rtx value, rtx func_desc, rtx tlsarg,
     }
 
   /* Handle indirect calls.  */
-  if (GET_CODE (func) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (func))
     {
       func = force_reg (Pmode, func);
 
diff --git a/gcc/config/rx/constraints.md b/gcc/config/rx/constraints.md
index c252dc49bc4..a18031568b7 100644
--- a/gcc/config/rx/constraints.md
+++ b/gcc/config/rx/constraints.md
@@ -21,7 +21,7 @@
 
 (define_constraint "Symbol"
   "@internal Constraint on the type of rtx allowed in call insns"
-  (match_test "GET_CODE (op) == SYMBOL_REF")
+  (match_test "SYMBOL_REF_P (op)")
 )
 
 
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index b8d182e5944..02c6774ca00 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -86,7 +86,7 @@ rx_decl_for_addr (rtx op)
     op = XEXP (op, 0);
   while (GET_CODE (op) == PLUS)
     op = XEXP (op, 0);
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return SYMBOL_REF_DECL (op);
   return NULL_TREE;
 }
@@ -135,7 +135,7 @@ rx_pid_data_operand (rtx op)
   else
     {
       /* Sigh, some special cases.  */
-      if (GET_CODE (op) == SYMBOL_REF
+      if (SYMBOL_REF_P (op)
 	  || LABEL_REF_P (op))
 	return PID_UNENCODED;
     }
@@ -171,7 +171,7 @@ rx_small_data_operand (rtx op)
   if (rx_small_data_limit == 0)
     return false;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return SYMBOL_REF_SMALL_P (op);
 
   return false;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 6f85090f2ce..656a6d17920 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2966,7 +2966,7 @@ s390_decompose_address (rtx addr, struct s390_address *out)
 
   /* We can convert literal pool addresses to
      displacements by basing them off the base register.  */
-  if (disp && GET_CODE (disp) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (disp))
+  if (disp && SYMBOL_REF_P (disp) && CONSTANT_POOL_ADDRESS_P (disp))
     {
       if (base || indx)
 	return false;
@@ -3053,7 +3053,7 @@ s390_decompose_address (rtx addr, struct s390_address *out)
 	     zarch CPUs.  In this case the literal pool contains an lt
 	     relative offset to the _GLOBAL_OFFSET_TABLE_ label which
 	     will most likely exceed the displacement.  */
-	  if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
+	  if (!SYMBOL_REF_P (XVECEXP (disp, 0, 0))
 	      || !CONSTANT_POOL_ADDRESS_P (XVECEXP (disp, 0, 0)))
 	    return false;
 
@@ -3226,7 +3226,7 @@ s390_loadrelative_operand_p (rtx addr, rtx *symref, HOST_WIDE_INT *addend)
       addr = XEXP (addr, 0);
     }
 
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       || (GET_CODE (addr) == UNSPEC
 	  && (XINT (addr, 1) == UNSPEC_GOTENT
 	      || XINT (addr, 1) == UNSPEC_PLT)))
@@ -3931,7 +3931,7 @@ s390_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
 int
 tls_symbolic_operand (rtx op)
 {
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return 0;
   return SYMBOL_REF_TLS_MODEL (op);
 }
@@ -3961,7 +3961,7 @@ symbolic_reference_mentioned_p (rtx op)
   const char *fmt;
   int i;
 
-  if (GET_CODE (op) == SYMBOL_REF || LABEL_REF_P (op))
+  if (SYMBOL_REF_P (op) || LABEL_REF_P (op))
     return 1;
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -3991,7 +3991,7 @@ tls_symbolic_reference_mentioned_p (rtx op)
   const char *fmt;
   int i;
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return tls_symbolic_operand (op);
 
   fmt = GET_RTX_FORMAT (GET_CODE (op));
@@ -4285,7 +4285,7 @@ s390_preferred_reload_class (rtx op, reg_class_t rclass)
 	   they are used as literal pool slot replacement in reload
 	   inheritance (see emit_input_reload_insns).  */
 	if (GET_CODE (XEXP (op, 0)) == PLUS
-	    && GET_CODE (XEXP (XEXP(op, 0), 0)) == SYMBOL_REF
+	    && SYMBOL_REF_P (XEXP (XEXP(op, 0), 0))
 	    && CONST_INT_P (XEXP (XEXP(op, 0), 1)))
 	  {
 	    if (flag_pic && reg_class_subset_p (ADDR_REGS, rclass))
@@ -4335,7 +4335,7 @@ s390_check_symref_alignment (rtx addr, HOST_WIDE_INT alignment)
   if (addend & (alignment - 1))
     return false;
 
-  if (GET_CODE (symref) == SYMBOL_REF)
+  if (SYMBOL_REF_P (symref))
     {
       /* s390_encode_section_info is not called for anchors, since they don't
 	 have corresponding VAR_DECLs.  Therefore, we cannot rely on
@@ -4955,7 +4955,7 @@ legitimize_pic_address (rtx orig, rtx reg)
 	    }
 	}
     }
-  else if (GET_CODE (addr) == SYMBOL_REF && addend == const0_rtx)
+  else if (SYMBOL_REF_P (addr) && addend == const0_rtx)
     {
       /* A non-local symbol reference without addend.
 
@@ -5133,7 +5133,7 @@ legitimize_tls_address (rtx addr, rtx reg)
   rtx new_rtx, tls_call, temp, base, r2;
   rtx_insn *insn;
 
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     switch (tls_symbolic_operand (addr))
       {
       case TLS_MODEL_GLOBAL_DYNAMIC:
@@ -5267,7 +5267,7 @@ legitimize_tls_address (rtx addr, rtx reg)
 	   && CONST_INT_P (XEXP (XEXP (addr, 0), 1)))
     {
       new_rtx = XEXP (XEXP (addr, 0), 0);
-      if (GET_CODE (new_rtx) != SYMBOL_REF)
+      if (!SYMBOL_REF_P (new_rtx))
 	new_rtx = gen_rtx_CONST (Pmode, new_rtx);
 
       new_rtx = legitimize_tls_address (new_rtx, reg);
@@ -7863,7 +7863,7 @@ print_operand (FILE *file, rtx x, int code)
       return;
 
     case 'J':
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  fprintf (file, "%s", ":tls_load:");
 	  output_addr_const (file, x);
@@ -8328,7 +8328,7 @@ annotate_constant_pool_refs_1 (rtx *x)
   int i, j;
   const char *fmt;
 
-  gcc_assert (GET_CODE (*x) != SYMBOL_REF
+  gcc_assert (!SYMBOL_REF_P (*x)
 	      || !CONSTANT_POOL_ADDRESS_P (*x));
 
   /* Literal pool references can only occur inside a MEM ...  */
@@ -8336,7 +8336,7 @@ annotate_constant_pool_refs_1 (rtx *x)
     {
       rtx memref = XEXP (*x, 0);
 
-      if (GET_CODE (memref) == SYMBOL_REF
+      if (SYMBOL_REF_P (memref)
 	  && CONSTANT_POOL_ADDRESS_P (memref))
 	{
 	  rtx base = cfun->machine->base_reg;
@@ -8350,7 +8350,7 @@ annotate_constant_pool_refs_1 (rtx *x)
       if (GET_CODE (memref) == CONST
 	  && GET_CODE (XEXP (memref, 0)) == PLUS
 	  && CONST_INT_P (XEXP (XEXP (memref, 0), 1))
-	  && GET_CODE (XEXP (XEXP (memref, 0), 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (XEXP (memref, 0), 0))
 	  && CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (memref, 0), 0)))
 	{
 	  HOST_WIDE_INT off = INTVAL (XEXP (XEXP (memref, 0), 1));
@@ -8369,7 +8369,7 @@ annotate_constant_pool_refs_1 (rtx *x)
     {
       rtx addrref = SET_SRC (*x);
 
-      if (GET_CODE (addrref) == SYMBOL_REF
+      if (SYMBOL_REF_P (addrref)
 	  && CONSTANT_POOL_ADDRESS_P (addrref))
 	{
 	  rtx base = cfun->machine->base_reg;
@@ -8383,7 +8383,7 @@ annotate_constant_pool_refs_1 (rtx *x)
       if (GET_CODE (addrref) == CONST
 	  && GET_CODE (XEXP (addrref, 0)) == PLUS
 	  && CONST_INT_P (XEXP (XEXP (addrref, 0), 1))
-	  && GET_CODE (XEXP (XEXP (addrref, 0), 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (XEXP (addrref, 0), 0))
 	  && CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (addrref, 0), 0)))
 	{
 	  HOST_WIDE_INT off = INTVAL (XEXP (XEXP (addrref, 0), 1));
@@ -8436,13 +8436,13 @@ find_constant_pool_ref_1 (rtx x, rtx *ref)
       && XINT (x, 1) == UNSPECV_POOL_ENTRY)
     return;
 
-  gcc_assert (GET_CODE (x) != SYMBOL_REF
+  gcc_assert (!SYMBOL_REF_P (x)
 	      || !CONSTANT_POOL_ADDRESS_P (x));
 
   if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_LTREF)
     {
       rtx sym = XVECEXP (x, 0, 0);
-      gcc_assert (GET_CODE (sym) == SYMBOL_REF
+      gcc_assert (SYMBOL_REF_P (sym)
 		  && CONSTANT_POOL_ADDRESS_P (sym));
 
       if (*ref == NULL_RTX)
@@ -12915,7 +12915,7 @@ s390_encode_section_info (tree decl, rtx rtl, int first)
      differently here.  We rely on the information in the MEM_ALIGN
      entry to decide upon the alignment.  */
   if (MEM_P (rtl)
-      && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (rtl, 0))
       && TREE_CONSTANT_POOL_ADDRESS_P (XEXP (rtl, 0)))
     {
       if (MEM_ALIGN (rtl) == 0 || MEM_ALIGN (rtl) % 16)
@@ -13456,7 +13456,7 @@ s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg,
   int i;
 
   /* Direct function calls need special treatment.  */
-  if (GET_CODE (addr_location) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr_location))
     {
       /* When calling a global routine in PIC mode, we must
 	 replace the symbol itself with the PLT stub.  */
@@ -13488,7 +13488,7 @@ s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg,
      SYMBOL_REF to somewhere else make sure the address can be found in
      register 1.  */
   if (retaddr_reg == NULL_RTX
-      && GET_CODE (addr_location) != SYMBOL_REF
+      && !SYMBOL_REF_P (addr_location)
       && !plt_call)
     {
       emit_move_insn (gen_rtx_REG (Pmode, SIBCALL_REGNUM), addr_location);
@@ -13496,7 +13496,7 @@ s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg,
     }
 
   if (TARGET_INDIRECT_BRANCH_NOBP_CALL
-      && GET_CODE (addr_location) != SYMBOL_REF
+      && !SYMBOL_REF_P (addr_location)
       && !plt_call)
     {
       /* Indirect branch thunks require the target to be a single GPR.  */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index adf64951258..4e5ec0f8305 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -807,12 +807,12 @@ CUMULATIVE_ARGS;
 
 /* Helper macro for s390.c and s390.md to check for symbolic constants.  */
 #define SYMBOLIC_CONST(X)						\
-  (GET_CODE (X) == SYMBOL_REF						\
+  (SYMBOL_REF_P (X)						\
    || LABEL_REF_P (X)						\
    || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
 #define TLS_SYMBOLIC_CONST(X)						\
-  ((GET_CODE (X) == SYMBOL_REF && tls_symbolic_operand (X))		\
+  ((SYMBOL_REF_P (X) && tls_symbolic_operand (X))		\
    || (GET_CODE (X) == CONST && tls_symbolic_reference_mentioned_p (X)))
 
 
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 3305d9fdf73..0bc49be5428 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -1968,7 +1968,7 @@
         (mem:DI (match_operand 1 "address_operand" "")))]
   "TARGET_ZARCH
    && !FP_REG_P (operands[0])
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && CONSTANT_POOL_ADDRESS_P (operands[1])
    && get_pool_mode (operands[1]) == DImode
    && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
@@ -2162,7 +2162,7 @@
   [(set (match_operand:SI 0 "register_operand" "")
         (mem:SI (match_operand 1 "address_operand" "")))]
   "!FP_REG_P (operands[0])
-   && GET_CODE (operands[1]) == SYMBOL_REF
+   && SYMBOL_REF_P (operands[1])
    && CONSTANT_POOL_ADDRESS_P (operands[1])
    && get_pool_mode (operands[1]) == SImode
    && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
@@ -2304,7 +2304,7 @@
 (define_peephole2
   [(set (match_operand:HI 0 "register_operand" "")
         (mem:HI (match_operand 1 "address_operand" "")))]
-  "GET_CODE (operands[1]) == SYMBOL_REF
+  "SYMBOL_REF_P (operands[1])
    && CONSTANT_POOL_ADDRESS_P (operands[1])
    && get_pool_mode (operands[1]) == HImode
    && CONST_INT_P (get_pool_constant (operands[1]))"
@@ -2369,7 +2369,7 @@
 (define_peephole2
   [(set (match_operand:QI 0 "nonimmediate_operand" "")
         (mem:QI (match_operand 1 "address_operand" "")))]
-  "GET_CODE (operands[1]) == SYMBOL_REF
+  "SYMBOL_REF_P (operands[1])
    && CONSTANT_POOL_ADDRESS_P (operands[1])
    && get_pool_mode (operands[1]) == QImode
    && CONST_INT_P (get_pool_constant (operands[1]))"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 2d1bd801851..50f561f63eb 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1795,7 +1795,7 @@ prepare_move_operands (rtx operands[], machine_mode mode)
       rtx base, offset;
       split_const (operands[1], &base, &offset);
 
-      if (GET_CODE (base) == SYMBOL_REF
+      if (SYMBOL_REF_P (base)
 	  && !offset_within_block_p (base, INTVAL (offset)))
 	{
 	  rtx tmp = can_create_pseudo_p () ? gen_reg_rtx (mode) : operands[0];
@@ -2840,7 +2840,7 @@ static bool
 sh_assemble_integer (rtx value, unsigned int size, int aligned_p)
 {
   if (TARGET_FDPIC && size == UNITS_PER_WORD
-      && GET_CODE (value) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (value))
+      && SYMBOL_REF_P (value) && SYMBOL_REF_FUNCTION_P (value))
     {
       fputs ("\t.long\t", asm_out_file);
       output_addr_const (asm_out_file, value);
@@ -5987,7 +5987,7 @@ sh_reorg (void)
 	     being set to a symbol.  In theory, we could sometimes
 	     optimize calls to a constant location, but the assembler
 	     and linker do not support that at present.  */
-	  if (GET_CODE (SET_SRC (set)) != SYMBOL_REF
+	  if (!SYMBOL_REF_P (SET_SRC (set))
 	      && !LABEL_REF_P (SET_SRC (set)))
 	    continue;
 
@@ -8511,7 +8511,7 @@ sh2a_handle_function_vector_handler_attribute (tree * node, tree name,
 bool
 sh2a_is_function_vector_call (rtx x)
 {
-  if (GET_CODE (x) == SYMBOL_REF
+  if (SYMBOL_REF_P (x)
       && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     {
       tree tr = SYMBOL_REF_DECL (x);
@@ -8528,7 +8528,7 @@ sh2a_is_function_vector_call (rtx x)
 int
 sh2a_get_function_vector_number (rtx x)
 {
-  if ((GET_CODE (x) == SYMBOL_REF)
+  if ((SYMBOL_REF_P (x))
       && (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
     {
       tree t = SYMBOL_REF_DECL (x);
@@ -8729,7 +8729,7 @@ fp_one_operand (rtx op)
 enum tls_model
 tls_symbolic_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
 {
-  if (GET_CODE (op) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (op))
     return TLS_MODEL_NONE;
   return SYMBOL_REF_TLS_MODEL (op);
 }
@@ -9096,7 +9096,7 @@ sh_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 bool
 nonpic_symbol_mentioned_p (rtx x)
 {
-  if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x)
+  if (SYMBOL_REF_P (x) || LABEL_REF_P (x)
       || GET_CODE (x) == PC)
     return true;
 
@@ -9146,13 +9146,13 @@ legitimize_pic_address (rtx orig, machine_mode mode ATTRIBUTE_UNUSED, rtx reg)
     return orig;
 
   if (LABEL_REF_P (orig)
-      || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig)))
+      || (SYMBOL_REF_P (orig) && SYMBOL_REF_LOCAL_P (orig)))
     {
       if (reg == NULL_RTX)
 	reg = gen_reg_rtx (Pmode);
 
       if (TARGET_FDPIC
-	  && GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (orig))
+	  && SYMBOL_REF_P (orig) && SYMBOL_REF_FUNCTION_P (orig))
 	{
 	  /* Weak functions may be NULL which doesn't work with
 	     GOTOFFFUNCDESC because the runtime offset is not known.  */
@@ -9163,7 +9163,7 @@ legitimize_pic_address (rtx orig, machine_mode mode ATTRIBUTE_UNUSED, rtx reg)
 	}
       else if (TARGET_FDPIC
 	       && (LABEL_REF_P (orig)
-		   || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_DECL (orig)
+		   || (SYMBOL_REF_P (orig) && SYMBOL_REF_DECL (orig)
 		       && (TREE_READONLY (SYMBOL_REF_DECL (orig))
 			   || SYMBOL_REF_EXTERNAL_P (orig)
 			   || DECL_SECTION_NAME(SYMBOL_REF_DECL (orig))))))
@@ -9173,7 +9173,7 @@ legitimize_pic_address (rtx orig, machine_mode mode ATTRIBUTE_UNUSED, rtx reg)
 	emit_insn (gen_symGOTOFF2reg (reg, orig));
       return reg;
     }
-  else if (GET_CODE (orig) == SYMBOL_REF)
+  else if (SYMBOL_REF_P (orig))
     {
       if (reg == NULL_RTX)
 	reg = gen_reg_rtx (Pmode);
@@ -11506,7 +11506,7 @@ sh_legitimate_constant_p (machine_mode mode, rtx x)
       rtx base, offset;
       split_const (x, &base, &offset);
 
-      if (GET_CODE (base) == SYMBOL_REF
+      if (SYMBOL_REF_P (base)
 	  && !offset_within_block_p (base, INTVAL (offset)))
        return false;
     }
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 4305398f9ff..d2515fe2dac 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1406,12 +1406,12 @@ extern bool current_function_interrupt;
    && XINT (XEXP ((OP), 0), 1) == UNSPEC_PCREL_SYMOFF)
 
 #define NON_PIC_REFERENCE_P(OP) \
-  (LABEL_REF_P (OP) || GET_CODE (OP) == SYMBOL_REF \
+  (LABEL_REF_P (OP) || SYMBOL_REF_P (OP) \
    || (GET_CODE (OP) == CONST \
        && (LABEL_REF_P (XEXP ((OP), 0)) \
-	   || GET_CODE (XEXP ((OP), 0)) == SYMBOL_REF)) \
+	   || SYMBOL_REF_P (XEXP ((OP), 0)))) \
    || (GET_CODE (OP) == CONST && GET_CODE (XEXP ((OP), 0)) == PLUS \
-       && (GET_CODE (XEXP (XEXP ((OP), 0), 0)) == SYMBOL_REF \
+       && (SYMBOL_REF_P (XEXP (XEXP ((OP), 0), 0)) \
 	   || LABEL_REF_P (XEXP (XEXP ((OP), 0), 0))) \
        && CONST_INT_P (XEXP (XEXP ((OP), 0), 1))))
 
@@ -1590,12 +1590,12 @@ extern bool current_function_interrupt;
    nor can we indirect via the constant pool.  */
 #define LEGITIMATE_PIC_OPERAND_P(X)				\
 	((! nonpic_symbol_mentioned_p (X)			\
-	  && (GET_CODE (X) != SYMBOL_REF			\
+	  && (!SYMBOL_REF_P (X)			\
 	      || ! CONSTANT_POOL_ADDRESS_P (X)			\
 	      || ! nonpic_symbol_mentioned_p (get_pool_constant (X)))))
 
 #define SYMBOLIC_CONST_P(X)	\
-((GET_CODE (X) == SYMBOL_REF || LABEL_REF_P (X))	\
+((SYMBOL_REF_P (X) || LABEL_REF_P (X))	\
   && nonpic_symbol_mentioned_p (X))
 
 /* Compute extra cost of moving data between one register class
@@ -1880,7 +1880,7 @@ extern tree *sh_deferred_function_attributes_tail;
     if (((ENCODING) & 0xf) != DW_EH_PE_sdata4 \
 	&& ((ENCODING) & 0xf) != DW_EH_PE_sdata8) \
       { \
-	gcc_assert (GET_CODE (ADDR) == SYMBOL_REF); \
+	gcc_assert (SYMBOL_REF_P (ADDR)); \
 	SYMBOL_REF_FLAGS (ADDR) |= SYMBOL_FLAG_FUNCTION; \
 	if (0) goto DONE; \
       } \
@@ -1889,7 +1889,7 @@ extern tree *sh_deferred_function_attributes_tail;
       { \
 	fputs ("\t.ualong ", FILE); \
 	output_addr_const (FILE, ADDR); \
-	if (GET_CODE (ADDR) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (ADDR)) \
+	if (SYMBOL_REF_P (ADDR) && SYMBOL_REF_FUNCTION_P (ADDR)) \
 	  fputs ("@GOTFUNCDESC", FILE); \
 	else \
 	  fputs ("@GOT", FILE); \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 86a27e24788..8b6e0594cf7 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -6712,7 +6712,7 @@
 
   if (!flag_pic && TARGET_SH2A
       && MEM_P (operands[0])
-      && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (operands[0], 0)))
     {
       if (sh2a_is_function_vector_call (XEXP (operands[0], 0)))
 	{
@@ -6723,7 +6723,7 @@
     }
   if (flag_pic && TARGET_SH2
       && MEM_P (operands[0])
-      && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (operands[0], 0)))
     {
       emit_call_insn (gen_call_pcrel (XEXP (operands[0], 0), operands[1]));
       DONE;
@@ -6761,7 +6761,7 @@
 
   if (!flag_pic && TARGET_SH2A
       && MEM_P (operands[1])
-      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (operands[1], 0)))
     {
       if (sh2a_is_function_vector_call (XEXP (operands[1], 0)))
 	{
@@ -6772,7 +6772,7 @@
     }
   if (flag_pic && TARGET_SH2
       && MEM_P (operands[1])
-      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (operands[1], 0)))
     {
       emit_call_insn (gen_call_value_pcrel (operands[0], XEXP (operands[1], 0),
 					    operands[2]));
@@ -6939,7 +6939,7 @@
 
   if (flag_pic && TARGET_SH2
       && MEM_P (operands[0])
-      && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (operands[0], 0))
       /* The PLT needs the PIC register, but the epilogue would have
 	 to restore it, so we can only use PC-relative PIC calls for
 	 static functions.  */
@@ -7114,7 +7114,7 @@
 
   if (flag_pic && TARGET_SH2
       && MEM_P (operands[1])
-      && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (operands[1], 0))
       /* The PLT needs the PIC register, but the epilogue would have
 	 to restore it, so we can only use PC-relative PIC calls for
 	 static functions.  */
@@ -7382,7 +7382,7 @@
       && flag_stack_protect
       && GET_CODE (operands[1]) == CONST
       && GET_CODE (XEXP (operands[1], 0)) == UNSPEC
-      && GET_CODE (XVECEXP (XEXP (operands[1], 0), 0, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XVECEXP (XEXP (operands[1], 0), 0, 0))
       && strcmp (XSTR (XVECEXP (XEXP (operands[1], 0), 0, 0), 0),
 		 "__stack_chk_guard") == 0)
     stack_chk_guard_p = true;
diff --git a/gcc/config/sparc/predicates.md b/gcc/config/sparc/predicates.md
index 7d1f700d421..313cf33f8ad 100644
--- a/gcc/config/sparc/predicates.md
+++ b/gcc/config/sparc/predicates.md
@@ -106,7 +106,7 @@
 
     case CONST:
       op = XEXP (op, 0);
-      return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+      return (((SYMBOL_REF_P (XEXP (op, 0))
 		&& !SYMBOL_REF_TLS_MODEL (XEXP (op, 0)))
 	       || LABEL_REF_P (XEXP (op, 0)))
 	      && CONST_INT_P (XEXP (op, 1)));
@@ -147,7 +147,7 @@
                              (const (minus (label) (pc))))).  */
   op = XEXP (op, 0);
   return GET_CODE (op) == MINUS
-         && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+         && SYMBOL_REF_P (XEXP (op, 0))
          && GET_CODE (XEXP (op, 1)) == CONST
          && GET_CODE (XEXP (XEXP (op, 1), 0)) == MINUS;
 })
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index b5540da8d4a..3adb460147e 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4331,7 +4331,7 @@ check_pic (int i)
     {
     case 1:
       op = recog_data.operand[i];
-      gcc_assert (GET_CODE (op) != SYMBOL_REF
+      gcc_assert (!SYMBOL_REF_P (op)
 	  	  && (GET_CODE (op) != CONST
 		      || (GET_CODE (XEXP (op, 0)) == MINUS
 			  && XEXP (XEXP (op, 0), 0) == sparc_got ()
@@ -4352,7 +4352,7 @@ pic_address_needs_scratch (rtx x)
   /* An address which is a symbolic plus a non SMALL_INT needs a temp reg.  */
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
       && CONST_INT_P (XEXP (XEXP (x, 0), 1))
       && !SMALL_INT (XEXP (XEXP (x, 0), 1)))
     return 1;
@@ -4505,7 +4505,7 @@ sparc_legitimate_address_p (machine_mode mode, rtx addr, bool strict)
 	   && !SUBREG_P (rs2)
 	   && GET_CODE (rs2) != LO_SUM
 	   && !MEM_P (rs2)
-	   && !(GET_CODE (rs2) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs2))
+	   && !(SYMBOL_REF_P (rs2) && SYMBOL_REF_TLS_MODEL (rs2))
 	   && (! symbolic_operand (rs2, VOIDmode) || mode == Pmode)
 	   && (!CONST_INT_P (rs2) || SMALL_INT (rs2)))
 	  || ((REG_P (rs1)
@@ -4550,7 +4550,7 @@ sparc_legitimate_address_p (machine_mode mode, rtx addr, bool strict)
 	  imm1 = XEXP (rs1, 1);
 	  rs1 = XEXP (rs1, 0);
 	  if (!CONSTANT_P (imm1)
-	      || (GET_CODE (rs1) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs1)))
+	      || (SYMBOL_REF_P (rs1) && SYMBOL_REF_TLS_MODEL (rs1)))
 	    return 0;
 	}
     }
@@ -4560,7 +4560,7 @@ sparc_legitimate_address_p (machine_mode mode, rtx addr, bool strict)
       imm1 = XEXP (addr, 1);
 
       if (!CONSTANT_P (imm1)
-	  || (GET_CODE (rs1) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs1)))
+	  || (SYMBOL_REF_P (rs1) && SYMBOL_REF_TLS_MODEL (rs1)))
 	return 0;
 
       /* We can't allow TFmode in 32-bit mode, because an offset greater
@@ -4661,7 +4661,7 @@ sparc_tls_referenced_p (rtx x)
   if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
     x = XEXP (XEXP (x, 0), 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x))
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x))
     return true;
 
   /* That's all we handle in sparc_legitimize_tls_address for now.  */
@@ -4679,7 +4679,7 @@ sparc_legitimize_tls_address (rtx addr)
 
   gcc_assert (can_create_pseudo_p ());
 
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     /* Although the various sethi/or sequences generate SImode values, many of
        them can be transformed by the linker when relaxing and, if relaxing to
        local-exec, will become a sethi/xor pair, which is signed and therefore
@@ -4846,7 +4846,7 @@ sparc_legitimize_tls_address (rtx addr)
 static rtx
 sparc_legitimize_pic_address (rtx orig, rtx reg)
 {
-  if (GET_CODE (orig) == SYMBOL_REF
+  if (SYMBOL_REF_P (orig)
       /* See the comment in sparc_expand_move.  */
       || (LABEL_REF_P (orig) && !can_use_mov_pic_label_ref (orig)))
     {
@@ -4995,7 +4995,7 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
   else if (GET_CODE (x) == PLUS && CONSTANT_ADDRESS_P (XEXP (x, 0)))
     x = gen_rtx_PLUS (Pmode, XEXP (x, 1),
 		      copy_to_mode_reg (Pmode, XEXP (x, 0)));
-  else if (GET_CODE (x) == SYMBOL_REF
+  else if (SYMBOL_REF_P (x)
 	   || GET_CODE (x) == CONST
 	   || LABEL_REF_P (x))
     x = copy_to_suggested_reg (x, NULL_RTX, Pmode);
@@ -5019,11 +5019,11 @@ sparc_delegitimize_address (rtx x)
       case UNSPEC_MOVE_PIC:
       case UNSPEC_TLSLE:
 	x = XVECEXP (x, 0, 0);
-	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (x));
 	break;
       case UNSPEC_MOVE_GOTDATA:
 	x = XVECEXP (x, 0, 2);
-	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (x));
 	break;
       default:
 	break;
@@ -5141,7 +5141,7 @@ sparc_emit_call_insn (rtx pat, rtx addr)
   /* The PIC register is live on entry to VxWorks PIC PLT entries.  */
   if (TARGET_VXWORKS_RTP
       && flag_pic
-      && GET_CODE (addr) == SYMBOL_REF
+      && SYMBOL_REF_P (addr)
       && (SYMBOL_REF_DECL (addr)
 	  ? !targetm.binds_local_p (SYMBOL_REF_DECL (addr))
 	  : !SYMBOL_REF_LOCAL_P (addr)))
@@ -9686,7 +9686,7 @@ sparc_print_operand_address (FILE *file, machine_mode /*mode*/, rtx x)
 	    fprintf (file, "%+d", offset);
 	  else if (REG_P (index))
 	    fprintf (file, "+%s", reg_names[REGNO (index)]);
-	  else if (GET_CODE (index) == SYMBOL_REF
+	  else if (SYMBOL_REF_P (index)
 		   || LABEL_REF_P (index)
 		   || GET_CODE (index) == CONST)
 	    fputc ('+', file), output_addr_const (file, index);
diff --git a/gcc/config/spu/constraints.md b/gcc/config/spu/constraints.md
index ad028ef3686..9bf3090219a 100644
--- a/gcc/config/spu/constraints.md
+++ b/gcc/config/spu/constraints.md
@@ -155,7 +155,7 @@
   "Call operand, symbol, for relative calls."
   (and (match_code "mem")
        (match_test "!TARGET_LARGE_MEM
-		    && ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
+		    && ((SYMBOL_REF_P (XEXP (op, 0))
 			 || LABEL_REF_P (XEXP (op, 0))))")))
 
 (define_memory_constraint "T"
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 4888e90536b..475d25bd432 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -3071,7 +3071,7 @@ spu_float_const (const char *string, machine_mode mode)
 int
 spu_constant_address_p (rtx x)
 {
-  return (LABEL_REF_P (x) || GET_CODE (x) == SYMBOL_REF
+  return (LABEL_REF_P (x) || SYMBOL_REF_P (x)
 	  || CONST_INT_P (x) || GET_CODE (x) == CONST
 	  || GET_CODE (x) == HIGH);
 }
@@ -3193,7 +3193,7 @@ classify_immediate (rtx op, machine_mode mode)
 	  rtx sym = XEXP (XEXP (op, 0), 0);
 	  rtx cst = XEXP (XEXP (op, 0), 1);
 
-	  if (GET_CODE (sym) == SYMBOL_REF
+	  if (SYMBOL_REF_P (sym)
 	      && CONST_INT_P (cst)
 	      && satisfies_constraint_K (cst))
 	    return IC_IL1s;
@@ -3463,7 +3463,7 @@ ea_symbol_ref_p (const_rtx x)
 	x = op0;
     }
 
-  return (GET_CODE (x) == SYMBOL_REF
+  return (SYMBOL_REF_P (x)
  	  && (decl = SYMBOL_REF_DECL (x)) != 0
  	  && TREE_CODE (decl) == VAR_DECL
  	  && TYPE_ADDR_SPACE (TREE_TYPE (decl)));
@@ -3491,7 +3491,7 @@ spu_legitimate_constant_p (machine_mode mode, rtx x)
   /* V4SI with all identical symbols is valid. */
   if (!flag_pic
       && mode == V4SImode
-      && (GET_CODE (CONST_VECTOR_ELT (x, 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (CONST_VECTOR_ELT (x, 0))
 	  || LABEL_REF_P (CONST_VECTOR_ELT (x, 0))
 	  || GET_CODE (CONST_VECTOR_ELT (x, 0)) == CONST))
     return const_vec_duplicate_p (x);
@@ -4173,7 +4173,7 @@ store_with_one_insn_p (rtx mem)
   if (GET_MODE_SIZE (mode) >= 16)
     return 1;
   /* Only static objects. */
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     {
       /* We use the associated declaration to make sure the access is
          referring to the whole object.
@@ -5173,10 +5173,10 @@ reloc_diagnostic (rtx x)
   if (!flag_pic || !(TARGET_WARN_RELOC || TARGET_ERROR_RELOC))
     return;
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     decl = SYMBOL_REF_DECL (x);
   else if (GET_CODE (x) == CONST
-	   && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+	   && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0)))
     decl = SYMBOL_REF_DECL (XEXP (XEXP (x, 0), 0));
 
   /* SYMBOL_REF_DECL is not necessarily a DECL. */
@@ -5219,7 +5219,7 @@ spu_assemble_integer (rtx x, unsigned int size, int aligned_p)
   /* By default run-time relocations aren't supported, but we allow them
      in case users support it in their own run-time loader.  And we provide
      a warning for those users that don't.  */
-  if ((GET_CODE (x) == SYMBOL_REF)
+  if ((SYMBOL_REF_P (x))
       || LABEL_REF_P (x) || GET_CODE (x) == CONST)
     reloc_diagnostic (x);
 
@@ -6388,7 +6388,7 @@ spu_check_builtin_parm (struct spu_builtin_description *d, rtx op, int p)
 	}
 
       if (LABEL_REF_P (op)
-	  || (GET_CODE (op) == SYMBOL_REF
+	  || (SYMBOL_REF_P (op)
 	      && SYMBOL_REF_FUNCTION_P (op))
 	  || (v & ((1 << lsbits) - 1)) != 0)
 	warning (0, "%d least significant bits of %s are ignored", lsbits,
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 4af55bd9d8d..988a68342af 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -104,7 +104,7 @@ extern GTY(()) int spu_tune;
 
 /* symbol_ref's of functions are not aligned to 16 byte boundary. */
 #define ALIGNED_SYMBOL_REF_P(X) \
-	(GET_CODE (X) == SYMBOL_REF \
+	(SYMBOL_REF_P (X) \
           && (SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ALIGN1) == 0 \
 	  && (! SYMBOL_REF_FUNCTION_P (X) \
 	      || align_functions.levels[0].get_value () >= 16))
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 9a2b744426f..cc0adc218a9 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -515,7 +515,7 @@ xstormy16_below100_symbol (rtx x,
   if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1)))
     x = XEXP (x, 0);
 
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_XSTORMY16_BELOW100) != 0;
 
   if (CONST_INT_P (x))
@@ -1547,7 +1547,7 @@ xstormy16_asm_output_aligned_common (FILE *stream,
 
   if (mem != NULL_RTX
       && MEM_P (mem)
-      && GET_CODE (symbol = XEXP (mem, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (symbol = XEXP (mem, 0))
       && SYMBOL_REF_FLAGS (symbol) & SYMBOL_FLAG_XSTORMY16_BELOW100)
     {
       const char *name2;
@@ -1608,7 +1608,7 @@ xstormy16_encode_section_info (tree decl, rtx r, int first)
     {
       rtx symbol = XEXP (r, 0);
 
-      gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (symbol));
       SYMBOL_REF_FLAGS (symbol) |= SYMBOL_FLAG_XSTORMY16_BELOW100;
     }
 }
@@ -1773,7 +1773,7 @@ xstormy16_print_operand (FILE *file, rtx x, int code)
 
     case 'C':
       /* Print the symbol without a surrounding @fptr().  */
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	assemble_name (file, XSTR (x, 0));
       else if (LABEL_P (x))
 	output_asm_label (x);
diff --git a/gcc/config/tilegx/predicates.md b/gcc/config/tilegx/predicates.md
index 412a7ed24f4..bac0f483687 100644
--- a/gcc/config/tilegx/predicates.md
+++ b/gcc/config/tilegx/predicates.md
@@ -259,7 +259,7 @@
   (ior (match_code "symbol_ref,label_ref")
        (and (match_code "const")
 	    (match_test "GET_CODE (XEXP (op,0)) == PLUS
-			 && (GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF
+			 && (SYMBOL_REF_P (XEXP (XEXP (op,0), 0))
 			     || LABEL_REF_P (XEXP (XEXP (op,0), 0)))
 			 && CONST_INT_P (XEXP (XEXP (op,0), 1))"))))
 
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index b96994c5997..afc9555bb5e 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -810,7 +810,7 @@ tilegx_tls_referenced_p (rtx x)
   if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
     x = XEXP (XEXP (x, 0), 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x))
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x))
     return true;
 
   /* That's all we handle in tilegx_legitimize_tls_address for
@@ -826,7 +826,7 @@ tilegx_pic_address_needs_scratch (rtx x)
 {
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	  || LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
       && (CONST_INT_P (XEXP (XEXP (x, 0), 1))))
     return true;
@@ -985,7 +985,7 @@ tilegx_legitimize_tls_address (rtx addr)
 
   gcc_assert (can_create_pseudo_p ());
 
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     switch (SYMBOL_REF_TLS_MODEL (addr))
       {
       case TLS_MODEL_GLOBAL_DYNAMIC:
@@ -1209,7 +1209,7 @@ tilegx_legitimize_pic_address (rtx orig,
 			       machine_mode mode ATTRIBUTE_UNUSED,
 			       rtx reg)
 {
-  if (GET_CODE (orig) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig))
     {
       rtx address, pic_ref;
 
@@ -4571,7 +4571,7 @@ replace_mov_pcrel_step1 (rtx_insn *insn)
   opnds[1] = XVECEXP (unspec, 0, 0);
 
   /* We only need to replace SYMBOL_REFs, not LABEL_REFs.  */
-  if (GET_CODE (opnds[1]) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (opnds[1]))
     return;
 
   start_sequence ();
@@ -4648,7 +4648,7 @@ replace_mov_pcrel_step2 (rtx_insn *insn)
   opnds[2] = XVECEXP (unspec, 0, 0);
 
   /* We only need to replace SYMBOL_REFs, not LABEL_REFs.  */
-  if (GET_CODE (opnds[2]) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (opnds[2]))
     return;
 
   start_sequence ();
@@ -4707,7 +4707,7 @@ replace_mov_pcrel_step3 (rtx_insn *insn)
   opnds[3] = XVECEXP (unspec, 0, 2);
 
   /* We only need to replace SYMBOL_REFs, not LABEL_REFs.  */
-  if (GET_CODE (opnds[3]) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (opnds[3]))
     return;
 
   start_sequence ();
@@ -5371,7 +5371,7 @@ tilegx_print_operand (FILE *file, rtx x, int code)
       }
 
     case 'p':
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  if (flag_pic && !SYMBOL_REF_LOCAL_P (x))
 	    fprintf (file, "plt(");
diff --git a/gcc/config/tilegx/tilegx.md b/gcc/config/tilegx/tilegx.md
index dce43eca074..7353bf71105 100644
--- a/gcc/config/tilegx/tilegx.md
+++ b/gcc/config/tilegx/tilegx.md
@@ -2535,7 +2535,7 @@
 {
   rtx orig_addr = XEXP (operands[0], 0);
   rtx addr;
-  if (GET_CODE (orig_addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig_addr))
     {
       if (tilegx_cmodel == CM_LARGE)
         {
@@ -2577,7 +2577,7 @@
 {
   rtx orig_addr = XEXP (operands[1], 0);
   rtx addr;
-  if (GET_CODE (orig_addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig_addr))
     {
       if (tilegx_cmodel == CM_LARGE)
         {
diff --git a/gcc/config/tilepro/predicates.md b/gcc/config/tilepro/predicates.md
index 4f8ec509bf3..e4c025593da 100644
--- a/gcc/config/tilepro/predicates.md
+++ b/gcc/config/tilepro/predicates.md
@@ -218,7 +218,7 @@
   (ior (match_code "symbol_ref,label_ref")
        (and (match_code "const")
 	    (match_test "GET_CODE (XEXP (op,0)) == PLUS
-			 && (GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF
+			 && (SYMBOL_REF_P (XEXP (XEXP (op,0), 0))
 			     || LABEL_REF_P (XEXP (XEXP (op,0), 0)))
 			 && CONST_INT_P (XEXP (XEXP (op,0), 1))"))))
 
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index 31b6d5af513..4ea38853fda 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -710,7 +710,7 @@ tilepro_tls_referenced_p (rtx x)
   if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
     x = XEXP (XEXP (x, 0), 0);
 
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x))
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x))
     return true;
 
   /* That's all we handle in tilepro_legitimize_tls_address for
@@ -726,7 +726,7 @@ tilepro_pic_address_needs_scratch (rtx x)
 {
   if (GET_CODE (x) == CONST
       && GET_CODE (XEXP (x, 0)) == PLUS
-      && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	  || LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
       && CONST_INT_P (XEXP (XEXP (x, 0), 1)))
     return true;
@@ -885,7 +885,7 @@ tilepro_legitimize_tls_address (rtx addr)
 
   gcc_assert (can_create_pseudo_p ());
 
-  if (GET_CODE (addr) == SYMBOL_REF)
+  if (SYMBOL_REF_P (addr))
     switch (SYMBOL_REF_TLS_MODEL (addr))
       {
       case TLS_MODEL_GLOBAL_DYNAMIC:
@@ -980,7 +980,7 @@ tilepro_legitimize_pic_address (rtx orig,
 				machine_mode mode ATTRIBUTE_UNUSED,
 				rtx reg)
 {
-  if (GET_CODE (orig) == SYMBOL_REF)
+  if (SYMBOL_REF_P (orig))
     {
       rtx address, pic_ref;
 
@@ -4115,7 +4115,7 @@ replace_addli_pcrel (rtx_insn *insn)
   opnds[3] = XVECEXP (unspec, 0, 1);
 
   /* We only need to replace SYMBOL_REFs, not LABEL_REFs.  */
-  if (GET_CODE (opnds[2]) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (opnds[2]))
     return;
 
   first_insn_p = (opnds[1] == tilepro_text_label_rtx ());
@@ -4180,7 +4180,7 @@ replace_auli_pcrel (rtx_insn *insn)
   opnds[3] = XVECEXP (unspec, 0, 1);
 
   /* We only need to replace SYMBOL_REFs, not LABEL_REFs.  */
-  if (GET_CODE (opnds[2]) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (opnds[2]))
     return;
 
   first_insn_p = (opnds[1] == tilepro_text_label_rtx ());
@@ -4688,7 +4688,7 @@ tilepro_print_operand (FILE *file, rtx x, int code)
       }
 
     case 'p':
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  if (flag_pic && !SYMBOL_REF_LOCAL_P (x))
 	    fprintf (file, "plt(");
diff --git a/gcc/config/v850/constraints.md b/gcc/config/v850/constraints.md
index 0513207136b..a901bc0d69e 100644
--- a/gcc/config/v850/constraints.md
+++ b/gcc/config/v850/constraints.md
@@ -100,7 +100,7 @@
 	    (match_test "SYMBOL_REF_ZDA_P (op)"))
        (and (match_code "const")
 	    (match_test "GET_CODE (XEXP (op, 0)) == PLUS")
-	    (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF")
+	    (match_test "SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))")
 	    (match_test "SYMBOL_REF_ZDA_P (XEXP (XEXP (op, 0), 0))"))))
 
 (define_constraint "W"
diff --git a/gcc/config/v850/predicates.md b/gcc/config/v850/predicates.md
index f6cbdaabcaf..8fd93638cd7 100644
--- a/gcc/config/v850/predicates.md
+++ b/gcc/config/v850/predicates.md
@@ -87,7 +87,7 @@
   /* Only registers are valid call operands if TARGET_LONG_CALLS.  */
   if (TARGET_LONG_CALLS)
     return REG_P (op);
-  return (GET_CODE (op) == SYMBOL_REF || REG_P (op));
+  return (SYMBOL_REF_P (op) || REG_P (op));
 })
 
 ;; Return true if OP is a valid source operand for SImode move.
@@ -132,7 +132,7 @@
       && satisfies_constraint_K (XEXP (XEXP (op, 0), 1)))
     op = XEXP (XEXP (op, 0), 0);
 
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return (SYMBOL_REF_FLAGS (op)
 	    & (SYMBOL_FLAG_ZDA | SYMBOL_FLAG_TDA | SYMBOL_FLAG_SDA)) != 0;
 
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 9ccc41d7f86..a5a35ec7704 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -407,7 +407,7 @@ v850_print_operand (FILE * file, rtx x, int code)
     {
     case 'c':
       /* We use 'c' operands with symbols for .vtinherit.  */
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
         {
           output_addr_const(file, x);
           break;
@@ -511,7 +511,7 @@ v850_print_operand (FILE * file, rtx x, int code)
       if (GET_CODE (x) == CONST)
 	x = XEXP (XEXP (x, 0), 0);
       else
-	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (x));
       
       if (SYMBOL_REF_ZDA_P (x))
 	fprintf (file, "zdaoff");
@@ -532,7 +532,7 @@ v850_print_operand (FILE * file, rtx x, int code)
       if (GET_CODE (x) == CONST)
 	x = XEXP (XEXP (x, 0), 0);
       else
-	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	gcc_assert (SYMBOL_REF_P (x));
       
       if (SYMBOL_REF_ZDA_P (x))
 	fprintf (file, "r0");
@@ -873,7 +873,7 @@ output_move_single (rtx * operands)
 	return "movea %O1(%P1),%Q1,%0";
 
       else if (LABEL_REF_P (src)
-	       || GET_CODE (src) == SYMBOL_REF
+	       || SYMBOL_REF_P (src)
 	       || GET_CODE (src) == CONST)
 	{
 	  if (TARGET_V850E_UP) 
@@ -1099,7 +1099,7 @@ ep_memory_operand (rtx op, machine_mode mode, int unsigned_load)
 	  if (REG_P (op0) && REGNO (op0) == EP_REGNUM)
 	    return TRUE;
 
-	  if (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_TDA_P (op0))
+	  if (SYMBOL_REF_P (op0) && SYMBOL_REF_TDA_P (op0))
 	    return TRUE;
 	}
       break;
@@ -3023,7 +3023,7 @@ v850_legitimate_constant_p (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
   return (CONST_DOUBLE_P (x)
 	  || !(GET_CODE (x) == CONST
 	       && GET_CODE (XEXP (x, 0)) == PLUS
-	       && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+	       && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	       && CONST_INT_P (XEXP (XEXP (x, 0), 1))
 	       && !CONST_OK_FOR_K (INTVAL (XEXP (XEXP (x, 0), 1)))));
 }
diff --git a/gcc/config/vax/predicates.md b/gcc/config/vax/predicates.md
index 99c21d57d06..253025ebfc5 100644
--- a/gcc/config/vax/predicates.md
+++ b/gcc/config/vax/predicates.md
@@ -28,7 +28,7 @@
 {
   if (LABEL_REF_P (op))
     return 1;
-  if (GET_CODE (op) == SYMBOL_REF)
+  if (SYMBOL_REF_P (op))
     return !flag_pic || SYMBOL_REF_LOCAL_P (op);
   if (LABEL_REF_P (XEXP (XEXP (op, 0), 0)))
     return 1;
@@ -41,7 +41,7 @@
 
 (define_predicate "external_const_operand"
   (and (match_code "const")
-       (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF
+       (match_test "SYMBOL_REF_P (XEXP (XEXP (op, 0), 0))
 		    && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (op, 0), 0))")))
 
 (define_predicate "nonsymbolic_operand"
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 2094e852527..dba330facfc 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -439,7 +439,7 @@ print_operand_address (FILE * file, rtx addr)
       if (reg1)
 	{
 	  if (breg
-	      || (flag_pic && GET_CODE (addr) == SYMBOL_REF)
+	      || (flag_pic && SYMBOL_REF_P (addr))
 	      || (offset
 		  && (MEM_P (offset)
 		      || (flag_pic && symbolic_operand (offset, SImode)))))
@@ -463,7 +463,7 @@ print_operand_address (FILE * file, rtx addr)
 
 #ifdef NO_EXTERNAL_INDIRECT_ADDRESS
 	      if (flag_pic > 1 && GET_CODE (offset) == CONST
-		  && GET_CODE (XEXP (XEXP (offset, 0), 0)) == SYMBOL_REF
+		  && SYMBOL_REF_P (XEXP (XEXP (offset, 0), 0))
 		  && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (offset, 0), 0)))
 		{
 		  debug_rtx (orig);
@@ -1637,14 +1637,14 @@ vax_output_int_subtract (rtx_insn *insn, rtx *operands, machine_mode mode)
 bool
 legitimate_constant_address_p (rtx x)
 {
-  if (LABEL_REF_P (x) || GET_CODE (x) == SYMBOL_REF
+  if (LABEL_REF_P (x) || SYMBOL_REF_P (x)
 	  || CONST_INT_P (x) || GET_CODE (x) == HIGH)
     return true;
   if (GET_CODE (x) != CONST)
     return false;
 #ifdef NO_EXTERNAL_INDIRECT_ADDRESS
   if (flag_pic
-      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
       && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (x, 0), 0)))
     return false;
 #endif
@@ -1671,12 +1671,12 @@ legitimate_constant_address_p (rtx x)
 static bool
 indirectable_constant_address_p (rtx x, bool indirect)
 {
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (SYMBOL_REF_P (x))
     return !flag_pic || SYMBOL_REF_LOCAL_P (x) || !indirect;
 
   if (GET_CODE (x) == CONST)
     return !flag_pic
-	   || GET_CODE (XEXP (XEXP (x, 0), 0)) != SYMBOL_REF
+	   || !SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	   || SYMBOL_REF_LOCAL_P (XEXP (XEXP (x, 0), 0));
 
   return CONSTANT_ADDRESS_P (x);
diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md
index 4017a72e08f..a870fe80d7f 100644
--- a/gcc/config/vax/vax.md
+++ b/gcc/config/vax/vax.md
@@ -142,7 +142,7 @@
 #ifdef NO_EXTERNAL_INDIRECT_ADDRESS
   if (flag_pic
       && GET_CODE (operands[1]) == CONST
-      && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (XEXP (operands[1], 0), 0))
       && !SYMBOL_REF_LOCAL_P (XEXP (XEXP (operands[1], 0), 0)))
     {
       rtx symbol_ref = XEXP (XEXP (operands[1], 0), 0);
diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
index 4d62033d810..617c1a90728 100644
--- a/gcc/config/xtensa/predicates.md
+++ b/gcc/config/xtensa/predicates.md
@@ -100,7 +100,7 @@
 	  tree callee;
 	  const char * callee_sec, * caller_sec;
 
-	  if (GET_CODE (op) != SYMBOL_REF
+	  if (!SYMBOL_REF_P (op)
 	      || !SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_EXTERNAL_P (op))
 	    return false;
 
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 30b27cb629f..84a05e303da 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -570,7 +570,7 @@ constantpool_address_p (const_rtx addr)
       sym = XEXP (addr, 0);
     }
 
-  if ((GET_CODE (sym) == SYMBOL_REF)
+  if ((SYMBOL_REF_P (sym))
       && CONSTANT_POOL_ADDRESS_P (sym))
     return true;
   return false;
@@ -596,7 +596,7 @@ xtensa_tls_symbol_p (rtx x)
   if (! TARGET_HAVE_TLS)
     return false;
 
-  return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
+  return SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0;
 }
 
 
@@ -2023,7 +2023,7 @@ xtensa_tls_referenced_p (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+      if (SYMBOL_REF_P (x) && SYMBOL_REF_TLS_MODEL (x) != 0)
 	return true;
 
       /* Ignore TLS references that have already been legitimized.  */
@@ -2469,7 +2469,7 @@ print_operand (FILE *file, rtx x, int letter)
 	  /* X must be a symbolic constant on ELF.  Write an expression
 	     suitable for 'const16' that sets the high or low 16 bits.  */
 	  if (GET_CODE (XEXP (x, 0)) != PLUS
-	      || (GET_CODE (XEXP (XEXP (x, 0), 0)) != SYMBOL_REF
+	      || (!SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 		  && !LABEL_REF_P (XEXP (XEXP (x, 0), 0)))
 	      || !CONST_INT_P (XEXP (XEXP (x, 0), 1)))
 	    output_operand_lossage ("invalid %%t/%%b value");
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index ccb64520c49..91b4c4895ff 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -624,7 +624,7 @@ typedef struct xtensa_args
    valid address.  This is defined to be the same as 'CONSTANT_P (X)',
    but rejecting CONST_DOUBLE.  */
 #define CONSTANT_ADDRESS_P(X)						\
-  ((LABEL_REF_P (X) || GET_CODE (X) == SYMBOL_REF		\
+  ((LABEL_REF_P (X) || SYMBOL_REF_P (X)		\
     || CONST_INT_P (X) || GET_CODE (X) == HIGH		\
     || (GET_CODE (X) == CONST)))
 
@@ -632,7 +632,7 @@ typedef struct xtensa_args
    operand on the target machine when generating position independent
    code.  */
 #define LEGITIMATE_PIC_OPERAND_P(X)					\
-  ((GET_CODE (X) != SYMBOL_REF						\
+  ((!SYMBOL_REF_P (X)						\
     || (SYMBOL_REF_LOCAL_P (X) && !SYMBOL_REF_EXTERNAL_P (X)))		\
    && !LABEL_REF_P (X)						\
    && GET_CODE (X) != CONST)
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 757ece341e6..9530423c600 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -1607,7 +1607,7 @@
   ""
 {
   rtx addr = XEXP (operands[0], 0);
-  if (flag_pic && GET_CODE (addr) == SYMBOL_REF
+  if (flag_pic && SYMBOL_REF_P (addr)
       && (!SYMBOL_REF_LOCAL_P (addr) || SYMBOL_REF_EXTERNAL_P (addr)))
     addr = gen_sym_PLT (addr);
   if (!call_insn_operand (addr, VOIDmode))
@@ -1632,7 +1632,7 @@
   ""
 {
   rtx addr = XEXP (operands[1], 0);
-  if (flag_pic && GET_CODE (addr) == SYMBOL_REF
+  if (flag_pic && SYMBOL_REF_P (addr)
       && (!SYMBOL_REF_LOCAL_P (addr) || SYMBOL_REF_EXTERNAL_P (addr)))
     addr = gen_sym_PLT (addr);
   if (!call_insn_operand (addr, VOIDmode))
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 3575141d601..27be48d2154 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1474,7 +1474,7 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd,
 	      fprintf (dump_file, "\n");
 	    }
 	  if (GET_CODE (p->loc) == LO_SUM
-	      && GET_CODE (XEXP (p->loc, 1)) == SYMBOL_REF
+	      && SYMBOL_REF_P (XEXP (p->loc, 1))
 	      && p->setting_insn
 	      && (note = find_reg_note (p->setting_insn, REG_EQUAL, NULL_RTX))
 	      && XEXP (note, 0) == XEXP (p->loc, 1))
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index a3cdd4ace85..2ecca9a7d81 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -2740,7 +2740,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
       if (context && DECL_FROM_INLINE (decl))
 	break;
       if (!MEM_P (decl_rtl)
-	  || GET_CODE (XEXP (decl_rtl, 0)) != SYMBOL_REF)
+	  || !SYMBOL_REF_P (XEXP (decl_rtl, 0)))
 	break;
 
       if (flag_debug_only_used_symbols)
@@ -3033,7 +3033,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
      no letter at all, and N_LSYM, for auto variable,
      r and N_RSYM for register variable.  */
 
-  if (MEM_P (home) && GET_CODE (XEXP (home, 0)) == SYMBOL_REF)
+  if (MEM_P (home) && SYMBOL_REF_P (XEXP (home, 0)))
     {
       if (TREE_PUBLIC (decl))
 	{
@@ -3058,13 +3058,13 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
 	     dumped into a constant pool.  Alternatively, the symbol
 	     in the constant pool might be referenced by a different
 	     symbol.  */
-	  if (GET_CODE (addr) == SYMBOL_REF
+	  if (SYMBOL_REF_P (addr)
 	      && CONSTANT_POOL_ADDRESS_P (addr))
 	    {
 	      bool marked;
 	      rtx tmp = get_pool_constant_mark (addr, &marked);
 
-	      if (GET_CODE (tmp) == SYMBOL_REF)
+	      if (SYMBOL_REF_P (tmp))
 		{
 		  addr = tmp;
 		  if (CONSTANT_POOL_ADDRESS_P (addr))
@@ -3339,7 +3339,7 @@ dbxout_common_check (tree decl, int *value)
   sym_addr = XEXP (sym_addr, 0);
   if (GET_CODE (sym_addr) == CONST)
     sym_addr = XEXP (sym_addr, 0);
-  if ((GET_CODE (sym_addr) == SYMBOL_REF || GET_CODE (sym_addr) == PLUS)
+  if ((SYMBOL_REF_P (sym_addr) || GET_CODE (sym_addr) == PLUS)
       && DECL_INITIAL (decl) == 0)
     {
 
diff --git a/gcc/dse.c b/gcc/dse.c
index e76d67b5748..b7511a320da 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2439,7 +2439,7 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn)
       if (!const_call
 	  && (call = get_call_rtx_from (insn))
 	  && (sym = XEXP (XEXP (call, 0), 0))
-	  && GET_CODE (sym) == SYMBOL_REF
+	  && SYMBOL_REF_P (sym)
 	  && SYMBOL_REF_DECL (sym)
 	  && TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL
 	  && fndecl_built_in_p (SYMBOL_REF_DECL (sym), BUILT_IN_MEMSET))
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 488e54b72ec..fc655272ed8 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -912,7 +912,7 @@ dw2_force_const_mem (rtx x, bool is_public)
   if (! indirect_pool)
     indirect_pool = hash_map<const char *, tree>::create_ggc (64);
 
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
 
   key = XSTR (x, 0);
   tree *slot = indirect_pool->get (key);
@@ -1078,13 +1078,13 @@ dw2_asm_output_encoded_addr_rtx (int encoding, rtx addr, bool is_public,
 
 #ifdef ASM_OUTPUT_DWARF_DATAREL
 	case DW_EH_PE_datarel:
-	  gcc_assert (GET_CODE (addr) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (addr));
 	  ASM_OUTPUT_DWARF_DATAREL (asm_out_file, size, XSTR (addr, 0));
 	  break;
 #endif
 
 	case DW_EH_PE_pcrel:
-	  gcc_assert (GET_CODE (addr) == SYMBOL_REF);
+	  gcc_assert (SYMBOL_REF_P (addr));
 #ifdef ASM_OUTPUT_DWARF_PCREL
 	  ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
 #else
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d1fb7bf494d..b2b4f6d82b2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -6925,7 +6925,7 @@ attr_checksum (dw_attr_node *at, struct md5_ctx *ctx, int *mark)
 
     case dw_val_class_addr:
       r = AT_addr (at);
-      gcc_assert (GET_CODE (r) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (r));
       CHECKSUM_STRING (XSTR (r, 0));
       break;
 
@@ -7225,7 +7225,7 @@ attr_checksum_ordered (enum dwarf_tag tag, dw_attr_node *at,
 
     case dw_val_class_addr:
       r = AT_addr (at);
-      gcc_assert (GET_CODE (r) == SYMBOL_REF);
+      gcc_assert (SYMBOL_REF_P (r));
       CHECKSUM_ULEB128 (DW_FORM_string);
       CHECKSUM_STRING (XSTR (r, 0));
       break;
@@ -14503,7 +14503,7 @@ const_ok_for_output_1 (rtx rtl)
 	 rather than DECL_THREAD_LOCAL_P is not just an optimization.  */
       if (flag_checking
 	  && (XVECLEN (rtl, 0) == 0
-	      || GET_CODE (XVECEXP (rtl, 0, 0)) != SYMBOL_REF
+	      || !SYMBOL_REF_P (XVECEXP (rtl, 0, 0))
 	      || SYMBOL_REF_TLS_MODEL (XVECEXP (rtl, 0, 0)) == TLS_MODEL_NONE))
 	inform (current_function_decl
 		? DECL_SOURCE_LOCATION (current_function_decl)
@@ -14619,7 +14619,7 @@ const_ok_for_output_1 (rtx rtl)
 static bool
 const_ok_for_output (rtx rtl)
 {
-  if (GET_CODE (rtl) == SYMBOL_REF)
+  if (SYMBOL_REF_P (rtl))
     return const_ok_for_output_1 (rtl);
 
   if (GET_CODE (rtl) == CONST)
@@ -15755,7 +15755,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
 	  goto symref;
 	}
 
-      if (GET_CODE (rtl) == SYMBOL_REF
+      if (SYMBOL_REF_P (rtl)
 	  && SYMBOL_REF_TLS_MODEL (rtl) != TLS_MODEL_NONE)
 	{
 	  dw_loc_descr_ref temp;
@@ -17453,7 +17453,7 @@ cst_pool_loc_descr (tree loc)
       gcc_assert (!rtl);
       return 0;
     }
-  gcc_assert (GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (XEXP (rtl, 0)));
 
   /* TODO: We might get more coverage if we was actually delaying expansion
      of all expressions till end of compilation when constant pools are fully
@@ -20063,7 +20063,7 @@ rtl_for_decl_location (tree decl)
     {
       rtl = make_decl_rtl_for_debug (decl);
       if (!MEM_P (rtl)
-	  || GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
+	  || !SYMBOL_REF_P (XEXP (rtl, 0))
 	  || SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
 	rtl = NULL_RTX;
     }
@@ -21798,7 +21798,7 @@ decl_start_label (tree decl)
   gcc_assert (MEM_P (x));
 
   x = XEXP (x, 0);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
 
   fnname = XSTR (x, 0);
   return fnname;
@@ -23816,7 +23816,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
 	      if (single_element_loc_list_p (loc)
                   && loc->expr->dw_loc_opc == DW_OP_addr
 		  && loc->expr->dw_loc_next == NULL
-		  && GET_CODE (loc->expr->dw_loc_oprnd1.v.val_addr) == SYMBOL_REF)
+		  && SYMBOL_REF_P (loc->expr->dw_loc_oprnd1.v.val_addr))
 		{
 		  rtx x = loc->expr->dw_loc_oprnd1.v.val_addr;
 		  loc->expr->dw_loc_oprnd1.v.val_addr
@@ -27334,7 +27334,7 @@ dwarf2out_var_location (rtx_insn *loc_note)
 	      if (GET_CODE (x) == CALL)
 		x = XEXP (x, 0);
 	      if (!MEM_P (x)
-		  || GET_CODE (XEXP (x, 0)) != SYMBOL_REF
+		  || !SYMBOL_REF_P (XEXP (x, 0))
 		  || !SYMBOL_REF_DECL (XEXP (x, 0))
 		  || (TREE_CODE (SYMBOL_REF_DECL (XEXP (x, 0)))
 		      != FUNCTION_DECL))
@@ -27512,7 +27512,7 @@ create_label:
 	  if (MEM_P (XEXP (x, 0)))
 	    x = XEXP (x, 0);
 	  /* First, look for a memory access to a symbol_ref.  */
-	  if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+	  if (SYMBOL_REF_P (XEXP (x, 0))
 	      && SYMBOL_REF_DECL (XEXP (x, 0))
 	      && TREE_CODE (SYMBOL_REF_DECL (XEXP (x, 0))) == FUNCTION_DECL)
 	    ca_loc->symbol_ref = XEXP (x, 0);
@@ -29866,7 +29866,7 @@ resolve_one_addr (rtx *addr)
       if (!rtl || !MEM_P (rtl))
 	return false;
       rtl = XEXP (rtl, 0);
-      if (GET_CODE (rtl) == SYMBOL_REF
+      if (SYMBOL_REF_P (rtl)
 	  && SYMBOL_REF_DECL (rtl)
 	  && !TREE_ASM_WRITTEN (SYMBOL_REF_DECL (rtl)))
 	return false;
@@ -29875,7 +29875,7 @@ resolve_one_addr (rtx *addr)
       return true;
     }
 
-  if (GET_CODE (rtl) == SYMBOL_REF
+  if (SYMBOL_REF_P (rtl)
       && SYMBOL_REF_DECL (rtl))
     {
       if (TREE_CONSTANT_POOL_ADDRESS_P (rtl))
@@ -29915,7 +29915,7 @@ string_cst_pool_decl (tree t)
   if (!rtl || !MEM_P (rtl))
     return NULL_RTX;
   rtl = XEXP (rtl, 0);
-  if (GET_CODE (rtl) != SYMBOL_REF
+  if (!SYMBOL_REF_P (rtl)
       || SYMBOL_REF_DECL (rtl) == NULL_TREE)
     return NULL_RTX;
 
@@ -29972,7 +29972,7 @@ optimize_one_addr_into_implicit_ptr (dw_loc_descr_ref loc)
       if (!rtl)
 	return false;
     }
-  if (GET_CODE (rtl) == SYMBOL_REF && SYMBOL_REF_DECL (rtl))
+  if (SYMBOL_REF_P (rtl) && SYMBOL_REF_DECL (rtl))
     {
       decl = SYMBOL_REF_DECL (rtl);
       if (VAR_P (decl) && !DECL_EXTERNAL (decl))
@@ -30596,7 +30596,7 @@ resolve_addr (dw_die_ref die)
 	      if (l != NULL
 		  && l->dw_loc_next == NULL
 		  && l->dw_loc_opc == DW_OP_addr
-		  && GET_CODE (l->dw_loc_oprnd1.v.val_addr) == SYMBOL_REF
+		  && SYMBOL_REF_P (l->dw_loc_oprnd1.v.val_addr)
 		  && SYMBOL_REF_DECL (l->dw_loc_oprnd1.v.val_addr)
 		  && a->dw_attr == DW_AT_location)
 		{
diff --git a/gcc/explow.c b/gcc/explow.c
index bc813d07f2e..441847d02ba 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -117,7 +117,7 @@ plus_constant (machine_mode mode, rtx x, poly_int64 c, bool inplace)
       /* If this is a reference to the constant pool, try replacing it with
 	 a reference to a new constant.  If the resulting address isn't
 	 valid, don't return it because we have no way to validize it.  */
-      if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      if (SYMBOL_REF_P (XEXP (x, 0))
 	  && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
 	{
 	  rtx cst = get_pool_constant (XEXP (x, 0));
@@ -197,7 +197,7 @@ plus_constant (machine_mode mode, rtx x, poly_int64 c, bool inplace)
   if (maybe_ne (c, 0))
     x = gen_rtx_PLUS (mode, x, gen_int_mode (c, mode));
 
-  if (GET_CODE (x) == SYMBOL_REF || LABEL_REF_P (x))
+  if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
     return x;
   else if (all_constant)
     return gen_rtx_CONST (mode, x);
@@ -558,7 +558,7 @@ use_anchored_address (rtx x)
     }
 
   /* Check whether BASE is suitable for anchors.  */
-  if (GET_CODE (base) != SYMBOL_REF
+  if (!SYMBOL_REF_P (base)
       || !SYMBOL_REF_HAS_BLOCK_INFO_P (base)
       || SYMBOL_REF_ANCHOR_P (base)
       || SYMBOL_REF_BLOCK (base) == NULL
@@ -680,7 +680,7 @@ force_reg (machine_mode mode, rtx x)
      known alignment of that pointer.  */
   {
     unsigned align = 0;
-    if (GET_CODE (x) == SYMBOL_REF)
+    if (SYMBOL_REF_P (x))
       {
         align = BITS_PER_UNIT;
 	if (SYMBOL_REF_DECL (x) && DECL_P (SYMBOL_REF_DECL (x)))
@@ -690,7 +690,7 @@ force_reg (machine_mode mode, rtx x)
       align = BITS_PER_UNIT;
     else if (GET_CODE (x) == CONST
 	     && GET_CODE (XEXP (x, 0)) == PLUS
-	     && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+	     && SYMBOL_REF_P (XEXP (XEXP (x, 0), 0))
 	     && CONST_INT_P (XEXP (XEXP (x, 0), 1)))
       {
 	rtx s = XEXP (XEXP (x, 0), 0);
diff --git a/gcc/expr.c b/gcc/expr.c
index bffd3ca50df..e22b02b8868 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3255,7 +3255,7 @@ read_complex_part (rtx cplx, bool imag_p)
   ibitsize = GET_MODE_BITSIZE (imode);
 
   /* Special case reads from complex constants that got spilled to memory.  */
-  if (MEM_P (cplx) && GET_CODE (XEXP (cplx, 0)) == SYMBOL_REF)
+  if (MEM_P (cplx) && SYMBOL_REF_P (XEXP (cplx, 0)))
     {
       tree decl = SYMBOL_REF_DECL (XEXP (cplx, 0));
       if (decl && TREE_CODE (decl) == COMPLEX_CST)
@@ -7448,7 +7448,7 @@ force_operand (rtx value, rtx target)
   /* Check for a PIC address load.  */
   if ((code == PLUS || code == MINUS)
       && XEXP (value, 0) == pic_offset_table_rtx
-      && (GET_CODE (XEXP (value, 1)) == SYMBOL_REF
+      && (SYMBOL_REF_P (XEXP (value, 1))
 	  || LABEL_REF_P (XEXP (value, 1))
 	  || GET_CODE (XEXP (value, 1)) == CONST))
     {
diff --git a/gcc/final.c b/gcc/final.c
index a93acb29539..ec396230a3a 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1611,7 +1611,7 @@ get_some_local_dynamic_name ()
       FOR_EACH_SUBRTX (iter, array, PATTERN (insn), ALL)
 	{
 	  const_rtx x = *iter;
-	  if (GET_CODE (x) == SYMBOL_REF)
+	  if (SYMBOL_REF_P (x))
 	    {
 	      if (SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
 		return some_local_dynamic_name = XSTR (x, 0);
@@ -3093,7 +3093,7 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
 	  {
 	    rtx x = call_from_call_insn (call_insn);
 	    x = XEXP (x, 0);
-	    if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+	    if (x && MEM_P (x) && SYMBOL_REF_P (XEXP (x, 0)))
 	      {
 		tree t;
 		x = XEXP (x, 0);
@@ -4024,7 +4024,7 @@ mark_symbol_refs_as_used (rtx x)
   FOR_EACH_SUBRTX (iter, array, x, ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	if (tree t = SYMBOL_REF_DECL (x))
 	  assemble_external (t);
     }
@@ -4183,7 +4183,7 @@ output_addr_const (FILE *file, rtx x)
       fprintf (file, "-");
       if ((CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) >= 0)
 	  || GET_CODE (XEXP (x, 1)) == PC
-	  || GET_CODE (XEXP (x, 1)) == SYMBOL_REF)
+	  || SYMBOL_REF_P (XEXP (x, 1)))
 	output_addr_const (file, XEXP (x, 1));
       else
 	{
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 43a0e29eaf7..357f8a2ddb2 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1735,7 +1735,7 @@ prune_expressions (bool pre_p)
 		 of the tables.  */
 	      if (MEM_P (x))
 		{
-		  if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+		  if (SYMBOL_REF_P (XEXP (x, 0))
 		      && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
 		    continue;
 
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 68aa1723073..912d6b4f594 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -813,8 +813,8 @@ check_attr_test (file_location loc, rtx exp, attr_desc *attr)
     case LE:  case LT:  case GT:  case GE:
     case LEU: case LTU: case GTU: case GEU:
     case NE:  case EQ:
-      if (GET_CODE (XEXP (exp, 0)) == SYMBOL_REF
-	  && GET_CODE (XEXP (exp, 1)) == SYMBOL_REF)
+      if (SYMBOL_REF_P (XEXP (exp, 0))
+	  && SYMBOL_REF_P (XEXP (exp, 1)))
 	exp = attr_rtx (GET_CODE (exp),
 			attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 0), 0)),
 			attr_rtx (SYMBOL_REF, XSTR (XEXP (exp, 1), 0)));
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 7a371a43bd9..a62b1265599 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2630,7 +2630,7 @@ noce_try_abs (struct noce_if_info *if_info)
 	return FALSE;
     }
   if (MEM_P (c)
-      && GET_CODE (XEXP (c, 0)) == SYMBOL_REF
+      && SYMBOL_REF_P (XEXP (c, 0))
       && CONSTANT_POOL_ADDRESS_P (XEXP (c, 0)))
     c = get_pool_constant (XEXP (c, 0));
 
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index dcc6044e7a2..54a8f78cd7b 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -307,7 +307,7 @@ simple_move_operand (rtx x)
     return false;
 
   if (LABEL_REF_P (x)
-      || GET_CODE (x) == SYMBOL_REF
+      || SYMBOL_REF_P (x)
       || GET_CODE (x) == HIGH
       || GET_CODE (x) == CONST)
     return false;
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 9692ded0f38..77a58bdde2c 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5276,7 +5276,7 @@ debug_optab_libfuncs (void)
 	rtx l = optab_libfunc ((optab) i, (machine_mode) j);
 	if (l)
 	  {
-	    gcc_assert (GET_CODE (l) == SYMBOL_REF);
+	    gcc_assert (SYMBOL_REF_P (l));
 	    fprintf (stderr, "%s\t%s:\t%s\n",
 		     GET_RTX_NAME (optab_to_code ((optab) i)),
 		     GET_MODE_NAME (j),
@@ -5293,7 +5293,7 @@ debug_optab_libfuncs (void)
 					 (machine_mode) k);
 	  if (l)
 	    {
-	      gcc_assert (GET_CODE (l) == SYMBOL_REF);
+	      gcc_assert (SYMBOL_REF_P (l));
 	      fprintf (stderr, "%s\t%s\t%s:\t%s\n",
 		       GET_RTX_NAME (optab_to_code ((optab) i)),
 		       GET_MODE_NAME (j),
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 8f2c3448eb4..f1951b305ff 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -2053,16 +2053,16 @@ reload_cse_move2add (rtx_insn *first)
 	     (set (REGX) (CONST (PLUS (SYMBOL_REF) (CONST_INT A))))
 	     ...
 	     (set (REGY) (CONST (PLUS (REGX) (CONST_INT B-A))))  */
-	  if ((GET_CODE (src) == SYMBOL_REF
+	  if ((SYMBOL_REF_P (src)
 	       || (GET_CODE (src) == CONST
 		   && GET_CODE (XEXP (src, 0)) == PLUS
-		   && GET_CODE (XEXP (XEXP (src, 0), 0)) == SYMBOL_REF
+		   && SYMBOL_REF_P (XEXP (XEXP (src, 0), 0))
 		   && CONST_INT_P (XEXP (XEXP (src, 0), 1))))
 	      && dbg_cnt (cse2_move2add))
 	    {
 	      rtx sym, off;
 
-	      if (GET_CODE (src) == SYMBOL_REF)
+	      if (SYMBOL_REF_P (src))
 		{
 		  sym = src;
 		  off = const0_rtx;
@@ -2204,14 +2204,14 @@ move2add_note_store (rtx dst, const_rtx set, void *data)
       rtx off;
 
       note = find_reg_equal_equiv_note (insn);
-      if (note && GET_CODE (XEXP (note, 0)) == SYMBOL_REF)
+      if (note && SYMBOL_REF_P (XEXP (note, 0)))
 	{
 	  sym = XEXP (note, 0);
 	  off = const0_rtx;
 	}
       else if (note && GET_CODE (XEXP (note, 0)) == CONST
 	       && GET_CODE (XEXP (XEXP (note, 0), 0)) == PLUS
-	       && GET_CODE (XEXP (XEXP (XEXP (note, 0), 0), 0)) == SYMBOL_REF
+	       && SYMBOL_REF_P (XEXP (XEXP (XEXP (note, 0), 0), 0))
 	       && CONST_INT_P (XEXP (XEXP (XEXP (note, 0), 0), 1)))
 	{
 	  sym = XEXP (XEXP (XEXP (note, 0), 0), 0);
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 849e22726d7..53212ce878f 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -215,7 +215,7 @@ rtx_writer::print_rtx_operand_code_0 (const_rtx in_rtx ATTRIBUTE_UNUSED,
 				      int idx ATTRIBUTE_UNUSED)
 {
 #ifndef GENERATOR_FILE
-  if (idx == 1 && GET_CODE (in_rtx) == SYMBOL_REF)
+  if (idx == 1 && SYMBOL_REF_P (in_rtx))
     {
       int flags = SYMBOL_REF_FLAGS (in_rtx);
       if (flags)
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index ce65873b0f6..a3d16005d91 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -1144,20 +1144,20 @@ reg_scan_mark_refs (rtx x, rtx_insn *insn)
 		  && REG_P (XEXP (SET_SRC (x), 0))
 		  && REG_POINTER (XEXP (SET_SRC (x), 0)))
 	      || GET_CODE (SET_SRC (x)) == CONST
-	      || GET_CODE (SET_SRC (x)) == SYMBOL_REF
+	      || SYMBOL_REF_P (SET_SRC (x))
 	      || LABEL_REF_P (SET_SRC (x))
 	      || (GET_CODE (SET_SRC (x)) == HIGH
 		  && (GET_CODE (XEXP (SET_SRC (x), 0)) == CONST
-		      || GET_CODE (XEXP (SET_SRC (x), 0)) == SYMBOL_REF
+		      || SYMBOL_REF_P (XEXP (SET_SRC (x), 0))
 		      || LABEL_REF_P (XEXP (SET_SRC (x), 0))))
 	      || ((GET_CODE (SET_SRC (x)) == PLUS
 		   || GET_CODE (SET_SRC (x)) == LO_SUM)
 		  && (GET_CODE (XEXP (SET_SRC (x), 1)) == CONST
-		      || GET_CODE (XEXP (SET_SRC (x), 1)) == SYMBOL_REF
+		      || SYMBOL_REF_P (XEXP (SET_SRC (x), 1))
 		      || LABEL_REF_P (XEXP (SET_SRC (x), 1))))
 	      || ((note = find_reg_note (insn, REG_EQUAL, 0)) != 0
 		  && (GET_CODE (XEXP (note, 0)) == CONST
-		      || GET_CODE (XEXP (note, 0)) == SYMBOL_REF
+		      || SYMBOL_REF_P (XEXP (note, 0))
 		      || LABEL_REF_P (XEXP (note, 0))))))
 	REG_POINTER (SET_DEST (x)) = 1;
 
diff --git a/gcc/reload.c b/gcc/reload.c
index a9efe22d965..52233eb55e1 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5035,7 +5035,7 @@ find_reloads_address (machine_mode mode, rtx *memrefloc, rtx ad,
 	 taken care of above.  */
 
       if (ind_levels == 0
-	  || (GET_CODE (XEXP (tem, 0)) == SYMBOL_REF && ! indirect_symref_ok)
+	  || (SYMBOL_REF_P (XEXP (tem, 0)) && ! indirect_symref_ok)
 	  || MEM_P (XEXP (tem, 0))
 	  || ! (REG_P (XEXP (tem, 0))
 		|| (GET_CODE (XEXP (tem, 0)) == PLUS
@@ -5229,7 +5229,7 @@ find_reloads_address (machine_mode mode, rtx *memrefloc, rtx ad,
 
       /* If AD is an address in the constant pool, the MEM rtx may be shared.
 	 Unshare it so we can safely alter it.  */
-      if (memrefloc && GET_CODE (ad) == SYMBOL_REF
+      if (memrefloc && SYMBOL_REF_P (ad)
 	  && CONSTANT_POOL_ADDRESS_P (ad))
 	{
 	  *memrefloc = copy_rtx (*memrefloc);
diff --git a/gcc/rtl.c b/gcc/rtl.c
index d7b8e9877c3..3a678e46236 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -205,7 +205,7 @@ rtx_size (const_rtx x)
     return (RTX_HDR_SIZE
 	    + sizeof (struct const_poly_int_def)
 	    + CONST_POLY_INT_COEFFS (x).extra_size ());
-  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_HAS_BLOCK_INFO_P (x))
+  if (SYMBOL_REF_P (x) && SYMBOL_REF_HAS_BLOCK_INFO_P (x))
     return RTX_HDR_SIZE + sizeof (struct block_symbol);
   return RTX_CODE_SIZE (GET_CODE (x));
 }
@@ -272,7 +272,7 @@ shared_const_p (const_rtx orig)
      a LABEL_REF, it isn't sharable.  */
   poly_int64 offset;
   return (GET_CODE (XEXP (orig, 0)) == PLUS
-	  && GET_CODE (XEXP (XEXP (orig, 0), 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (XEXP (orig, 0), 0))
 	  && poly_int_rtx_p (XEXP (XEXP (orig, 0), 1), &offset));
 }
 
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index a8becc85047..adb0929a1aa 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -871,7 +871,7 @@ offset_within_block_p (const_rtx symbol, HOST_WIDE_INT offset)
 {
   tree decl;
 
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return false;
 
   if (offset == 0)
@@ -3177,7 +3177,7 @@ replace_label (rtx *loc, rtx old_label, rtx new_label, bool update_label_nuses)
       rtx *loc = *iter;
       if (rtx x = *loc)
 	{
-	  if (GET_CODE (x) == SYMBOL_REF
+	  if (SYMBOL_REF_P (x)
 	      && CONSTANT_POOL_ADDRESS_P (x))
 	    {
 	      rtx c = get_pool_constant (x);
@@ -3239,7 +3239,7 @@ rtx_referenced_p (const_rtx x, const_rtx body)
 	  return true;
 
 	/* If Y is a reference to pool constant traverse the constant.  */
-	if (GET_CODE (y) == SYMBOL_REF
+	if (SYMBOL_REF_P (y)
 	    && CONSTANT_POOL_ADDRESS_P (y))
 	  iter.substitute (get_pool_constant (y));
       }
@@ -3296,7 +3296,7 @@ computed_jump_p_1 (const_rtx x)
       return 1;
 
     case MEM:
-      return ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+      return ! (SYMBOL_REF_P (XEXP (x, 0))
 		&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
 
     case IF_THEN_ELSE:
@@ -6596,7 +6596,7 @@ tls_referenced_p (const_rtx x)
 
   subrtx_iterator::array_type array;
   FOR_EACH_SUBRTX (iter, array, x, ALL)
-    if (GET_CODE (*iter) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*iter) != 0)
+    if (SYMBOL_REF_P (*iter) && SYMBOL_REF_TLS_MODEL (*iter) != 0)
       return true;
   return false;
 }
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 247c3dbbe3f..2d5073dd79a 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -3569,7 +3569,7 @@ call_may_noreturn_p (rtx_insn *insn)
     return false;
 
   call = get_call_rtx_from (insn);
-  if (call && GET_CODE (XEXP (XEXP (call, 0), 0)) == SYMBOL_REF)
+  if (call && SYMBOL_REF_P (XEXP (XEXP (call, 0), 0)))
     {
       rtx symbol = XEXP (XEXP (call, 0), 0);
       if (SYMBOL_REF_DECL (symbol)
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 98f2fe112f1..2d3ec52bd93 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -247,7 +247,7 @@ avoid_constant_pool_reference (rtx x)
 
   /* If this is a constant pool reference, we can turn it into its
      constant and hope that simplifications happen.  */
-  if (GET_CODE (addr) == SYMBOL_REF
+  if (SYMBOL_REF_P (addr)
       && CONSTANT_POOL_ADDRESS_P (addr))
     {
       c = get_pool_constant (addr);
@@ -2262,12 +2262,12 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	 than HOST_BITS_PER_WIDE_INT.  */
 
       if ((GET_CODE (op0) == CONST
-	   || GET_CODE (op0) == SYMBOL_REF
+	   || SYMBOL_REF_P (op0)
 	   || LABEL_REF_P (op0))
 	  && poly_int_rtx_p (op1, &offset))
 	return plus_constant (mode, op0, offset);
       else if ((GET_CODE (op1) == CONST
-		|| GET_CODE (op1) == SYMBOL_REF
+		|| SYMBOL_REF_P (op1)
 		|| LABEL_REF_P (op1))
 	       && poly_int_rtx_p (op0, &offset))
 	return plus_constant (mode, op1, offset);
@@ -2541,7 +2541,7 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
 	}
 
       if ((GET_CODE (op0) == CONST
-	   || GET_CODE (op0) == SYMBOL_REF
+	   || SYMBOL_REF_P (op0)
 	   || LABEL_REF_P (op0))
 	  && poly_int_rtx_p (op1, &offset))
 	return plus_constant (mode, op0, trunc_int_for_mode (-offset, mode));
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 63e2820eb93..dbd2221db27 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -1377,7 +1377,7 @@ symtab_node::make_decl_local (void)
     return;
 
   symbol = XEXP (rtl, 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return;
 
   SYMBOL_REF_WEAK (symbol) = DECL_WEAK (decl);
@@ -1432,7 +1432,7 @@ symtab_node::copy_visibility_from (symtab_node *n)
     return;
 
   rtx symbol = XEXP (rtl, 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return;
 
   SYMBOL_REF_WEAK (symbol) = DECL_WEAK (decl);
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 49bd7661fe3..8432a98bd47 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -150,7 +150,7 @@ gen_addr_rtx (machine_mode address_mode,
 	  if (offset_p)
 	    *offset_p = &XEXP (act_elem, 1);
 
-	  if (GET_CODE (symbol) == SYMBOL_REF
+	  if (SYMBOL_REF_P (symbol)
 	      || LABEL_REF_P (symbol)
 	      || GET_CODE (symbol) == CONST)
 	    act_elem = gen_rtx_CONST (address_mode, act_elem);
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index e0ee278e044..d978e62cf1a 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -5932,12 +5932,12 @@ reverse_op (rtx val, const_rtx expr, rtx_insn *insn)
       if (GET_MODE (v->val_rtx) != GET_MODE (val))
 	return;
       arg = XEXP (src, 1);
-      if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)
+      if (!CONST_INT_P (arg) && !SYMBOL_REF_P (arg))
 	{
 	  arg = cselib_expand_value_rtx (arg, scratch_regs, 5);
 	  if (arg == NULL_RTX)
 	    return;
-	  if (!CONST_INT_P (arg) && GET_CODE (arg) != SYMBOL_REF)
+	  if (!CONST_INT_P (arg) && !SYMBOL_REF_P (arg))
 	    return;
 	}
       ret = simplify_gen_binary (code, GET_MODE (val), val, arg);
@@ -6254,7 +6254,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
   call = get_call_rtx_from (insn);
   if (call)
     {
-      if (GET_CODE (XEXP (XEXP (call, 0), 0)) == SYMBOL_REF)
+      if (SYMBOL_REF_P (XEXP (XEXP (call, 0), 0)))
 	{
 	  rtx symbol = XEXP (XEXP (call, 0), 0);
 	  if (SYMBOL_REF_DECL (symbol))
@@ -6475,7 +6475,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
 		    gcc_assert (GET_CODE (item) == VALUE);
 		    val = CSELIB_VAL_PTR (item);
 		    for (l = val->locs; l; l = l->next)
-		      if (GET_CODE (l->loc) == SYMBOL_REF
+		      if (SYMBOL_REF_P (l->loc)
 			  && TREE_CONSTANT_POOL_ADDRESS_P (l->loc)
 			  && SYMBOL_REF_DECL (l->loc)
 			  && DECL_INITIAL (SYMBOL_REF_DECL (l->loc)))
@@ -6536,7 +6536,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
   if (x)
     {
       x = XEXP (XEXP (x, 0), 0);
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	/* Don't record anything.  */;
       else if (CONSTANT_P (x))
 	{
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 5d69da0df96..036d8e455f2 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1372,7 +1372,7 @@ make_decl_rtl (tree decl)
       /* If the symbol has a SYMBOL_REF_BLOCK field, update it based
 	 on the new decl information.  */
       if (MEM_P (x)
-	  && GET_CODE (XEXP (x, 0)) == SYMBOL_REF
+	  && SYMBOL_REF_P (XEXP (x, 0))
 	  && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (x, 0)))
 	change_symbol_block (XEXP (x, 0), get_block_for_decl (decl));
 
@@ -1720,7 +1720,7 @@ get_fnname_from_decl (tree decl)
   rtx x = DECL_RTL (decl);
   gcc_assert (MEM_P (x));
   x = XEXP (x, 0);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (x));
   return XSTR (x, 0);
 }
 
@@ -2247,7 +2247,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
     }
 
   gcc_assert (MEM_P (decl_rtl));
-  gcc_assert (GET_CODE (XEXP (decl_rtl, 0)) == SYMBOL_REF);
+  gcc_assert (SYMBOL_REF_P (XEXP (decl_rtl, 0)));
   symbol = XEXP (decl_rtl, 0);
 
   /* If this symbol belongs to the tree constant pool, output the constant
@@ -2433,7 +2433,7 @@ assemble_external_real (tree decl)
 {
   rtx rtl = DECL_RTL (decl);
 
-  if (MEM_P (rtl) && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
+  if (MEM_P (rtl) && SYMBOL_REF_P (XEXP (rtl, 0))
       && !SYMBOL_REF_USED (XEXP (rtl, 0))
       && !incorporeal_function_p (decl))
     {
@@ -4130,7 +4130,7 @@ mark_constants_in_pattern (rtx insn)
   FOR_EACH_SUBRTX (iter, array, PATTERN (insn), ALL)
     {
       const_rtx x = *iter;
-      if (GET_CODE (x) == SYMBOL_REF)
+      if (SYMBOL_REF_P (x))
 	{
 	  if (CONSTANT_POOL_ADDRESS_P (x))
 	    {
@@ -5568,7 +5568,7 @@ mark_weak (tree decl)
   if (DECL_RTL_SET_P (decl)
       && MEM_P (DECL_RTL (decl))
       && XEXP (DECL_RTL (decl), 0)
-      && GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF)
+      && SYMBOL_REF_P (XEXP (DECL_RTL (decl), 0)))
     SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = 1;
 }
 
@@ -6968,7 +6968,7 @@ default_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
   if (!MEM_P (rtl))
     return;
   symbol = XEXP (rtl, 0);
-  if (GET_CODE (symbol) != SYMBOL_REF)
+  if (!SYMBOL_REF_P (symbol))
     return;
 
   flags = SYMBOL_REF_FLAGS (symbol) & SYMBOL_FLAG_HAS_BLOCK_INFO;
@@ -7494,7 +7494,7 @@ place_block_symbol (rtx symbol)
 	  rtx target = DECL_RTL (snode->ultimate_alias_target ()->decl);
 
 	  gcc_assert (MEM_P (target)
-		      && GET_CODE (XEXP (target, 0)) == SYMBOL_REF
+		      && SYMBOL_REF_P (XEXP (target, 0))
 		      && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (target, 0)));
 	  target = XEXP (target, 0);
 	  place_block_symbol (target);
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index d8a031268ff..0ab9e5d09c2 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3.  If not see
 									\
       /* If we are writing a function name, we must ensure that		\
 	 there is no storage-class suffix on the name.  */		\
-      if (CODE == N_FUN && GET_CODE (ADDR) == SYMBOL_REF)		\
+      if (CODE == N_FUN && SYMBOL_REF_P (ADDR))		\
 	{								\
 	  const char *_p = XSTR (ADDR, 0);				\
 	  if (*_p == '*')						\
-- 
2.21.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]