diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3fe07d9711b75917281a5d443c4a4e540697590b..5a1cac41124434024dbb2ffc33309f2f4b3af7e1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,24 @@
+2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+	* call.c (build_new_method_call_1): Use INDIRECT_REF_P.
+	* cvt.c (convert_to_void): Likewise.
+	* error.c (dump_expr): Likewise.
+	* mangle.c (write_expression): Likewise.
+	* parser.c (cp_parser_template_argument): Likewise.
+	* pt.c (convert_nontype_argument): Likewise.
+	(tsubst_copy_and_build): Likewise.
+	* rtti.c (build_typeid): Likewise.
+	* semantics.c (finish_call_expr): Likewise.
+	(finish_decltype_type): Likewise.
+	(build_data_member_initialization): Likewise.
+	* tree.c (is_dummy_object): Likewise.
+	* typeck.c (decay_conversion): Likewise.
+	(build_class_member_access_expr): Likewise.
+	(cp_build_addr_expr_1): Likewise.
+	(unary_complex_lvalue): Likewise.
+	(check_return_expr): Likewise.
+	* typeck2.c (cxx_readonly_error): Likewise.
+
 2013-03-26  Jason Merrill  <jason@redhat.com>
 
 	PR c++/52597
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index dd19e48ed18d77a82e7c9c37b26de36fad14a23a..67d8b816ead992374e589a59f449522a9f68677a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7730,7 +7730,7 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
 	  cast_to_void = true;
 	  call = TREE_OPERAND (call, 0);
 	}
-      if (TREE_CODE (call) == INDIRECT_REF)
+      if (INDIRECT_REF_P (call))
 	call = TREE_OPERAND (call, 0);
       call = (build_min_non_dep_call_vec
 	      (call,
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 348e6082ceb452a7b9869db0c9b78f6b485013bd..2cb858b91e0724fd26d09b23d26b5888a55ce34b 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -916,7 +916,7 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
 	exprv = TREE_OPERAND (exprv, 1);
       if (DECL_P (exprv)
 	  || handled_component_p (exprv)
-	  || TREE_CODE (exprv) == INDIRECT_REF)
+	  || INDIRECT_REF_P (exprv))
 	/* Expr is not being 'used' here, otherwise we whould have
 	   called mark_{rl}value_use use here, which would have in turn
 	   called mark_exp_read.  Rather, we call mark_exp_read directly
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index bcb0274c1b61826d0d044b1a3f783c5768bba910..15746504b4d3f8722d614843019f55769f9891a7 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1988,7 +1988,7 @@ dump_expr (tree t, int flags)
     case COMPONENT_REF:
       {
 	tree ob = TREE_OPERAND (t, 0);
-	if (TREE_CODE (ob) == INDIRECT_REF)
+	if (INDIRECT_REF_P (ob))
 	  {
 	    ob = TREE_OPERAND (ob, 0);
 	    if (TREE_CODE (ob) != PARM_DECL
@@ -2243,7 +2243,7 @@ dump_expr (tree t, int flags)
 	  }
 	else
 	  {
-	    if (TREE_CODE (ob) == INDIRECT_REF)
+	    if (INDIRECT_REF_P (ob))
 	      {
 		dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
 		pp_cxx_arrow (cxx_pp);
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 603f7019a702a9cd0b4552944b4924fd578d0aed..a672d4e3c233fa77e4f6e1d37987b5e9488f1e9d 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2691,7 +2691,7 @@ write_expression (tree expr)
 	  write_member_name (member);
 	}
     }
-  else if (TREE_CODE (expr) == INDIRECT_REF
+  else if (INDIRECT_REF_P (expr)
 	   && TREE_TYPE (TREE_OPERAND (expr, 0))
 	   && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
     {
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7ac90df167116e10d3fde84021b8f7053bf699ad..9ba0998f221f259cd480f24afe3483e183a0e525 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -13274,7 +13274,7 @@ cp_parser_template_argument (cp_parser* parser)
 	{
 	  tree probe;
 
-	  if (TREE_CODE (argument) == INDIRECT_REF)
+	  if (INDIRECT_REF_P (argument))
 	    {
 	      gcc_assert (REFERENCE_REF_P (argument));
 	      argument = TREE_OPERAND (argument, 0);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bb690c5009ff97bcb744d8176474ba3fa0fcb9fd..393dbc9412bf7c372643cd6fd719f0aba91a9a27 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5735,7 +5735,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
 	 shall be one of: [...]
 
 	 -- the address of an object or function with external linkage.  */
-      if (TREE_CODE (expr) == INDIRECT_REF
+      if (INDIRECT_REF_P (expr)
 	  && TYPE_REF_OBJ_P (TREE_TYPE (TREE_OPERAND (expr, 0))))
 	{
 	  expr = TREE_OPERAND (expr, 0);
@@ -14013,7 +14013,7 @@ tsubst_copy_and_build (tree t,
 		if (unq != function)
 		  {
 		    tree fn = unq;
-		    if (TREE_CODE (fn) == INDIRECT_REF)
+		    if (INDIRECT_REF_P (fn))
 		      fn = TREE_OPERAND (fn, 0);
 		    if (TREE_CODE (fn) == COMPONENT_REF)
 		      fn = TREE_OPERAND (fn, 1);
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 6c02c1cf0dac2c993627dd4ab3ecad315cfe0739..dd22e34197bb0c2b7c9f5a97c2b6cd1b3f5674d4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -326,7 +326,7 @@ build_typeid (tree exp, tsubst_flags_t complain)
 
   /* FIXME when integrating with c_fully_fold, mark
      resolves_to_fixed_type_p case as a non-constant expression.  */
-  if (TREE_CODE (exp) == INDIRECT_REF
+  if (INDIRECT_REF_P (exp)
       && TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE
       && TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
       && ! resolves_to_fixed_type_p (exp, &nonnull)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index e8fc778dd2ec36325fefa92144b60b6764e99e85..fd77725c254e262f2f1a48d12f772b9fa9d23ba4 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2236,7 +2236,7 @@ finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
 
   if (processing_template_decl && result != error_mark_node)
     {
-      if (TREE_CODE (result) == INDIRECT_REF)
+      if (INDIRECT_REF_P (result))
 	result = TREE_OPERAND (result, 0);
       result = build_call_vec (TREE_TYPE (result), orig_fn, orig_args);
       SET_EXPR_LOCATION (result, input_location);
@@ -5301,7 +5301,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
       if (identifier_p (expr))
         expr = lookup_name (expr);
 
-      if (TREE_CODE (expr) == INDIRECT_REF)
+      if (INDIRECT_REF_P (expr))
         /* This can happen when the expression is, e.g., "a.b". Just
            look at the underlying operand.  */
         expr = TREE_OPERAND (expr, 0);
@@ -5948,7 +5948,7 @@ build_data_member_initialization (tree t, vec<constructor_elt, va_gc> **vec)
     return true;
   else
     gcc_unreachable ();
-  if (TREE_CODE (member) == INDIRECT_REF)
+  if (INDIRECT_REF_P (member))
     member = TREE_OPERAND (member, 0);
   if (TREE_CODE (member) == NOP_EXPR)
     {
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 0306db10770b6f3ac21af1a397dd702fe0966a6b..4159321814aace3dc5800fdd85bcb3b10eacc568 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2879,7 +2879,7 @@ maybe_dummy_object (tree type, tree* binfop)
 int
 is_dummy_object (const_tree ob)
 {
-  if (TREE_CODE (ob) == INDIRECT_REF)
+  if (INDIRECT_REF_P (ob))
     ob = TREE_OPERAND (ob, 0);
   return (TREE_CODE (ob) == NOP_EXPR
 	  && TREE_OPERAND (ob, 0) == void_zero_node);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 8778b2cf7b917e736289a51a0c671b576bbadab2..a0caa300cac63b9cae9deb80bf0ff986844f9985 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1918,7 +1918,7 @@ decay_conversion (tree exp, tsubst_flags_t complain)
       tree adr;
       tree ptrtype;
 
-      if (TREE_CODE (exp) == INDIRECT_REF)
+      if (INDIRECT_REF_P (exp))
 	return build_nop (build_pointer_type (TREE_TYPE (type)),
 			  TREE_OPERAND (exp, 0));
 
@@ -2296,7 +2296,7 @@ build_class_member_access_expr (tree object, tree member,
       int type_quals;
       tree member_type;
 
-      null_object_p = (TREE_CODE (object) == INDIRECT_REF
+      null_object_p = (INDIRECT_REF_P (object)
 		       && integer_zerop (TREE_OPERAND (object, 0)));
 
       /* Convert OBJECT to the type of MEMBER.  */
@@ -5171,7 +5171,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
     }
 
   /* Let &* cancel out to simplify resulting code.  */
-  if (TREE_CODE (arg) == INDIRECT_REF)
+  if (INDIRECT_REF_P (arg))
     {
       /* We don't need to have `current_class_ptr' wrapped in a
 	 NON_LVALUE_EXPR node.  */
@@ -5196,7 +5196,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
       && argtype != unknown_type_node
       && (val = get_base_address (arg))
       && COMPLETE_TYPE_P (TREE_TYPE (val))
-      && TREE_CODE (val) == INDIRECT_REF
+      && INDIRECT_REF_P (val)
       && TREE_CONSTANT (TREE_OPERAND (val, 0)))
     {
       tree type = build_pointer_type (argtype);
@@ -5715,7 +5715,7 @@ unary_complex_lvalue (enum tree_code code, tree arg)
 	return build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (arg)), targ);
       }
 
-    if (TREE_CODE (arg) == SAVE_EXPR && TREE_CODE (targ) == INDIRECT_REF)
+    if (TREE_CODE (arg) == SAVE_EXPR && INDIRECT_REF_P (targ))
       return build3 (SAVE_EXPR, build_pointer_type (TREE_TYPE (arg)),
 		     TREE_OPERAND (targ, 0), current_function_decl, NULL);
   }
@@ -8254,7 +8254,7 @@ check_return_expr (tree retval, bool *no_warning)
 	    warn = false;
 	  /* If we are calling a function whose return type is the same of
 	     the current class reference, it is ok.  */
-	  else if (TREE_CODE (retval) == INDIRECT_REF
+	  else if (INDIRECT_REF_P (retval)
 		   && TREE_CODE (TREE_OPERAND (retval, 0)) == CALL_EXPR)
 	    warn = false;
 	}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 72dccb4f067523ab16bdf2c2a95bfb4a5a63ce25..52bc4ec3b7f01417c411cce048764946baee15c4 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -111,7 +111,7 @@ cxx_readonly_error (tree arg, enum lvalue_use errstring)
 			  G_("decrement of "
 			     "constant field %qD"),
 			  arg);
-  else if (TREE_CODE (arg) == INDIRECT_REF
+  else if (INDIRECT_REF_P (arg)
 	   && TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0))) == REFERENCE_TYPE
 	   && (TREE_CODE (TREE_OPERAND (arg, 0)) == VAR_DECL
 	       || TREE_CODE (TREE_OPERAND (arg, 0)) == PARM_DECL))