public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Tweak predicate macros in tree
@ 2023-07-18 23:12 Ken Matsui
  2023-07-18 23:12 ` [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h Ken Matsui
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

This patch series tweaks predicate macros in tree.h to make the code more
readable. TYPE_REF_P is moved to tree.h and used for INDIRECT_TYPE_P and
TYPE_REF_IS_LVALUE. TYPE_PTR_P is also moved to tree.h and used for
INDIRECT_TYPE_P. POINTER_TYPE_P in tree.h is replaced with INDIRECT_TYPE_P
since it is ambiguous. TYPE_REF_IS_LVALUE is defined in tree.h through
TYPE_REF_P and TYPE_REF_IS_RVALUE. The same behavior codes with those
predicate macros are replaced for clarity.

These works were all the way up to implementing __is_lvalue_reference
built-in trait and optimizing the is_lvalue_reference trait. However, those
changes were dropped since I did not observe any performance improvements.
For those who are interested in the benchmark results, they can be found
below:

1. is_lvalue_reference

https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference.md#tue-jul-18-033708-pm-pdt-2023

Time: +1.35432%
Peak Memory Usage: -0.103283%
Total Memory Usage: No difference

2. is_lvalue_reference_v

https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference_v.md#tue-jul-18-034236-pm-pdt-2023

Time: No difference
Peak Memory Usage: -0.426872%
Total Memory Usage: -0.677638%

Ken Matsui (8):
  c++, tree: Move TYPE_REF_P to tree.h
  gcc: Use TYPE_REF_P
  c++, tree: Move TYPE_PTR_P to tree.h
  c++, tree: Move INDIRECT_TYPE_P to tree.h
  gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P
  tree: Remove POINTER_TYPE_P
  tree: Define TYPE_REF_IS_LVALUE
  c++, lto: Use TYPE_REF_IS_LVALUE

 gcc/ada/gcc-interface/ada-tree.h           |   2 +-
 gcc/ada/gcc-interface/decl.cc              |   6 +-
 gcc/ada/gcc-interface/trans.cc             |  16 +--
 gcc/ada/gcc-interface/utils.cc             |  12 +-
 gcc/ada/gcc-interface/utils2.cc            |  14 +-
 gcc/alias.cc                               |  12 +-
 gcc/analyzer/analyzer.cc                   |   4 +-
 gcc/analyzer/call-details.h                |   2 +-
 gcc/analyzer/call-summary.cc               |   2 +-
 gcc/analyzer/checker-event.cc              |   4 +-
 gcc/analyzer/constraint-manager.cc         |   2 +-
 gcc/analyzer/engine.cc                     |   4 +-
 gcc/analyzer/program-state.cc              |   2 +-
 gcc/analyzer/region-model-manager.cc       |   6 +-
 gcc/analyzer/region-model.cc               |   6 +-
 gcc/analyzer/sm.cc                         |   4 +-
 gcc/analyzer/svalue.cc                     |   2 +-
 gcc/analyzer/varargs.cc                    |   2 +-
 gcc/asan.cc                                |   4 +-
 gcc/builtins.cc                            |  24 ++--
 gcc/c-family/c-ada-spec.cc                 |   2 +-
 gcc/c-family/c-attribs.cc                  |  32 ++---
 gcc/c-family/c-common.cc                   |  41 +++---
 gcc/c-family/c-omp.cc                      |   8 +-
 gcc/c-family/c-pretty-print.cc             |   4 +-
 gcc/c-family/c-ubsan.cc                    |  10 +-
 gcc/c-family/c-warn.cc                     |  34 ++---
 gcc/c/c-decl.cc                            |   8 +-
 gcc/c/c-parser.cc                          |   4 +-
 gcc/c/c-typeck.cc                          |  40 +++---
 gcc/c/gimple-parser.cc                     |   8 +-
 gcc/calls.cc                               |   2 +-
 gcc/cfgexpand.cc                           |   6 +-
 gcc/cgraph.cc                              |   2 +-
 gcc/cgraphunit.cc                          |   2 +-
 gcc/config/aarch64/aarch64-builtins.cc     |   2 +-
 gcc/config/aarch64/aarch64-sve-builtins.cc |   2 +-
 gcc/config/aarch64/aarch64.cc              |   6 +-
 gcc/config/arc/arc.cc                      |   2 +-
 gcc/config/arm/arm-builtins.cc             |   6 +-
 gcc/config/arm/arm-mve-builtins.cc         |   2 +-
 gcc/config/avr/avr.cc                      |   6 +-
 gcc/config/epiphany/epiphany.cc            |   2 +-
 gcc/config/gcn/gcn-tree.cc                 |   2 +-
 gcc/config/gcn/gcn.cc                      |   6 +-
 gcc/config/i386/i386-builtins.cc           |   2 +-
 gcc/config/i386/i386-options.cc            |   2 +-
 gcc/config/i386/i386.cc                    |  10 +-
 gcc/config/m32c/m32c.cc                    |   2 +-
 gcc/config/m68k/m68k.cc                    |   4 +-
 gcc/config/mips/mips.cc                    |   2 +-
 gcc/config/mn10300/mn10300.cc              |   2 +-
 gcc/config/msp430/msp430.cc                |   2 +-
 gcc/config/nios2/nios2.cc                  |   2 +-
 gcc/config/pa/pa.cc                        |   4 +-
 gcc/config/pru/pru-passes.cc               |   2 +-
 gcc/config/pru/pru.cc                      |   2 +-
 gcc/config/rs6000/rs6000-builtin.cc        |   4 +-
 gcc/config/rs6000/rs6000-c.cc              |  10 +-
 gcc/config/rs6000/rs6000.cc                |   4 +-
 gcc/config/s390/s390-c.cc                  |   2 +-
 gcc/config/s390/s390.cc                    |  12 +-
 gcc/config/sparc/sparc.cc                  |   2 +-
 gcc/convert.cc                             |   4 +-
 gcc/cp/class.cc                            |   4 +-
 gcc/cp/constexpr.cc                        |   8 +-
 gcc/cp/coroutines.cc                       |   4 +-
 gcc/cp/cp-gimplify.cc                      |   2 +-
 gcc/cp/cp-tree.h                           |  12 --
 gcc/cp/decl.cc                             |   5 +-
 gcc/cp/init.cc                             |   5 +-
 gcc/cp/method.cc                           |   5 +-
 gcc/cp/pt.cc                               |   8 +-
 gcc/cp/semantics.cc                        |  18 +--
 gcc/cp/tree.cc                             |   2 +-
 gcc/cp/typeck.cc                           |   4 +-
 gcc/d/d-attribs.cc                         |   6 +-
 gcc/d/d-builtins.cc                        |   2 +-
 gcc/d/d-codegen.cc                         |  12 +-
 gcc/d/d-convert.cc                         |  12 +-
 gcc/d/expr.cc                              |  10 +-
 gcc/d/intrinsics.cc                        |  12 +-
 gcc/dojump.cc                              |   4 +-
 gcc/dwarf2out.cc                           |   2 +-
 gcc/emit-rtl.cc                            |   2 +-
 gcc/expmed.cc                              |   2 +-
 gcc/expr.cc                                |  22 +--
 gcc/fold-const.cc                          |  58 ++++----
 gcc/fortran/trans-array.cc                 |  36 ++---
 gcc/fortran/trans-decl.cc                  |  32 ++---
 gcc/fortran/trans-expr.cc                  | 106 +++++++-------
 gcc/fortran/trans-intrinsic.cc             |  28 ++--
 gcc/fortran/trans-io.cc                    |   8 +-
 gcc/fortran/trans-openmp.cc                |  88 ++++++------
 gcc/fortran/trans-stmt.cc                  |  14 +-
 gcc/fortran/trans-types.cc                 |   8 +-
 gcc/fortran/trans.cc                       |  14 +-
 gcc/function-abi.cc                        |   2 +-
 gcc/function.cc                            |   6 +-
 gcc/gimple-array-bounds.cc                 |   6 +-
 gcc/gimple-expr.cc                         |   8 +-
 gcc/gimple-fold.cc                         |  20 +--
 gcc/gimple-loop-versioning.cc              |   4 +-
 gcc/gimple-low.cc                          |   2 +-
 gcc/gimple-pretty-print.cc                 |   4 +-
 gcc/gimple-range-cache.cc                  |   4 +-
 gcc/gimple-range-fold.cc                   |   2 +-
 gcc/gimple-range-infer.cc                  |   2 +-
 gcc/gimple-range-path.cc                   |   4 +-
 gcc/gimple-ssa-isolate-paths.cc            |   6 +-
 gcc/gimple-ssa-nonnull-compare.cc          |   4 +-
 gcc/gimple-ssa-sprintf.cc                  |   4 +-
 gcc/gimple-ssa-store-merging.cc            |   6 +-
 gcc/gimple-ssa-strength-reduction.cc       |  22 +--
 gcc/gimple-ssa-warn-access.cc              |   8 +-
 gcc/gimple-ssa-warn-restrict.cc            |   6 +-
 gcc/gimple.cc                              |  10 +-
 gcc/gimplify.cc                            |  44 +++---
 gcc/go/go-gcc.cc                           |   2 +-
 gcc/godump.cc                              |   4 +-
 gcc/graphite-isl-ast-to-gimple.cc          |   8 +-
 gcc/graphite-sese-to-poly.cc               |   2 +-
 gcc/ipa-cp.cc                              |   4 +-
 gcc/ipa-devirt.cc                          |   8 +-
 gcc/ipa-free-lang-data.cc                  |   8 +-
 gcc/ipa-icf-gimple.cc                      |   2 +-
 gcc/ipa-icf.cc                             |   6 +-
 gcc/ipa-modref-tree.cc                     |   2 +-
 gcc/ipa-modref.cc                          |   8 +-
 gcc/ipa-param-manipulation.cc              |   4 +-
 gcc/ipa-polymorphic-call.cc                |   6 +-
 gcc/ipa-prop.cc                            |  28 ++--
 gcc/ipa-sra.cc                             |   4 +-
 gcc/jit/dummy-frontend.cc                  |   2 +-
 gcc/langhooks.cc                           |   2 +-
 gcc/lto-streamer-out.cc                    |   4 +-
 gcc/lto/lto-common.cc                      |  10 +-
 gcc/lto/lto-lang.cc                        |   2 +-
 gcc/lto/lto-symtab.cc                      |   2 +-
 gcc/m2/gm2-gcc/m2expr.cc                   |  12 +-
 gcc/m2/gm2-gcc/m2tree.cc                   |   2 +-
 gcc/m2/gm2-gcc/m2treelib.cc                |   2 +-
 gcc/m2/m2pp.cc                             |   4 +-
 gcc/match.pd                               |  48 +++----
 gcc/objc/objc-act.cc                       |  32 ++---
 gcc/objc/objc-encoding.cc                  |   2 +-
 gcc/objc/objc-gnu-runtime-abi-01.cc        |   4 +-
 gcc/objc/objc-next-runtime-abi-01.cc       |   4 +-
 gcc/objc/objc-next-runtime-abi-02.cc       |   6 +-
 gcc/omp-expand.cc                          | 156 ++++++++++-----------
 gcc/omp-general.cc                         |  10 +-
 gcc/omp-low.cc                             |  45 +++---
 gcc/omp-oacc-neuter-broadcast.cc           |   8 +-
 gcc/omp-offload.cc                         |   2 +-
 gcc/omp-simd-clone.cc                      |  28 ++--
 gcc/pointer-query.cc                       |  12 +-
 gcc/predict.cc                             |   4 +-
 gcc/range-op.cc                            |   4 +-
 gcc/rust/backend/rust-tree.cc              |   2 +-
 gcc/rust/rust-gcc.cc                       |   2 +-
 gcc/sese.cc                                |   2 +-
 gcc/tree-affine.cc                         |  12 +-
 gcc/tree-cfg.cc                            |  38 ++---
 gcc/tree-chrec.cc                          |  14 +-
 gcc/tree-chrec.h                           |   4 +-
 gcc/tree-core.h                            |   2 +-
 gcc/tree-data-ref.cc                       |  18 +--
 gcc/tree-dfa.cc                            |   2 +-
 gcc/tree-if-conv.cc                        |   4 +-
 gcc/tree-inline.cc                         |  10 +-
 gcc/tree-nested.cc                         |   8 +-
 gcc/tree-object-size.cc                    |  10 +-
 gcc/tree-outof-ssa.cc                      |   2 +-
 gcc/tree-pretty-print.cc                   |   8 +-
 gcc/tree-profile.cc                        |   2 +-
 gcc/tree-scalar-evolution.cc               |   8 +-
 gcc/tree-sra.cc                            |   2 +-
 gcc/tree-ssa-address.cc                    |   6 +-
 gcc/tree-ssa-alias.cc                      |  18 +--
 gcc/tree-ssa-ccp.cc                        |  22 +--
 gcc/tree-ssa-copy.cc                       |   4 +-
 gcc/tree-ssa-dom.cc                        |   2 +-
 gcc/tree-ssa-dse.cc                        |   2 +-
 gcc/tree-ssa-forwprop.cc                   |   6 +-
 gcc/tree-ssa-ifcombine.cc                  |   2 +-
 gcc/tree-ssa-loop-ch.cc                    |   2 +-
 gcc/tree-ssa-loop-ivopts.cc                |  44 +++---
 gcc/tree-ssa-loop-manip.cc                 |  10 +-
 gcc/tree-ssa-loop-niter.cc                 |  40 +++---
 gcc/tree-ssa-loop-split.cc                 |  10 +-
 gcc/tree-ssa-phiopt.cc                     |   2 +-
 gcc/tree-ssa-phiprop.cc                    |   2 +-
 gcc/tree-ssa-reassoc.cc                    |  14 +-
 gcc/tree-ssa-sccvn.cc                      |   6 +-
 gcc/tree-ssa-strlen.cc                     |  10 +-
 gcc/tree-ssa-structalias.cc                |  14 +-
 gcc/tree-ssa-threadedge.cc                 |   2 +-
 gcc/tree-ssa-uninit.cc                     |  10 +-
 gcc/tree-ssa.cc                            |   2 +-
 gcc/tree-ssanames.cc                       |  22 +--
 gcc/tree-stdarg.cc                         |   6 +-
 gcc/tree-streamer-in.cc                    |   2 +-
 gcc/tree-streamer-out.cc                   |   2 +-
 gcc/tree-tailcall.cc                       |   8 +-
 gcc/tree-vect-data-refs.cc                 |   4 +-
 gcc/tree-vect-loop-manip.cc                |   2 +-
 gcc/tree-vect-loop.cc                      |   4 +-
 gcc/tree-vect-stmts.cc                     |  18 +--
 gcc/tree-vrp.cc                            |   6 +-
 gcc/tree.cc                                |  64 ++++-----
 gcc/tree.h                                 |  30 ++--
 gcc/ubsan.cc                               |  18 +--
 gcc/value-pointer-equiv.cc                 |   4 +-
 gcc/value-pointer-equiv.h                  |   2 +-
 gcc/value-query.cc                         |  12 +-
 gcc/value-range.h                          |   6 +-
 gcc/var-tracking.cc                        |   6 +-
 gcc/varasm.cc                              |  10 +-
 gcc/vr-values.cc                           |   6 +-
 219 files changed, 1139 insertions(+), 1148 deletions(-)

-- 
2.41.0


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

* [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 2/8] gcc: Use TYPE_REF_P Ken Matsui
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

This patch moves TYPE_REF_P from cp/cp-tree.h to tree.h to simplify the
same code as it and to declare TYPE_REF_IS_LVALUE that determines if a
type is a C++ lvalue reference.

gcc/cp/ChangeLog:

	* cp-tree.h (TYPE_REF_P): Remove.

gcc/ChangeLog:

	* tree.h (TYPE_REF_P): Define.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/cp/cp-tree.h | 4 ----
 gcc/tree.h       | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3de0e154c12..8c96d868650 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4710,10 +4710,6 @@ get_vec_init_expr (tree t)
 #define TYPE_PTR_P(NODE)			\
   (TREE_CODE (NODE) == POINTER_TYPE)
 
-/* Returns true if NODE is a reference.  */
-#define TYPE_REF_P(NODE)			\
-  (TREE_CODE (NODE) == REFERENCE_TYPE)
-
 /* Returns true if NODE is a pointer or a reference.  */
 #define INDIRECT_TYPE_P(NODE)			\
   (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
diff --git a/gcc/tree.h b/gcc/tree.h
index 4c04245e2b1..ca3e0ce8f5e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -678,6 +678,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define AGGREGATE_TYPE_P(TYPE) \
   (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
 
+/* Nonzero if this type is a reference.  */
+#define TYPE_REF_P(NODE)			\
+  (TREE_CODE (NODE) == REFERENCE_TYPE)
+
 /* Nonzero if TYPE represents a pointer or reference type.
    (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
    ascending code order.  */
-- 
2.41.0


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

* [PATCH 2/8] gcc: Use TYPE_REF_P
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
  2023-07-18 23:12 ` [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h Ken Matsui
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

gcc/ada/ChangeLog:

	* gcc-interface/trans.cc (return_slot_opt_for_pure_call_p): Use TYPE_REF_P.
	* gcc-interface/utils2.cc (build_unary_op): Likewise.

gcc/ChangeLog:

	* alias.cc (get_alias_set): Use TYPE_REF_P.
	* config/gcn/gcn-tree.cc (gcn_goacc_get_worker_red_decl): Likewise.
	* fold-const.cc (fold_unary_loc): Likewise.
	* gimple.cc (gimple_call_nonnull_result_p): Likewise.
	* gimplify.cc (gimplify_decl_expr): Likewise.
	(omp_notice_variable): Likewise.
	(omp_accumulate_sibling_list): Likewise.
	(omp_build_struct_sibling_lists): Likewise.
	(gimplify_scan_omp_clauses): Likewise.
	(omp_shared_to_firstprivate_optimizable_decl_p): Likewise.
	(gimplify_adjust_omp_clauses_1): Likewise.
	(gimplify_omp_taskloop_expr): Likewise.
	* ipa-free-lang-data.cc (find_decls_types_r): Likewise.
	* ipa-sra.cc (create_parameter_descriptors): Likewise.
	* langhooks.cc (lhd_omp_scalar_p): Likewise.
	* match.pd: Likewise.
	* omp-low.cc (scan_sharing_clauses): Likewise.
	(lower_rec_input_clauses): Likewise.
	(create_task_copyfn): Likewise.
	(lower_omp_target): Likewise.
	(lower_omp_1): Likewise.
	* omp-simd-clone.cc (simd_clone_clauses_extract): Likewise.
	(simd_clone_linear_addend): Likewise.
	(simd_clone_adjust): Likewise.
	* tree-inline.cc (remap_type_1): Likewise.
	* tree.cc (reconstruct_complex_type): Likewise.
	(verify_type_variant): Likewise.
	(verify_type): Likewise.
	(nonnull_arg_p): Likewise.
	* tree.h (POINTER_TYPE_P): Likewise.
	* var-tracking.cc (prepare_call_arguments): Likewise.
	(vt_add_function_parameter): Likewise.

gcc/c-family/ChangeLog:

	* c-attribs.cc (has_attribute): Use TYPE_REF_P.
	* c-common.cc (c_common_truthvalue_conversion): Likewise.
	(c_apply_type_quals_to_decl): Likewise.
	* c-pretty-print.cc (c_pretty_printer::unary_expression): Likewise.
	* c-ubsan.cc (ubsan_maybe_instrument_reference_or_call): Likewise.
	* c-warn.cc (warn_if_unused_value): Likewise.

gcc/cp/ChangeLog:

	* constexpr.cc (check_bit_cast_type): Use TYPE_REF_P.
	* coroutines.cc (analyze_fn_parms): Likewise.
	* decl.cc (finish_function): Likewise.
	* init.cc (find_allocator_temps_r): Likewise.
	* method.cc (early_check_defaulted_comparison): Likewise.
	(build_comparison_op): Likewise.
	* pt.cc (value_dependent_expression_p): Likewise.
	* semantics.cc (cp_oacc_check_attachments): Likewise.
	(finish_omp_target_clauses_r): Likewise.
	(finish_omp_target_clauses): Likewise.

gcc/d/ChangeLog:

	* d-builtins.cc (build_frontend_type): Use TYPE_REF_P.
	* d-codegen.cc (indirect_ref): Likewise.
	* d-convert.cc (d_truthvalue_conversion): Likewise.

gcc/fortran/ChangeLog:

	* trans-array.cc (gfc_conv_descriptor_data_get): Use TYPE_REF_P.
	(structure_alloc_comps): Likewise.
	* trans-decl.cc (gfc_generate_function_code): Likewise.
	* trans-expr.cc (gfc_conv_class_to_class): Likewise.
	* trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Likewise.
	(conv_caf_send): Likewise.
	(trans_caf_is_present): Likewise.
	(conv_intrinsic_atomic_op): Likewise.
	(conv_intrinsic_atomic_ref): Likewise.
	(conv_intrinsic_atomic_cas): Likewise.
	* trans-openmp.cc (gfc_omp_privatize_by_reference): Likewise.
	(gfc_omp_finish_clause): Likewise.
	(gfc_omp_scalar_p): Likewise.
	(gfc_trans_omp_array_reduction_or_udr): Likewise.
	(gfc_trans_omp_clauses): Likewise.

gcc/lto/ChangeLog:

	* lto-common.cc (lto_fixup_prevailing_type): Use TYPE_REF_P.

gcc/m2/ChangeLog:

	* gm2-gcc/m2tree.cc (m2tree_skip_reference_type): Use TYPE_REF_P.
	* gm2-gcc/m2treelib.cc (m2treelib_get_set_value): Likewise.
	* m2pp.cc (m2pp_parameter): Likewise.
	(m2pp_param_type): Likewise.

gcc/objc/ChangeLog:

	* objc-act.cc: Use TYPE_REF_P.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/ada/gcc-interface/trans.cc  |  2 +-
 gcc/ada/gcc-interface/utils2.cc |  2 +-
 gcc/alias.cc                    |  2 +-
 gcc/c-family/c-attribs.cc       |  2 +-
 gcc/c-family/c-common.cc        |  7 +++----
 gcc/c-family/c-pretty-print.cc  |  2 +-
 gcc/c-family/c-ubsan.cc         |  4 ++--
 gcc/c-family/c-warn.cc          |  2 +-
 gcc/config/gcn/gcn-tree.cc      |  2 +-
 gcc/cp/constexpr.cc             |  2 +-
 gcc/cp/coroutines.cc            |  2 +-
 gcc/cp/decl.cc                  |  2 +-
 gcc/cp/init.cc                  |  2 +-
 gcc/cp/method.cc                |  4 ++--
 gcc/cp/pt.cc                    |  2 +-
 gcc/cp/semantics.cc             | 10 +++++-----
 gcc/d/d-builtins.cc             |  2 +-
 gcc/d/d-codegen.cc              |  2 +-
 gcc/d/d-convert.cc              |  4 ++--
 gcc/fold-const.cc               |  2 +-
 gcc/fortran/trans-array.cc      |  4 ++--
 gcc/fortran/trans-decl.cc       |  2 +-
 gcc/fortran/trans-expr.cc       |  2 +-
 gcc/fortran/trans-intrinsic.cc  | 16 ++++++++--------
 gcc/fortran/trans-openmp.cc     | 10 +++++-----
 gcc/gimple.cc                   |  2 +-
 gcc/gimplify.cc                 | 18 +++++++++---------
 gcc/ipa-free-lang-data.cc       |  2 +-
 gcc/ipa-sra.cc                  |  2 +-
 gcc/langhooks.cc                |  2 +-
 gcc/lto/lto-common.cc           |  2 +-
 gcc/m2/gm2-gcc/m2tree.cc        |  2 +-
 gcc/m2/gm2-gcc/m2treelib.cc     |  2 +-
 gcc/m2/m2pp.cc                  |  4 ++--
 gcc/match.pd                    |  2 +-
 gcc/objc/objc-act.cc            |  2 +-
 gcc/omp-low.cc                  | 17 ++++++++---------
 gcc/omp-simd-clone.cc           |  8 ++++----
 gcc/tree-inline.cc              |  2 +-
 gcc/tree.cc                     | 10 +++++-----
 gcc/tree.h                      |  2 +-
 gcc/var-tracking.cc             |  6 +++---
 42 files changed, 88 insertions(+), 90 deletions(-)

diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index f5eadbbc895..203d63b2e5e 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -4540,7 +4540,7 @@ return_slot_opt_for_pure_call_p (tree target, tree call)
   FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
     {
       tree arg_type = TREE_TYPE (arg);
-      if (TREE_CODE (arg_type) == REFERENCE_TYPE)
+      if (TYPE_REF_P (arg_type))
 	arg_type = TREE_TYPE (arg_type);
 
       if (is_array_of_scalar_type (arg_type))
diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc
index 95bbce2f1b4..022bbf97e8e 100644
--- a/gcc/ada/gcc-interface/utils2.cc
+++ b/gcc/ada/gcc-interface/utils2.cc
@@ -1406,7 +1406,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
 		  = build_pointer_type_for_mode (TREE_TYPE (result_type),
 						 TYPE_MODE (result_type),
 						 true);
-	      else if (TREE_CODE (result_type) == REFERENCE_TYPE
+	      else if (TYPE_REF_P (result_type)
 		       && !TYPE_REF_CAN_ALIAS_ALL (result_type))
 	        result_type
 		  = build_reference_type_for_mode (TREE_TYPE (result_type),
diff --git a/gcc/alias.cc b/gcc/alias.cc
index 7c1af1fe96e..3f2e74b00a4 100644
--- a/gcc/alias.cc
+++ b/gcc/alias.cc
@@ -1041,7 +1041,7 @@ get_alias_set (tree t)
 	      p = ptr_type_node;
 	      break;
 	    }
-	  if (TREE_CODE (p) == REFERENCE_TYPE)
+	  if (TYPE_REF_P (p))
 	    /* In LTO we want languages that use references to be compatible
  	       with languages that use pointers.  */
 	    reference.safe_push (true && !in_lto_p);
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index e2792ca6898..852fd2503ec 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -6098,7 +6098,7 @@ has_attribute (location_t atloc, tree t, tree attr, tree (*convert)(tree))
 	  if (code == INDIRECT_REF)
 	    {
 	      tree op0 = TREE_OPERAND (t, 0);
-	      if (TREE_CODE (TREE_TYPE (op0)) == REFERENCE_TYPE)
+	      if (TYPE_REF_P (TREE_TYPE (op0)))
 		t = op0;
 	      else
 		break;
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 6ab63dae997..6add84c9504 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -3657,7 +3657,7 @@ c_common_truthvalue_conversion (location_t location, tree expr)
 
 	if (POINTER_TYPE_P (totype)
 	    && !c_inhibit_evaluation_warnings
-	    && TREE_CODE (fromtype) == REFERENCE_TYPE)
+	    && TYPE_REF_P (fromtype))
 	  {
 	    tree inner = expr;
 	    STRIP_NOPS (inner);
@@ -3672,8 +3672,7 @@ c_common_truthvalue_conversion (location_t location, tree expr)
 
 	/* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
 	   since that affects how `default_conversion' will behave.  */
-	if (TREE_CODE (totype) == REFERENCE_TYPE
-	    || TREE_CODE (fromtype) == REFERENCE_TYPE)
+	if (TYPE_REF_P (totype) || TYPE_REF_P (fromtype))
 	  break;
 	/* Don't strip a conversion from C++0x scoped enum, since they
 	   don't implicitly convert to other types.  */
@@ -3768,7 +3767,7 @@ c_apply_type_quals_to_decl (int type_quals, tree decl)
     return;
 
   if ((type_quals & TYPE_QUAL_CONST)
-      || (type && TREE_CODE (type) == REFERENCE_TYPE))
+      || (type && TYPE_REF_P (type)))
     /* We used to check TYPE_NEEDS_CONSTRUCTING here, but now a constexpr
        constructor can produce constant init, so rely on cp_finish_decl to
        clear TREE_READONLY if the variable has non-constant init.  */
diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc
index 7536a7c471f..63a77231500 100644
--- a/gcc/c-family/c-pretty-print.cc
+++ b/gcc/c-family/c-pretty-print.cc
@@ -2181,7 +2181,7 @@ c_pretty_printer::unary_expression (tree e)
       else if (code == INDIRECT_REF)
 	{
 	  tree type = TREE_TYPE (TREE_OPERAND (e, 0));
-	  if (type && TREE_CODE (type) == REFERENCE_TYPE)
+	  if (type && TYPE_REF_P (type))
 	    /* Reference decay is implicit, don't print anything.  */;
 	  else
 	    pp_c_star (this);
diff --git a/gcc/c-family/c-ubsan.cc b/gcc/c-family/c-ubsan.cc
index 51aa83a378d..355dc67aa61 100644
--- a/gcc/c-family/c-ubsan.cc
+++ b/gcc/c-family/c-ubsan.cc
@@ -534,7 +534,7 @@ ubsan_maybe_instrument_reference_or_call (location_t loc, tree op, tree ptype,
 	 && TREE_CODE (TREE_TYPE (op)) == POINTER_TYPE)
     op = TREE_OPERAND (op, 0);
   if (TREE_CODE (op) == NOP_EXPR
-      && TREE_CODE (TREE_TYPE (op)) == REFERENCE_TYPE)
+      && TYPE_REF_P (TREE_TYPE (op)))
     {
       if (mina && mina > min_align_of_type (TREE_TYPE (TREE_TYPE (op))))
 	instrument = true;
@@ -570,7 +570,7 @@ ubsan_maybe_instrument_reference_or_call (location_t loc, tree op, tree ptype,
     return NULL_TREE;
   op = save_expr (orig_op);
   gcc_assert (POINTER_TYPE_P (ptype));
-  if (TREE_CODE (ptype) == REFERENCE_TYPE)
+  if (TYPE_REF_P (ptype))
     ptype = build_pointer_type (TREE_TYPE (ptype));
   tree kind = build_int_cst (ptype, ckind);
   tree align = build_int_cst (pointer_sized_int_node, mina);
diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc
index d4d62c48b20..b92b4f9ecb1 100644
--- a/gcc/c-family/c-warn.cc
+++ b/gcc/c-family/c-warn.cc
@@ -659,7 +659,7 @@ warn_if_unused_value (const_tree exp, location_t locus, bool quiet)
     case INDIRECT_REF:
       /* Don't warn about automatic dereferencing of references, since
 	 the user cannot control it.  */
-      if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
 	{
 	  exp = TREE_OPERAND (exp, 0);
 	  goto restart;
diff --git a/gcc/config/gcn/gcn-tree.cc b/gcc/config/gcn/gcn-tree.cc
index c99c1767659..eed16bcfd27 100644
--- a/gcc/config/gcn/gcn-tree.cc
+++ b/gcc/config/gcn/gcn-tree.cc
@@ -310,7 +310,7 @@ gcn_goacc_get_worker_red_decl (tree type, unsigned offset)
 {
   machine_function *machfun = cfun->machine;
 
-  if (TREE_CODE (type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (type))
     type = TREE_TYPE (type);
 
   tree var_type
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 9d85c3be5cc..8c416d7bdfc 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -4544,7 +4544,7 @@ check_bit_cast_type (const constexpr_ctx *ctx, location_t loc, tree type,
 	}
       return true;
     }
-  if (TREE_CODE (type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (type))
     {
       if (!ctx->quiet)
 	{
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 3493d3c6ed3..a6e04dc0f10 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -3834,7 +3834,7 @@ analyze_fn_parms (tree orig)
 	actual_type = error_mark_node;
       parm.orig_type = actual_type;
       parm.by_ref = parm.pt_ref = parm.rv_ref =  false;
-      if (TREE_CODE (actual_type) == REFERENCE_TYPE)
+      if (TYPE_REF_P (actual_type))
 	{
 	  /* If the user passes by reference, then we will save the
 	     pointer to the original.  As noted in
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 792ab330dd0..c08056ca3d2 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -18210,7 +18210,7 @@ finish_function (bool inline_p)
       if (IDENTIFIER_ASSIGN_OP_P (DECL_NAME (fndecl)))
 	{
 	  tree valtype = TREE_TYPE (DECL_RESULT (fndecl));
-	  if (TREE_CODE (valtype) == REFERENCE_TYPE
+	  if (TYPE_REF_P (valtype)
 	      && current_class_ref
 	      && same_type_ignoring_top_level_qualifiers_p
 		  (TREE_TYPE (valtype), TREE_TYPE (current_class_ref))
diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc
index ff5014ca576..01eb4b55889 100644
--- a/gcc/cp/init.cc
+++ b/gcc/cp/init.cc
@@ -4366,7 +4366,7 @@ find_allocator_temps_r (tree *tp, int *walk_subtrees, void *data)
 	{
 	  tree arg = get_nth_callarg (t, i);
 	  tree atype = TREE_TYPE (arg);
-	  if (TREE_CODE (atype) == REFERENCE_TYPE
+	  if (TYPE_REF_P (atype)
 	      && is_std_allocator (TREE_TYPE (atype)))
 	    {
 	      STRIP_NOPS (arg);
diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc
index 8ed967ddb21..524efc4e260 100644
--- a/gcc/cp/method.cc
+++ b/gcc/cp/method.cc
@@ -1207,7 +1207,7 @@ early_check_defaulted_comparison (tree fn)
       tree parmtype = TREE_VALUE (parmnode);
       if (CLASS_TYPE_P (parmtype))
 	saw_byval = true;
-      else if (TREE_CODE (parmtype) == REFERENCE_TYPE
+      else if (TYPE_REF_P (parmtype)
 	       && !TYPE_REF_IS_RVALUE (parmtype)
 	       && TYPE_QUALS (TREE_TYPE (parmtype)) == TYPE_QUAL_CONST)
 	{
@@ -1533,7 +1533,7 @@ build_comparison_op (tree fndecl, bool defining, tsubst_flags_t complain)
 	  /* A defaulted comparison operator function for class C is defined as
 	     deleted if any non-static data member of C is of reference type or
 	     C has variant members.  */
-	  if (TREE_CODE (expr_type) == REFERENCE_TYPE)
+	  if (TYPE_REF_P (expr_type))
 	    {
 	      if (complain & tf_error)
 		inform (field_loc, "cannot default compare "
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 255d18b9539..cb82e1b268b 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -28023,7 +28023,7 @@ value_dependent_expression_p (tree expression)
 	if (TREE_CODE (expression) == TREE_LIST)
 	  return any_value_dependent_elements_p (expression);
 
-	if (TREE_CODE (type) == REFERENCE_TYPE
+	if (TYPE_REF_P (type)
 	    && has_value_dependent_address (expression))
 	  return true;
 
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index 8fb47fd179e..8f4b2532934 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -6816,7 +6816,7 @@ cp_oacc_check_attachments (tree c)
 
       type = TREE_TYPE (t);
 
-      if (TREE_CODE (type) == REFERENCE_TYPE)
+      if (TYPE_REF_P (type))
 	type = TREE_TYPE (type);
 
       if (TREE_CODE (type) != POINTER_TYPE)
@@ -9645,7 +9645,7 @@ finish_omp_target_clauses_r (tree *tp, int *walk_subtrees, void *ptr)
 	  tree fld = TREE_OPERAND (t, 1);
 	  if (data->ptr_members_accessed.get (fld) == NULL)
 	    {
-	      if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
+	      if (TYPE_REF_P (TREE_TYPE (t)))
 		t = convert_from_reference (t);
 	      data->ptr_members_accessed.put (fld, t);
 	    }
@@ -9834,7 +9834,7 @@ finish_omp_target_clauses (location_t loc, tree body, tree *clauses_ptr)
 	  tree closure_expr = DECL_VALUE_EXPR (orig_decl);
 
 	  if (TREE_CODE (TREE_TYPE (orig_decl)) == POINTER_TYPE
-	      || TREE_CODE (TREE_TYPE (orig_decl)) == REFERENCE_TYPE)
+	      || TYPE_REF_P (TREE_TYPE (orig_decl)))
 	    {
 	      /* this-pointer is processed above, outside this loop.  */
 	      if (omp_target_this_expr
@@ -9931,7 +9931,7 @@ finish_omp_target_clauses (location_t loc, tree body, tree *clauses_ptr)
 	if (!cxx_mark_addressable (ptr_member))
 	  gcc_unreachable ();
 
-	if (TREE_CODE (TREE_TYPE (field_decl)) == REFERENCE_TYPE)
+	if (TYPE_REF_P (TREE_TYPE (field_decl)))
 	  {
 	    /* For reference to pointers, we need to map the referenced
 	       pointer first for things to be correct.  */
@@ -10026,7 +10026,7 @@ finish_omp_target_clauses (location_t loc, tree body, tree *clauses_ptr)
 	      OMP_CLAUSE_SIZE (c) = size_zero_node;
 	      new_clauses.safe_push (c);
 	    }
-	  else if (TREE_CODE (TREE_TYPE (fld)) == REFERENCE_TYPE)
+	  else if (TYPE_REF_P (TREE_TYPE (fld)))
 	    {
 	      tree exp = build3 (COMPONENT_REF, TREE_TYPE (fld),
 				 lobj, fld, NULL_TREE);
diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc
index 60f76fc694c..bfd455613de 100644
--- a/gcc/d/d-builtins.cc
+++ b/gcc/d/d-builtins.cc
@@ -307,7 +307,7 @@ build_frontend_type (tree type)
 		}
 
 	      StorageClass sc = STCundefined;
-	      if (TREE_CODE (argtype) == REFERENCE_TYPE)
+	      if (TYPE_REF_P (argtype))
 		{
 		  argtype = TREE_TYPE (argtype);
 		  sc |= STCref;
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 2738958fde1..ab48b55ada7 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -1625,7 +1625,7 @@ indirect_ref (tree type, tree exp)
   /* Maybe rewrite: *(e1, e2) => (e1, *e2)  */
   tree init = stabilize_expr (&exp);
 
-  if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (exp)))
     exp = fold_build1 (INDIRECT_REF, type, exp);
   else
     {
diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc
index 2b9d8e78fb6..ec75eccbbaf 100644
--- a/gcc/d/d-convert.cc
+++ b/gcc/d/d-convert.cc
@@ -185,8 +185,8 @@ d_truthvalue_conversion (tree expr)
     case CONVERT_EXPR:
       /* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
 	 since that affects how `default_conversion' will behave.  */
-      if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
-	  || TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (expr))
+	  || TYPE_REF_P (TREE_TYPE (TREE_OPERAND (expr, 0))))
 	break;
       /* Fall through.  */
 
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index a02ede79fed..15a4e120201 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -9507,7 +9507,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
 	     when type is a reference type and arg00's type is not,
 	     because arg00 could be validly nullptr and if arg01 doesn't return,
 	     we don't want false positive binding of reference to nullptr.  */
-	  if (TREE_CODE (type) == REFERENCE_TYPE
+	  if (TYPE_REF_P (type)
 	      && !in_gimple_form
 	      && sanitize_flags_p (SANITIZE_NULL)
 	      && TREE_CODE (TREE_TYPE (arg00)) != REFERENCE_TYPE)
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 951cecfa5d5..94d8e57750a 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -258,7 +258,7 @@ tree
 gfc_conv_descriptor_data_get (tree desc)
 {
   tree type = TREE_TYPE (desc);
-  if (TREE_CODE (type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (type))
     gcc_unreachable ();
 
   tree field = gfc_get_descriptor_field (desc, DATA_FIELD);
@@ -9105,7 +9105,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest,
   decl_type = TREE_TYPE (decl);
 
   if ((POINTER_TYPE_P (decl_type))
-	|| (TREE_CODE (decl_type) == REFERENCE_TYPE && rank == 0))
+	|| (TYPE_REF_P (decl_type) && rank == 0))
     {
       decl = build_fold_indirect_ref_loc (input_location, decl);
       /* Deref dest in sync with decl, but only when it is not NULL.  */
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index b0fd25e92a3..a141fbdeed3 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -7648,7 +7648,7 @@ gfc_generate_function_code (gfc_namespace * ns)
 	if (POINTER_TYPE_P (TREE_TYPE (type)))
 	  /* For instance, allocatable scalars.  */
 	  type = TREE_TYPE (type);
-	if (TREE_CODE (type) == REFERENCE_TYPE)
+	if (TYPE_REF_P (type))
 	  type = build_pointer_type (TREE_TYPE (type));
 	desc_p = build_decl (loc, VAR_DECL, get_identifier (fsym->name), type);
 	if (!fsym->attr.dimension)
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index ef3e6d08f78..b019cda1813 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -1298,7 +1298,7 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
   gcc_assert (tmp != NULL_TREE);
 
   /* Dereference if needs be.  */
-  if (TREE_CODE (TREE_TYPE (tmp)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (tmp)))
     tmp = build_fold_indirect_ref_loc (input_location, tmp);
 
   if (!(gfc_is_class_array_function (e) && parmse->class_vptr))
diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index b6ea26e413d..87ff0a15237 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -1777,7 +1777,7 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind,
 	    lhs_kind = kind;
 
 	  caf_decl = gfc_get_tree_for_caf_expr (array_expr);
-	  if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+	  if (TYPE_REF_P (TREE_TYPE (caf_decl)))
 	    caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
 	  image_index = gfc_caf_get_image_index (&se->pre, array_expr,
 						 caf_decl);
@@ -1899,7 +1899,7 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind,
   gfc_add_block_to_block (&se->post, &argse.post);
 
   caf_decl = gfc_get_tree_for_caf_expr (array_expr);
-  if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (caf_decl)))
     caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
   image_index = gfc_caf_get_image_index (&se->pre, array_expr, caf_decl);
   gfc_get_caf_token_offset (se, &token, &offset, caf_decl, argse.expr,
@@ -2166,7 +2166,7 @@ conv_caf_send (gfc_code *code) {
 
   /* Obtain token, offset and image index for the LHS.  */
   caf_decl = gfc_get_tree_for_caf_expr (lhs_expr);
-  if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (caf_decl)))
     caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
   image_index = gfc_caf_get_image_index (&block, lhs_expr, caf_decl);
   tmp = lhs_se.expr;
@@ -2305,7 +2305,7 @@ conv_caf_send (gfc_code *code) {
       gfc_add_expr_to_block (&block, tmp);
 
       caf_decl = gfc_get_tree_for_caf_expr (rhs_expr);
-      if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (caf_decl)))
 	caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
       rhs_image_index = gfc_caf_get_image_index (&block, rhs_expr, caf_decl);
       tmp = rhs_se.expr;
@@ -8783,7 +8783,7 @@ trans_caf_is_present (gfc_se *se, gfc_expr *expr)
   gcc_assert (caf_reference != NULL_TREE);
 
   caf_decl = gfc_get_tree_for_caf_expr (expr);
-  if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (caf_decl)))
     caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
   image_index = gfc_caf_get_image_index (&se->pre, expr, caf_decl);
   gfc_get_caf_token_offset (se, &token, NULL, caf_decl, NULL,
@@ -11845,7 +11845,7 @@ conv_intrinsic_atomic_op (gfc_code *code)
 	}
 
       caf_decl = gfc_get_tree_for_caf_expr (atom_expr);
-      if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (caf_decl)))
 	caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
 
       if (gfc_is_coindexed (atom_expr))
@@ -12001,7 +12001,7 @@ conv_intrinsic_atomic_ref (gfc_code *code)
       tree orig_value = NULL_TREE, vardecl = NULL_TREE;
 
       caf_decl = gfc_get_tree_for_caf_expr (atom_expr);
-      if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (caf_decl)))
 	caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
 
       if (gfc_is_coindexed (atom_expr))
@@ -12123,7 +12123,7 @@ conv_intrinsic_atomic_cas (gfc_code *code)
       tree image_index, caf_decl, offset, token;
 
       caf_decl = gfc_get_tree_for_caf_expr (atom_expr);
-      if (TREE_CODE (TREE_TYPE (caf_decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (caf_decl)))
 	caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
 
       if (gfc_is_coindexed (atom_expr))
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index c88ee3c7656..a676442ca9e 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -219,7 +219,7 @@ gfc_omp_privatize_by_reference (const_tree decl)
 {
   tree type = TREE_TYPE (decl);
 
-  if (TREE_CODE (type) == REFERENCE_TYPE
+  if (TYPE_REF_P (type)
       && (!DECL_ARTIFICIAL (decl) || TREE_CODE (decl) == PARM_DECL))
     return true;
 
@@ -1584,7 +1584,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
 	  OMP_CLAUSE_DECL (c) = decl;
 	  OMP_CLAUSE_SIZE (c) = NULL_TREE;
 	}
-      if (TREE_CODE (TREE_TYPE (orig_decl)) == REFERENCE_TYPE
+      if (TYPE_REF_P (TREE_TYPE (orig_decl))
 	  && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)
 	      || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
 	{
@@ -1747,7 +1747,7 @@ bool
 gfc_omp_scalar_p (tree decl, bool ptr_alloc_ok)
 {
   tree type = TREE_TYPE (decl);
-  if (TREE_CODE (type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (type))
     type = TREE_TYPE (type);
   if (TREE_CODE (type) == POINTER_TYPE)
     {
@@ -2015,7 +2015,7 @@ gfc_trans_omp_array_reduction_or_udr (tree c, gfc_omp_namelist *n, locus where)
   type = TREE_TYPE (decl);
   outer_decl = create_tmp_var_raw (type);
   if (TREE_CODE (decl) == PARM_DECL
-      && TREE_CODE (type) == REFERENCE_TYPE
+      && TYPE_REF_P (type)
       && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))
       && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (type)) == GFC_ARRAY_ALLOCATABLE)
     {
@@ -3277,7 +3277,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			  OMP_CLAUSE_SIZE (node4) = size;
 			}
 		      decl = build_fold_indirect_ref (decl);
-		      if ((TREE_CODE (TREE_TYPE (orig_decl)) == REFERENCE_TYPE
+		      if ((TYPE_REF_P (TREE_TYPE (orig_decl))
 			   || gfc_omp_is_optional_argument (orig_decl))
 			  && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)
 			      || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
diff --git a/gcc/gimple.cc b/gcc/gimple.cc
index e0ba42add39..1c1ff796465 100644
--- a/gcc/gimple.cc
+++ b/gcc/gimple.cc
@@ -1706,7 +1706,7 @@ gimple_call_nonnull_result_p (gcall *call)
 
   /* References are always non-NULL.  */
   if (flag_delete_null_pointer_checks
-      && TREE_CODE (TREE_TYPE (fndecl)) == REFERENCE_TYPE)
+      && TYPE_REF_P (TREE_TYPE (fndecl)))
     return true;
 
   if (flag_delete_null_pointer_checks
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 36e5df050b9..b3ff91b3bd2 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -1861,7 +1861,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
       && !TYPE_SIZES_GIMPLIFIED (TREE_TYPE (decl)))
     {
       gimplify_type_sizes (TREE_TYPE (decl), seq_p);
-      if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (TREE_TYPE (decl)))
 	gimplify_type_sizes (TREE_TYPE (TREE_TYPE (decl)), seq_p);
     }
 
@@ -1872,7 +1872,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
       && !TYPE_SIZES_GIMPLIFIED (DECL_ORIGINAL_TYPE (decl)))
     {
       gimplify_type_sizes (DECL_ORIGINAL_TYPE (decl), seq_p);
-      if (TREE_CODE (DECL_ORIGINAL_TYPE (decl)) == REFERENCE_TYPE)
+      if (TYPE_REF_P (DECL_ORIGINAL_TYPE (decl)))
 	gimplify_type_sizes (TREE_TYPE (DECL_ORIGINAL_TYPE (decl)), seq_p);
     }
 
@@ -7905,7 +7905,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code)
 		  else if (lang_hooks.decls.omp_scalar_p (decl, false))
 		    gdmk = GDMK_SCALAR;
 		  else if (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE
-			   || (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE
+			   || (TYPE_REF_P (TREE_TYPE (decl))
 			       && (TREE_CODE (TREE_TYPE (TREE_TYPE (decl)))
 				   == POINTER_TYPE)))
 		    gdmk = GDMK_POINTER;
@@ -10418,7 +10418,7 @@ omp_accumulate_sibling_list (enum omp_region_type region_type,
 				    ptrdiff_type_node, baddr);
 	  /* This isn't going to be good enough when we add support for more
 	     complicated lvalue expressions.  FIXME.  */
-	  if (TREE_CODE (TREE_TYPE (sdecl)) == REFERENCE_TYPE
+	  if (TYPE_REF_P (TREE_TYPE (sdecl))
 	      && TREE_CODE (TREE_TYPE (TREE_TYPE (sdecl))) == POINTER_TYPE)
 	    sdecl = build_simple_mem_ref (sdecl);
 	  tree decladdr = fold_convert_loc (OMP_CLAUSE_LOCATION (grp_end),
@@ -10677,7 +10677,7 @@ omp_build_struct_sibling_lists (enum tree_code code,
 	    }
 
 	  tree stype = TREE_TYPE (decl);
-	  if (TREE_CODE (stype) == REFERENCE_TYPE)
+	  if (TYPE_REF_P (stype))
 	    stype = TREE_TYPE (stype);
 	  if (TYPE_SIZE_UNIT (stype) == NULL
 	      || TREE_CODE (TYPE_SIZE_UNIT (stype)) != INTEGER_CST)
@@ -11801,7 +11801,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
 		  if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
 		      && TREE_CODE (OMP_CLAUSE_DECL (c)) == MEM_REF
 		      && (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE
-			  || (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE
+			  || (TYPE_REF_P (TREE_TYPE (decl))
 			      && (TREE_CODE (TREE_TYPE (TREE_TYPE (decl)))
 				  == POINTER_TYPE))))
 		    omp_firstprivatize_variable (outer_ctx, decl);
@@ -12184,7 +12184,7 @@ omp_shared_to_firstprivate_optimizable_decl_p (tree decl)
     return false;
   tree type = TREE_TYPE (decl);
   if (!is_gimple_reg_type (type)
-      || TREE_CODE (type) == REFERENCE_TYPE
+      || TYPE_REF_P (type)
       || TREE_ADDRESSABLE (type))
     return false;
   /* Don't optimize too large decls, as each thread/task will have
@@ -12432,7 +12432,7 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
     {
       tree nc = build_omp_clause (input_location, OMP_CLAUSE_MAP);
       OMP_CLAUSE_DECL (nc) = decl;
-      if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE
+      if (TYPE_REF_P (TREE_TYPE (decl))
 	  && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == POINTER_TYPE)
 	OMP_CLAUSE_DECL (clause)
 	  = build_simple_mem_ref_loc (input_location, decl);
@@ -13591,7 +13591,7 @@ gimplify_omp_taskloop_expr (tree type, tree *tp, gimple_seq *pre_p,
      here.  */
   if (type
       && TREE_CODE (type) == POINTER_TYPE
-      && TREE_CODE (TREE_TYPE (*tp)) == REFERENCE_TYPE)
+      && TYPE_REF_P (TREE_TYPE (*tp)))
     {
       tree v = create_tmp_var (TYPE_MAIN_VARIANT (type));
       tree m = build2 (INIT_EXPR, TREE_TYPE (v), v, *tp);
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index ff9657a6e06..1a2417e8592 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -771,7 +771,7 @@ find_decls_types_r (tree *tp, int *ws, void *data)
 	 in them.  */
       if (TREE_CODE (t) == POINTER_TYPE)
 	fld_worklist_push (TYPE_NEXT_PTR_TO (t), fld);
-      if (TREE_CODE (t) == REFERENCE_TYPE)
+      if (TYPE_REF_P (t))
 	fld_worklist_push (TYPE_NEXT_REF_TO (t), fld);
       if (!POINTER_TYPE_P (t))
 	fld_worklist_push (TYPE_MIN_VALUE_RAW (t), fld);
diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index c35e03b7abd..e203d8941ff 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -1206,7 +1206,7 @@ create_parameter_descriptors (cgraph_node *node,
       if (POINTER_TYPE_P (type))
 	{
 	  desc->by_ref = true;
-	  if (TREE_CODE (type) == REFERENCE_TYPE
+	  if (TYPE_REF_P (type)
 	      || (num == 0
 		  && TREE_CODE (TREE_TYPE (node->decl)) == METHOD_TYPE))
 	    desc->safe_ref = true;
diff --git a/gcc/langhooks.cc b/gcc/langhooks.cc
index 9a1a9eccca9..e3030286ecc 100644
--- a/gcc/langhooks.cc
+++ b/gcc/langhooks.cc
@@ -650,7 +650,7 @@ bool
 lhd_omp_scalar_p (tree decl, bool ptr_ok)
 {
   tree type = TREE_TYPE (decl);
-  if (TREE_CODE (type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (type))
     type = TREE_TYPE (type);
   if (TREE_CODE (type) == COMPLEX_TYPE)
     type = TREE_TYPE (type);
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc
index 703e665b698..207a5d4f926 100644
--- a/gcc/lto/lto-common.cc
+++ b/gcc/lto/lto-common.cc
@@ -998,7 +998,7 @@ lto_fixup_prevailing_type (tree t)
 	  TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (TREE_TYPE (t));
 	  TYPE_POINTER_TO (TREE_TYPE (t)) = t;
 	}
-      else if (TREE_CODE (t) == REFERENCE_TYPE && !TYPE_REF_IS_RVALUE (t))
+      else if (TYPE_REF_P (t) && !TYPE_REF_IS_RVALUE (t))
 	{
 	  TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (TREE_TYPE (t));
 	  TYPE_REFERENCE_TO (TREE_TYPE (t)) = t;
diff --git a/gcc/m2/gm2-gcc/m2tree.cc b/gcc/m2/gm2-gcc/m2tree.cc
index 99405123290..2c87945ec06 100644
--- a/gcc/m2/gm2-gcc/m2tree.cc
+++ b/gcc/m2/gm2-gcc/m2tree.cc
@@ -95,7 +95,7 @@ m2tree_skip_const_decl (tree exp)
 tree
 m2tree_skip_reference_type (tree exp)
 {
-  if (TREE_CODE (exp) == REFERENCE_TYPE)
+  if (TYPE_REF_P (exp))
     return m2tree_skip_reference_type (TREE_TYPE (exp));
   if (TREE_CODE (exp) == POINTER_TYPE)
     return m2tree_skip_reference_type (TREE_TYPE (exp));
diff --git a/gcc/m2/gm2-gcc/m2treelib.cc b/gcc/m2/gm2-gcc/m2treelib.cc
index 6694af66d8b..56231701f7a 100644
--- a/gcc/m2/gm2-gcc/m2treelib.cc
+++ b/gcc/m2/gm2-gcc/m2treelib.cc
@@ -302,7 +302,7 @@ m2treelib_get_set_value (location_t location, tree p, tree field, bool is_const,
             field);
       else
         {
-          ASSERT_CONDITION (TREE_CODE (TREE_TYPE (p)) == REFERENCE_TYPE);
+          ASSERT_CONDITION (TYPE_REF_P (TREE_TYPE (p)));
           value = m2expr_BuildComponentRef (location, p, field);
         }
     }
diff --git a/gcc/m2/m2pp.cc b/gcc/m2/m2pp.cc
index 52a29384e8d..d87995affe7 100644
--- a/gcc/m2/m2pp.cc
+++ b/gcc/m2/m2pp.cc
@@ -905,7 +905,7 @@ m2pp_parameter (pretty *s, tree t)
 {
   if (TREE_CODE (t) == PARM_DECL)
     {
-      if (TREE_TYPE (t) && (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
+      if (TREE_TYPE (t) && TYPE_REF_P (TREE_TYPE (t)))
         {
           m2pp_print (s, "VAR");
           m2pp_needspace (s);
@@ -929,7 +929,7 @@ m2pp_parameter (pretty *s, tree t)
 static void
 m2pp_param_type (pretty *s, tree t)
 {
-  if (t && (TREE_CODE (t) == REFERENCE_TYPE))
+  if (t && TYPE_REF_P (t))
     {
       m2pp_print (s, "VAR");
       m2pp_needspace (s);
diff --git a/gcc/match.pd b/gcc/match.pd
index 054e6585876..5f7627c8d5e 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6343,7 +6343,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	 /* Don't perform this optimization in GENERIC if @0 has reference
 	    type when sanitizing.  See PR101210.  */
 	 && !(GENERIC
-	      && TREE_CODE (TREE_TYPE (@0)) == REFERENCE_TYPE
+	      && TYPE_REF_P (TREE_TYPE (@0))
 	      && (flag_sanitize & (SANITIZE_NULL | SANITIZE_ALIGNMENT))))
 	|| (INTEGRAL_TYPE_P (TREE_TYPE (@0))
 	    && POINTER_TYPE_P (TREE_TYPE (@1))
diff --git a/gcc/objc/objc-act.cc b/gcc/objc/objc-act.cc
index e4c49e664e1..528a4ae812a 100644
--- a/gcc/objc/objc-act.cc
+++ b/gcc/objc/objc-act.cc
@@ -6374,7 +6374,7 @@ add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
   tree field_type = TREE_TYPE (field_decl);
 
 #ifdef OBJCPLUS
-  if (TREE_CODE (field_type) == REFERENCE_TYPE)
+  if (TYPE_REF_P (field_type))
     {
       error ("illegal reference type specified for instance variable %qs",
 	     printable_ivar_name (field_decl));
diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc
index b882df048ef..5dd9b77c873 100644
--- a/gcc/omp-low.cc
+++ b/gcc/omp-low.cc
@@ -1298,7 +1298,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
 		  && (!is_global_var (maybe_lookup_decl_in_outer_ctx (t, ctx))
 		      || (is_task_ctx (ctx)
 			  && (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
-			      || (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE
+			      || (TYPE_REF_P (TREE_TYPE (t))
 				  && (TREE_CODE (TREE_TYPE (TREE_TYPE (t)))
 				      == POINTER_TYPE)))))
 		  && !is_variable_sized (t)
@@ -1308,7 +1308,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
 		{
 		  by_ref = use_pointer_for_field (t, NULL);
 		  if (is_task_ctx (ctx)
-		      && TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE
+		      && TYPE_REF_P (TREE_TYPE (t))
 		      && TREE_CODE (TREE_TYPE (TREE_TYPE (t))) == POINTER_TYPE)
 		    {
 		      install_var_field (t, false, 1, ctx);
@@ -5306,7 +5306,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 		    {
 		      bool by_ref = use_pointer_for_field (var, NULL);
 		      x = build_receiver_ref (var, by_ref, ctx);
-		      if (TREE_CODE (TREE_TYPE (var)) == REFERENCE_TYPE
+		      if (TYPE_REF_P (TREE_TYPE (var))
 			  && (TREE_CODE (TREE_TYPE (TREE_TYPE (var)))
 			      == POINTER_TYPE))
 			x = build_fold_addr_expr (x);
@@ -12200,7 +12200,7 @@ create_task_copyfn (gomp_task *task_stmt, omp_context *ctx)
 	src = build_simple_mem_ref_loc (loc, sarg);
 	src = omp_build_component_ref (src, sf);
 	if (decl != OMP_CLAUSE_DECL (c)
-	    && TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE
+	    && TYPE_REF_P (TREE_TYPE (decl))
 	    && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == POINTER_TYPE)
 	  src = build_simple_mem_ref_loc (loc, src);
 	dst = build_simple_mem_ref_loc (loc, arg);
@@ -13313,7 +13313,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 	      {
 		gcc_checking_assert (is_gimple_omp_oacc (ctx->stmt));
 		s = TREE_TYPE (ovar);
-		if (TREE_CODE (s) == REFERENCE_TYPE
+		if (TYPE_REF_P (s)
 		    || omp_check_optional_argument (ovar, false))
 		  s = TREE_TYPE (s);
 		s = TYPE_SIZE_UNIT (s);
@@ -14046,7 +14046,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		else if (TREE_CODE (OMP_CLAUSE_DECL (c)) == COMPONENT_REF)
 		  {
 		    type = TREE_TYPE (OMP_CLAUSE_DECL (c));
-		    is_ref = TREE_CODE (type) == REFERENCE_TYPE;
+		    is_ref = TYPE_REF_P (type);
 		    new_var = build2 (MEM_REF, type,
 				      build_fold_addr_expr (new_var),
 				      build_int_cst (build_pointer_type (type),
@@ -14076,7 +14076,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		    new_var = decl2;
 		    type = TREE_TYPE (new_var);
 		  }
-		else if (TREE_CODE (type) == REFERENCE_TYPE
+		else if (TYPE_REF_P (type)
 			 && TREE_CODE (TREE_TYPE (type)) == POINTER_TYPE)
 		  {
 		    type = TREE_TYPE (type);
@@ -14617,8 +14617,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 	  tree lhs = get_base_address (gimple_assign_lhs (stmt));
 	  if (TREE_CODE (lhs) == MEM_REF
 	      && DECL_P (TREE_OPERAND (lhs, 0))
-	      && TREE_CODE (TREE_TYPE (TREE_OPERAND (lhs,
-						     0))) == REFERENCE_TYPE)
+	      && TYPE_REF_P (TREE_TYPE (TREE_OPERAND (lhs, 0))))
 	    lhs = TREE_OPERAND (lhs, 0);
 	  if (DECL_P (lhs))
 	    if (tree *v = up->lastprivate_conditional_map->get (lhs))
diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc
index c1cb7cc8a5c..a3046ed44d2 100644
--- a/gcc/omp-simd-clone.cc
+++ b/gcc/omp-simd-clone.cc
@@ -365,7 +365,7 @@ simd_clone_clauses_extract (struct cgraph_node *node, tree clauses,
 	    if (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (t))
 	      {
 		enum cgraph_simd_clone_arg_type arg_type;
-		if (TREE_CODE (args[argno]) == REFERENCE_TYPE)
+		if (TYPE_REF_P (args[argno]))
 		  switch (OMP_CLAUSE_LINEAR_KIND (t))
 		    {
 		    case OMP_CLAUSE_LINEAR_REF:
@@ -410,7 +410,7 @@ simd_clone_clauses_extract (struct cgraph_node *node, tree clauses,
 		else
 		  {
 		    enum cgraph_simd_clone_arg_type arg_type;
-		    if (TREE_CODE (args[argno]) == REFERENCE_TYPE)
+		    if (TYPE_REF_P (args[argno]))
 		      switch (OMP_CLAUSE_LINEAR_KIND (t))
 			{
 			case OMP_CLAUSE_LINEAR_REF:
@@ -1392,7 +1392,7 @@ simd_clone_linear_addend (struct cgraph_node *node, unsigned int i,
       gsi_insert_before (&gsi, g, GSI_SAME_STMT);
       ret = gimple_assign_lhs (g);
     }
-  if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE)
+  if (TYPE_REF_P (TREE_TYPE (arg)))
     {
       g = gimple_build_assign (make_ssa_name (TREE_TYPE (TREE_TYPE (arg))),
 			       build_simple_mem_ref (ret));
@@ -1823,7 +1823,7 @@ simd_clone_adjust (struct cgraph_node *node)
 	tree orig_arg = node->simdclone->args[i].orig_arg;
 	tree def = ssa_default_def (cfun, orig_arg);
 	gcc_assert (!TREE_ADDRESSABLE (orig_arg)
-		    && TREE_CODE (TREE_TYPE (orig_arg)) == REFERENCE_TYPE);
+		    && TYPE_REF_P (TREE_TYPE (orig_arg)));
 	if (def && !has_zero_uses (def))
 	  {
 	    tree rtype = TREE_TYPE (TREE_TYPE (orig_arg));
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 954b39ae1c6..95c7c360529 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -432,7 +432,7 @@ remap_type_1 (tree type, copy_body_data *id)
       insert_decl_map (id, type, new_tree);
       return new_tree;
     }
-  else if (TREE_CODE (type) == REFERENCE_TYPE)
+  else if (TYPE_REF_P (type))
     {
       new_tree = build_reference_type_for_mode (remap_type (TREE_TYPE (type), id),
 					    TYPE_MODE (type),
diff --git a/gcc/tree.cc b/gcc/tree.cc
index 420857b110c..634a1820613 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -10050,7 +10050,7 @@ reconstruct_complex_type (tree type, tree bottom)
       outer = build_pointer_type_for_mode (inner, TYPE_MODE (type),
 					   TYPE_REF_CAN_ALIAS_ALL (type));
     }
-  else if (TREE_CODE (type) == REFERENCE_TYPE)
+  else if (TYPE_REF_P (type))
     {
       inner = reconstruct_complex_type (TREE_TYPE (type), bottom);
       outer = build_reference_type_for_mode (inner, TYPE_MODE (type),
@@ -13387,7 +13387,7 @@ verify_type_variant (const_tree t, tree tv)
   /* FIXME: TYPE_SIZES_GIMPLIFIED may differs for Ada build.  */
   verify_variant_match (TYPE_UNSIGNED);
   verify_variant_match (TYPE_PACKED);
-  if (TREE_CODE (t) == REFERENCE_TYPE)
+  if (TYPE_REF_P (t))
     verify_variant_match (TYPE_REF_IS_RVALUE);
   if (AGGREGATE_TYPE_P (t))
     verify_variant_match (TYPE_REVERSE_STORAGE_ORDER);
@@ -14033,7 +14033,7 @@ verify_type (const_tree t)
 	  error_found = true;
 	}
     }
-  else if (TREE_CODE (t) == REFERENCE_TYPE)
+  else if (TYPE_REF_P (t))
     {
       if (TYPE_NEXT_REF_TO (t)
 	  && TREE_CODE (TYPE_NEXT_REF_TO (t)) != REFERENCE_TYPE)
@@ -14202,7 +14202,7 @@ verify_type (const_tree t)
   else if (TREE_CODE (t) == INTEGER_TYPE
 	   || TREE_CODE (t) == BOOLEAN_TYPE
 	   || TREE_CODE (t) == OFFSET_TYPE
-	   || TREE_CODE (t) == REFERENCE_TYPE
+	   || TYPE_REF_P (t)
 	   || TREE_CODE (t) == NULLPTR_TYPE
 	   || TREE_CODE (t) == POINTER_TYPE)
     {
@@ -14395,7 +14395,7 @@ nonnull_arg_p (const_tree arg)
     return true;
 
   /* Values passed by reference are always non-NULL.  */
-  if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE
+  if (TYPE_REF_P (TREE_TYPE (arg))
       && flag_delete_null_pointer_checks)
     return true;
 
diff --git a/gcc/tree.h b/gcc/tree.h
index ca3e0ce8f5e..d0d19153f91 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -687,7 +687,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
    ascending code order.  */
 
 #define POINTER_TYPE_P(TYPE) \
-  (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
+  (TREE_CODE (TYPE) == POINTER_TYPE || TYPE_REF_P (TYPE))
 
 /* Nonzero if TYPE represents a pointer to function.  */
 #define FUNCTION_POINTER_TYPE_P(TYPE) \
diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc
index d8dafa5481a..83e428fbc10 100644
--- a/gcc/var-tracking.cc
+++ b/gcc/var-tracking.cc
@@ -6282,7 +6282,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
 	{
 	  for (t = TYPE_ARG_TYPES (type); t && t != void_list_node;
 	       t = TREE_CHAIN (t))
-	    if (TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE
+	    if (TYPE_REF_P (TREE_VALUE (t))
 		&& INTEGRAL_TYPE_P (TREE_TYPE (TREE_VALUE (t))))
 	      break;
 	  if ((t == NULL || t == void_list_node) && obj_type_ref == NULL_TREE)
@@ -6433,7 +6433,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
 	    function_arg_info arg (TREE_VALUE (t), /*named=*/true);
 	    apply_pass_by_reference_rules (&args_so_far_v, arg);
 	    reg = targetm.calls.function_arg (args_so_far, arg);
-	    if (TREE_CODE (arg.type) == REFERENCE_TYPE
+	    if (TYPE_REF_P (arg.type)
 		&& INTEGRAL_TYPE_P (TREE_TYPE (arg.type))
 		&& reg
 		&& REG_P (reg)
@@ -9870,7 +9870,7 @@ vt_add_function_parameter (tree parm)
       if (dv_is_value_p (dv))
 	{
 	  record_entry_value (CSELIB_VAL_PTR (dv_as_value (dv)), incoming);
-	  if (TREE_CODE (TREE_TYPE (parm)) == REFERENCE_TYPE
+	  if (TYPE_REF_P (TREE_TYPE (parm))
 	      && INTEGRAL_TYPE_P (TREE_TYPE (TREE_TYPE (parm))))
 	    {
 	      machine_mode indmode
-- 
2.41.0


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

* [PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
  2023-07-18 23:12 ` [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h Ken Matsui
  2023-07-18 23:12 ` [PATCH 2/8] gcc: Use TYPE_REF_P Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P " Ken Matsui
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

This patch moves TYPE_PTR_P from cp/cp-tree.h to tree.h to unify
POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P in cp/cp-tree.h, which are
equivalent.

gcc/cp/ChangeLog:

	* cp-tree.h (TYPE_PTR_P): Remove.

gcc/ChangeLog:

	* tree.h (TYPE_PTR_P): Define.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/cp/cp-tree.h | 4 ----
 gcc/tree.h       | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 8c96d868650..681aa95e57f 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4706,10 +4706,6 @@ get_vec_init_expr (tree t)
 #define TYPE_PTRDATAMEM_P(NODE)			\
   (TREE_CODE (NODE) == OFFSET_TYPE)
 
-/* Returns true if NODE is a pointer.  */
-#define TYPE_PTR_P(NODE)			\
-  (TREE_CODE (NODE) == POINTER_TYPE)
-
 /* Returns true if NODE is a pointer or a reference.  */
 #define INDIRECT_TYPE_P(NODE)			\
   (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
diff --git a/gcc/tree.h b/gcc/tree.h
index d0d19153f91..48d57764d9c 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -678,6 +678,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define AGGREGATE_TYPE_P(TYPE) \
   (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
 
+/* Nonzero if this type is a pointer.  */
+#define TYPE_PTR_P(NODE)			\
+  (TREE_CODE (NODE) == POINTER_TYPE)
+
 /* Nonzero if this type is a reference.  */
 #define TYPE_REF_P(NODE)			\
   (TREE_CODE (NODE) == REFERENCE_TYPE)
-- 
2.41.0


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

* [PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P to tree.h
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (2 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 5/8] gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P Ken Matsui
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

This patch moves INDIRECT_TYPE_P from cp/cp-tree.h to tree.h to unify
POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P, which are equivalent.

gcc/cp/ChangeLog:

	* cp-tree.h (INDIRECT_TYPE_P): Remove.

gcc/ChangeLog:

	* tree.h (INDIRECT_TYPE_P): Define.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/cp/cp-tree.h | 4 ----
 gcc/tree.h       | 5 +++++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 681aa95e57f..5236b168ecc 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4706,10 +4706,6 @@ get_vec_init_expr (tree t)
 #define TYPE_PTRDATAMEM_P(NODE)			\
   (TREE_CODE (NODE) == OFFSET_TYPE)
 
-/* Returns true if NODE is a pointer or a reference.  */
-#define INDIRECT_TYPE_P(NODE)			\
-  (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
-
 /* Returns true if NODE is an object type:
 
      [basic.types]
diff --git a/gcc/tree.h b/gcc/tree.h
index 48d57764d9c..c369b8470ab 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -686,6 +686,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define TYPE_REF_P(NODE)			\
   (TREE_CODE (NODE) == REFERENCE_TYPE)
 
+/* Nonzero if TYPE represents a pointer or reference type.
+   Keep these checks in ascending code order.  */
+#define INDIRECT_TYPE_P(NODE)			\
+  (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
+
 /* Nonzero if TYPE represents a pointer or reference type.
    (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
    ascending code order.  */
-- 
2.41.0


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

* [PATCH 5/8] gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (3 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P " Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 6/8] tree: Remove POINTER_TYPE_P Ken Matsui
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

gcc/ada/ChangeLog:

	* gcc-interface/ada-tree.h (TYPE_IS_THIN_POINTER_P): Use
	INDIRECT_TYPE_P instead of POINTER_TYPE_P.
	* gcc-interface/decl.cc (gnat_to_gnu_entity): Likewise.
	(gnat_to_gnu_subprog_type): Likewise.
	(array_type_has_nonaliased_component): Likewise.
	* gcc-interface/trans.cc (is_array_of_scalar_type): Likewise.
	(return_slot_opt_for_pure_call_p): Likewise.
	(gnat_to_gnu): Likewise.
	(validate_unchecked_conversion): Likewise.
	* gcc-interface/utils.cc (create_var_decl): Likewise.
	(unchecked_convert): Likewise.
	(handle_malloc_attribute): Likewise.
	(handle_vector_size_attribute): Likewise.
	* gcc-interface/utils2.cc (known_alignment): Likewise.
	(build_binary_op): Likewise.
	(build_unary_op): Likewise.

gcc/ChangeLog:

	* alias.cc (get_alias_set): Use INDIRECT_TYPE_P instead of
	POINTER_TYPE_P.
	(record_component_aliases): Likewise.
	* asan.cc (maybe_update_mem_ref_hash_table): Likewise.
	(instrument_mem_region_access): Likewise.
	* builtins.cc (get_pointer_alignment_1): Likewise.
	(get_memory_rtx): Likewise.
	(std_canonical_va_list_type): Likewise.
	(get_builtin_sync_mem): Likewise.
	(fold_builtin_atomic_always_lock_free): Likewise.
	(builtin_mathfn_code): Likewise.
	(fold_builtin_constant_p): Likewise.
	(validate_arg): Likewise.
	(maybe_emit_sprintf_chk_warning): Likewise.
	* calls.cc (expand_call): Likewise.
	* cfgexpand.cc (update_alias_info_with_stack_vars): Likewise.
	(adjust_one_expanded_partition_var): Likewise.
	(expand_one_register_var): Likewise.
	* cgraph.cc (cgraph_node::verify_node): Likewise.
	* cgraphunit.cc (maybe_diag_incompatible_alias): Likewise.
	* config/aarch64/aarch64-builtins.cc (aarch64_simd_expand_args): Likewise.
	* config/aarch64/aarch64-sve-builtins.cc (function_resolver::scalar_argument_p): Likewise.
	* config/aarch64/aarch64.cc (aarch64_function_arg_alignment): Likewise.
	(aarch64_function_arg_padding): Likewise.
	(supported_simd_type): Likewise.
	* config/arc/arc.cc (arc_expand_builtin_aligned): Likewise.
	* config/arm/arm-builtins.cc (neon_dereference_pointer): Likewise.
	(mve_dereference_pointer): Likewise.
	(arm_general_expand_builtin_args): Likewise.
	* config/arm/arm-mve-builtins.cc (function_resolver::scalar_argument_p): Likewise.
	* config/avr/avr.cc (avr_nonconst_pointer_addrspace): Likewise.
	(avr_convert_to_type): Likewise.
	* config/epiphany/epiphany.cc (epiphany_function_ok_for_sibcall): Likewise.
	* config/gcn/gcn.cc (gcn_addr_space_convert): Likewise.
	(gcn_detect_incoming_pointer_arg): Likewise.
	* config/i386/i386-builtins.cc (ix86_vectorize_builtin_gather): Likewise.
	* config/i386/i386-options.cc (ix86_handle_interrupt_attribute): Likewise.
	* config/i386/i386.cc (ix86_function_arg): Likewise.
	(function_value_64): Likewise.
	(ix86_promote_function_mode): Likewise.
	(ix86_vectorize_builtin_scatter): Likewise.
	(ix86_canonical_va_list_type): Likewise.
	* config/m32c/m32c.cc (m32c_function_arg): Likewise.
	* config/m68k/m68k.cc (m68k_function_value): Likewise.
	* config/mips/mips.cc (mips_function_arg_padding): Likewise.
	* config/mn10300/mn10300.cc (mn10300_function_value): Likewise.
	* config/msp430/msp430.cc (msp430_gimplify_va_arg_expr): Likewise.
	* config/nios2/nios2.cc (nios2_function_arg_padding): Likewise.
	* config/pa/pa.cc (pa_emit_move_sequence): Likewise.
	(pa_function_value): Likewise.
	* config/pru/pru-passes.cc (chkp_type_has_function_pointer): Likewise.
	* config/pru/pru.cc (pru_nongeneric_pointer_addrspace): Likewise.
	* config/rs6000/rs6000-builtin.cc (rs6000_type_string): Likewise.
	(rs6000_expand_ldst_mask): Likewise.
	* config/rs6000/rs6000-c.cc (rs6000_builtin_type_compatible): Likewise.
	(altivec_resolve_overloaded_builtin): Likewise.
	* config/rs6000/rs6000.cc (rs6000_handle_altivec_attribute): Likewise.
	(rs6000_function_value): Likewise.
	* config/s390/s390-c.cc (s390_fn_types_compatible): Likewise.
	* config/s390/s390.cc (s390_check_type_for_vector_abi): Likewise.
	(s390_expand_builtin): Likewise.
	(s390_handle_vectorbool_attribute): Likewise.
	(s390_function_arg_integer): Likewise.
	(s390_return_in_memory): Likewise.
	(s390_promote_function_mode): Likewise.
	* config/sparc/sparc.cc (sparc_promote_function_mode): Likewise.
	* convert.cc (convert_to_integer_1): Likewise.
	* dojump.cc (do_compare_and_jump): Likewise.
	* dwarf2out.cc (loc_list_from_tree_1): Likewise.
	* emit-rtl.cc (set_mem_attributes_minus_bitpos): Likewise.
	* expmed.cc (make_tree): Likewise.
	* expr.cc (expand_assignment): Likewise.
	(expand_expr_addr_expr): Likewise.
	(expand_expr_real_2): Likewise.
	(constant_byte_string): Likewise.
	(do_store_flag): Likewise.
	* fold-const.cc (int_binop_types_match_p): Likewise.
	(fold_convert_const_int_from_int): Likewise.
	(fold_convert_const): Likewise.
	(fold_convertible_p): Likewise.
	(fold_convert_loc): Likewise.
	(operand_compare::operand_equal_p): Likewise.
	(make_bit_field_ref): Likewise.
	(range_check_type): Likewise.
	(build_range_check): Likewise.
	(fold_to_nonsharp_ineq_using_bound): Likewise.
	(fold_unary_loc): Likewise.
	(maybe_canonicalize_comparison_1): Likewise.
	(pointer_may_wrap_p): Likewise.
	(fold_comparison): Likewise.
	(tree_expr_nonzero_warnv_p): Likewise.
	(fold_binary_loc): Likewise.
	(fold_indirect_ref_1): Likewise.
	(address_compare): Likewise.
	* function-abi.cc (expr_callee_abi): Likewise.
	* function.cc (assign_parm_adjust_stack_rtl): Likewise.
	(assign_parm_setup_reg): Likewise.
	(used_types_insert): Likewise.
	* gimple-array-bounds.cc (get_ref_size): Likewise.
	(trailing_array): Likewise.
	(array_bounds_checker::check_mem_ref): Likewise.
	* gimple-expr.cc (useless_type_conversion_p): Likewise.
	* gimple-fold.cc (gimple_fold_builtin_memory_op): Likewise.
	(gimple_fold_builtin_memset): Likewise.
	(gimple_fold_builtin_sprintf_chk): Likewise.
	(gimple_fold_builtin_sprintf): Likewise.
	(gimple_fold_builtin_fprintf): Likewise.
	(gimple_fold_builtin_printf): Likewise.
	(follow_outer_ssa_edges): Likewise.
	(gimple_fold_indirect_ref): Likewise.
	* gimple-loop-versioning.cc (look_through_cast_p): Likewise.
	(loop_versioning::analyze_address_fragment): Likewise.
	* gimple-low.cc (lower_builtin_assume_aligned): Likewise.
	* gimple-pretty-print.cc (dump_ssaname_info): Likewise.
	* gimple-range-cache.cc (sbr_sparse_bitmap::sbr_sparse_bitmap): Likewise.
	(ranger_cache::set_global_range): Likewise.
	* gimple-range-fold.cc (fold_using_range::range_of_phi): Likewise.
	* gimple-range-infer.cc (gimple_infer_range::gimple_infer_range): Likewise.
	* gimple-range-path.cc (path_range_query::range_defined_in_block): Likewise.
	(path_range_query::adjust_for_non_null_uses): Likewise.
	* gimple-ssa-isolate-paths.cc (stmt_uses_name_in_undefined_way): Likewise.
	(is_addr_local): Likewise.
	* gimple-ssa-nonnull-compare.cc (do_warn_nonnull_compare): Likewise.
	* gimple-ssa-sprintf.cc (get_origin_and_offset_r): Likewise.
	(handle_printf_call): Likewise.
	* gimple-ssa-store-merging.cc (init_symbolic_number): Likewise.
	(bswap_view_convert): Likewise.
	* gimple-ssa-strength-reduction.cc (slsr_process_add): Likewise.
	(find_candidates_dom_walker::before_dom_children): Likewise.
	(create_add_on_incoming_edge): Likewise.
	(analyze_increments): Likewise.
	(insert_initializers): Likewise.
	(analyze_candidates_and_replace): Likewise.
	* gimple-ssa-warn-access.cc (check_access): Likewise.
	(pass_waccess::check_call_access): Likewise.
	(pass_waccess::check_dangling_uses): Likewise.
	* gimple-ssa-warn-restrict.cc (builtin_memref::set_base_and_offset): Likewise.
	(builtin_access::generic_overlap): Likewise.
	(maybe_diag_access_bounds): Likewise.
	* gimple.cc (gimple_build_call_from_tree): Likewise.
	(infer_nonnull_range_by_dereference): Likewise.
	(infer_nonnull_range_by_attribute): Likewise.
	* gimplify.cc (canonicalize_addr_expr): Likewise.
	(gimplify_self_mod_expr): Likewise.
	(gimplify_init_ctor_preeval_1): Likewise.
	(gimplify_modify_expr): Likewise.
	(gimplify_omp_depend): Likewise.
	(omp_accumulate_sibling_list): Likewise.
	(gimplify_scan_omp_clauses): Likewise.
	(gimplify_omp_for): Likewise.
	(gimplify_va_arg_expr): Likewise.
	* godump.cc (go_format_type): Likewise.
	* graphite-isl-ast-to-gimple.cc (gcc_expression_from_isl_ast_expr_id): Likewise.
	(translate_isl_ast_node_for): Likewise.
	* graphite-sese-to-poly.cc (add_param_constraints): Likewise.
	* ipa-cp.cc (propagate_bits_across_jump_function): Likewise.
	(propagate_vr_across_jump_function): Likewise.
	* ipa-devirt.cc (compound_type_base): Likewise.
	(warn_types_mismatch): Likewise.
	(odr_types_equivalent_p): Likewise.
	* ipa-free-lang-data.cc (fld_incomplete_type_of): Likewise.
	(fld_simplified_type): Likewise.
	(find_decls_types_r): Likewise.
	* ipa-icf-gimple.cc (func_checker::compatible_polymorphic_types_p): Likewise.
	* ipa-icf.cc (sem_function::compatible_parm_types_p): Likewise.
	(sem_item_optimizer::fixup_points_to_sets): Likewise.
	* ipa-modref-tree.cc (modref_access_node::get_ao_ref): Likewise.
	* ipa-modref.cc (modref_access_analysis::process_fnspec): Likewise.
	(propagate_unknown_call): Likewise.
	* ipa-param-manipulation.cc (ipa_param_adjustments::modify_call): Likewise.
	(ipa_param_body_adjustments::modify_call_stmt): Likewise.
	* ipa-polymorphic-call.cc (ipa_polymorphic_call_context::restrict_to_inner_class): Likewise.
	(ipa_polymorphic_call_context::ipa_polymorphic_call_context): Likewise.
	(noncall_stmt_may_be_vtbl_ptr_store): Likewise.
	* ipa-prop.cc (stmt_may_be_vtbl_ptr_store): Likewise.
	(detect_type_change_ssa): Likewise.
	(parm_ref_data_pass_through_p): Likewise.
	(compute_complex_assign_jump_func): Likewise.
	(compute_complex_ancestor_jump_func): Likewise.
	(type_like_member_ptr_p): Likewise.
	(determine_known_aggregate_parts): Likewise.
	(ipa_compute_jump_functions_for_edge): Likewise.
	(ipa_analyze_indirect_call_uses): Likewise.
	(ipcp_update_bits): Likewise.
	* ipa-sra.cc (create_parameter_descriptors): Likewise.
	* lto-streamer-out.cc (DFS::DFS_write_tree_body): Likewise.
	(hash_tree): Likewise.
	* match.pd: Likewise.
	* omp-expand.cc (determine_parallel_type): Likewise.
	(expand_oacc_collapse_init): Likewise.
	(expand_oacc_collapse_vars): Likewise.
	(expand_omp_for_init_counts): Likewise.
	(expand_omp_for_init_vars): Likewise.
	(extract_omp_for_update_vars): Likewise.
	(expand_omp_ordered_sink): Likewise.
	(expand_omp_ordered_source_sink): Likewise.
	(expand_omp_for_ordered_loops): Likewise.
	(expand_omp_for_generic): Likewise.
	(expand_omp_for_static_nochunk): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_simd): Likewise.
	(expand_omp_taskloop_for_outer): Likewise.
	(expand_omp_taskloop_for_inner): Likewise.
	(expand_oacc_for): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	(expand_omp_atomic): Likewise.
	* omp-general.cc (omp_adjust_for_condition): Likewise.
	(omp_extract_for_data): Likewise.
	* omp-low.cc (install_var_field): Likewise.
	(scan_sharing_clauses): Likewise.
	(omp_reduction_init_op): Likewise.
	(lower_rec_input_clauses): Likewise.
	(lower_lastprivate_clauses): Likewise.
	(lower_oacc_reductions): Likewise.
	(lower_omp_ordered_clauses): Likewise.
	(lower_omp_target): Likewise.
	* omp-oacc-neuter-broadcast.cc (install_var_field): Likewise.
	(build_sender_ref): Likewise.
	(worker_single_copy): Likewise.
	* omp-offload.cc (pass_omp_target_link::execute): Likewise.
	* omp-simd-clone.cc (simd_clone_clauses_extract): Likewise.
	(simd_clone_adjust_return_type): Likewise.
	(simd_clone_adjust_argument_types): Likewise.
	(simd_clone_init_simd_arrays): Likewise.
	(simd_clone_linear_addend): Likewise.
	(simd_clone_adjust): Likewise.
	* pointer-query.cc (get_offset_range): Likewise.
	(gimple_parm_array_size): Likewise.
	(handle_decl): Likewise.
	(handle_component_ref): Likewise.
	(handle_ssa_name): Likewise.
	(compute_objsize_r): Likewise.
	* predict.cc (tree_predict_by_opcode): Likewise.
	(return_prediction): Likewise.
	* range-op.cc (operator_cast::op1_range): Likewise.
	* sese.cc (scev_analyzable_p): Likewise.
	* tree-affine.cc (aff_combination_scale): Likewise.
	(aff_combination_add_elt): Likewise.
	(aff_combination_convert): Likewise.
	(aff_combination_to_tree): Likewise.
	(print_aff): Likewise.
	* tree-cfg.cc (verify_types_in_gimple_reference): Likewise.
	(verify_gimple_call): Likewise.
	(verify_gimple_assign_unary): Likewise.
	(verify_gimple_assign_binary): Likewise.
	(verify_gimple_goto): Likewise.
	* tree-chrec.cc (chrec_fold_plus_poly_poly): Likewise.
	(chrec_fold_plus): Likewise.
	(chrec_apply): Likewise.
	(reset_evolution_in_loop): Likewise.
	(convert_affine_scev): Likewise.
	(chrec_convert_rhs): Likewise.
	(chrec_convert_aggressive): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.
	* tree-core.h (struct tree_ssa_name): Likewise.
	* tree-data-ref.cc (split_constant_offset_1): Likewise.
	(canonicalize_base_object_address): Likewise.
	(get_base_for_alignment_1): Likewise.
	* tree-dfa.cc (dump_variable): Likewise.
	* tree-if-conv.cc (if_convertible_gimple_assign_stmt_p): Likewise.
	(predicate_statements): Likewise.
	* tree-inline.cc (remap_ssa_name): Likewise.
	* tree-nested.cc (note_nonlocal_vla_type): Likewise.
	(remap_vla_decls): Likewise.
	(finalize_nesting_tree_1): Likewise.
	* tree-object-size.cc (compute_builtin_object_size): Likewise.
	(expr_object_size): Likewise.
	(parm_object_size): Likewise.
	(collect_object_sizes_for): Likewise.
	* tree-outof-ssa.cc (get_temp_reg): Likewise.
	* tree-pretty-print.cc (dump_mem_ref): Likewise.
	(dump_generic_node): Likewise.
	* tree-profile.cc (prepare_instrumented_value): Likewise.
	* tree-scalar-evolution.cc (simplify_peeled_chrec): Likewise.
	(simple_iv_with_niters): Likewise.
	(final_value_replacement_loop): Likewise.
	* tree-sra.cc (propagate_subaccesses_from_rhs): Likewise.
	* tree-ssa-address.cc (create_mem_ref_raw): Likewise.
	(move_pointer_to_base): Likewise.
	(add_to_parts): Likewise.
	* tree-ssa-alias.cc (ptr_deref_may_alias_decl_p): Likewise.
	(ptr_derefs_may_alias_p): Likewise.
	(dump_alias_info): Likewise.
	(ao_ref_init_from_ptr_and_range): Likewise.
	(same_type_for_tbaa): Likewise.
	(modref_may_conflict): Likewise.
	(check_fnspec): Likewise.
	* tree-ssa-ccp.cc (get_value_from_alignment): Likewise.
	(ccp_finalize): Likewise.
	(evaluate_stmt): Likewise.
	(optimize_stack_restore): Likewise.
	(optimize_stdarg_builtin): Likewise.
	(optimize_atomic_op_fetch_cmp_0): Likewise.
	* tree-ssa-copy.cc (fini_copy_prop): Likewise.
	* tree-ssa-dom.cc (maybe_set_nonzero_bits): Likewise.
	* tree-ssa-dse.cc (dse_optimize_call): Likewise.
	* tree-ssa-forwprop.cc (forward_propagate_addr_expr_1): Likewise.
	(constant_pointer_difference): Likewise.
	(pass_forwprop::execute): Likewise.
	* tree-ssa-ifcombine.cc (pass_tree_ifcombine::execute): Likewise.
	* tree-ssa-loop-ch.cc (should_duplicate_loop_header_p): Likewise.
	* tree-ssa-loop-ivopts.cc (determine_base_object_1): Likewise.
	(get_iv): Likewise.
	(find_bivs): Likewise.
	(record_group_use): Likewise.
	(generic_type_for): Likewise.
	(find_inv_vars_cb): Likewise.
	(add_candidate_1): Likewise.
	(add_autoinc_candidates): Likewise.
	(add_iv_candidate_for_biv): Likewise.
	(add_iv_candidate_for_use): Likewise.
	(get_debug_computation_at): Likewise.
	(get_computation_cost): Likewise.
	(cand_value_at): Likewise.
	(determine_set_costs): Likewise.
	(rewrite_use_nonlinear_expr): Likewise.
	* tree-ssa-loop-manip.cc (create_iv): Likewise.
	(rewrite_phi_with_iv): Likewise.
	(canonicalize_loop_ivs): Likewise.
	* tree-ssa-loop-niter.cc (number_of_iterations_ne): Likewise.
	(number_of_iterations_lt_to_ne): Likewise.
	(assert_loop_rolls_lt): Likewise.
	(number_of_iterations_until_wrap): Likewise.
	(number_of_iterations_le): Likewise.
	(number_of_iterations_cond): Likewise.
	(number_of_iterations_exit_assumptions): Likewise.
	(nowrap_type_p): Likewise.
	(loop_exits_before_overflow): Likewise.
	* tree-ssa-loop-split.cc (compute_new_first_bound): Likewise.
	* tree-ssa-phiopt.cc (value_replacement): Likewise.
	* tree-ssa-phiprop.cc (propagate_with_phi): Likewise.
	* tree-ssa-reassoc.cc (update_range_test): Likewise.
	(optimize_range_tests_cmp_bitwise): Likewise.
	* tree-ssa-sccvn.cc (VN_INFO): Likewise.
	(eliminate_dom_walker::eliminate_stmt): Likewise.
	* tree-ssa-strlen.cc (maybe_invalidate): Likewise.
	(find_equal_ptrs): Likewise.
	(strlen_pass::check_and_optimize_stmt): Likewise.
	(strlen_pass::before_dom_children): Likewise.
	* tree-ssa-structalias.cc (type_must_have_pointers): Likewise.
	(push_fields_onto_fieldstack): Likewise.
	(create_variable_info_for_1): Likewise.
	(create_variable_info_for): Likewise.
	(compute_points_to_sets): Likewise.
	(compute_dependence_clique): Likewise.
	(ipa_pta_execute): Likewise.
	* tree-ssa-threadedge.cc (jump_threader::simplify_control_stmt_condition): Likewise.
	* tree-ssa-uninit.cc (builtin_call_nomodifying_p): Likewise.
	(maybe_warn_operand): Likewise.
	(maybe_warn_pass_by_reference): Likewise.
	* tree-ssa.cc (verify_ssa): Likewise.
	* tree-ssanames.cc (make_ssa_name_fn): Likewise.
	(set_range_info): Likewise.
	(set_ptr_nonnull): Likewise.
	(set_nonzero_bits): Likewise.
	(set_bitmask): Likewise.
	(get_nonzero_bits): Likewise.
	(get_ptr_info): Likewise.
	(duplicate_ssa_name_ptr_info): Likewise.
	(duplicate_ssa_name_range_info): Likewise.
	(duplicate_ssa_name_fn): Likewise.
	(reset_flow_sensitive_info): Likewise.
	* tree-stdarg.cc (check_va_list_escapes): Likewise.
	(optimize_va_list_gpr_fpr_size): Likewise.
	(expand_ifn_va_arg_1): Likewise.
	* tree-streamer-in.cc (lto_input_ts_type_non_common_tree_pointers): Likewise.
	* tree-streamer-out.cc (write_ts_type_non_common_tree_pointers): Likewise.
	* tree-tailcall.cc (find_tail_calls): Likewise.
	(adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.
	(tree_optimize_tail_calls_1): Likewise.
	* tree-vect-data-refs.cc (vect_check_gather_scatter): Likewise.
	* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer): Likewise.
	* tree-vect-loop.cc (get_initial_def_for_reduction): Likewise.
	(vectorizable_reduction): Likewise.
	* tree-vect-stmts.cc (vectorizable_simd_clone_call): Likewise.
	(get_related_vectype_for_scalar_type): Likewise.
	* tree-vrp.cc (compare_values_warnv): Likewise.
	* tree.cc (tree_ctz): Likewise.
	(type_contains_placeholder_1): Likewise.
	(substitute_placeholder_in_expr): Likewise.
	(build2): Likewise.
	(get_type_static_bounds): Likewise.
	(tree_builtin_call_types_compatible_p): Likewise.
	(signed_or_unsigned_type_for): Likewise.
	(walk_type_fields): Likewise.
	(walk_tree_1): Likewise.
	(tree_nop_conversion_p): Likewise.
	(tree_sign_nop_conversion): Likewise.
	(verify_type_variant): Likewise.
	(gimple_canonical_types_compatible_p): Likewise.
	(nonnull_arg_p): Likewise.
	* tree.h (FUNCTION_POINTER_TYPE_P): Likewise.
	(TYPE_OVERFLOW_WRAPS): Likewise.
	(TYPE_OVERFLOW_UNDEFINED): Likewise.
	(reverse_storage_order_for_component_p): Likewise.
	(canonical_type_used_p): Likewise.
	* ubsan.cc (ubsan_type_descriptor): Likewise.
	(instrument_mem_ref): Likewise.
	(maybe_instrument_pointer_overflow): Likewise.
	(instrument_nonnull_arg): Likewise.
	(instrument_nonnull_return): Likewise.
	(instrument_object_size): Likewise.
	* value-pointer-equiv.cc (pointer_equiv_analyzer::enter): Likewise.
	(pointer_equiv_analyzer::visit_edge): Likewise.
	* value-pointer-equiv.h (supported_pointer_equiv_p): Likewise.
	* value-query.cc (get_ssa_name_range_info): Likewise.
	(get_ssa_name_ptr_info_nonnull): Likewise.
	(get_range_global): Likewise.
	* value-range.h (irange::varying_compatible_p): Likewise.
	(irange::supports_p): Likewise.
	(irange::set_varying): Likewise.
	* varasm.cc (initializer_constant_valid_p_1): Likewise.
	(output_constant): Likewise.
	* vr-values.cc (simplify_using_ranges::legacy_fold_cond_overflow): Likewise.
	(range_fits_type_p): Likewise.
	(simplify_using_ranges::simplify_casted_cond): Likewise.

gcc/analyzer/ChangeLog:

	* analyzer.cc (is_setjmp_call_p): Use INDIRECT_TYPE_P instead of
	POINTER_TYPE_P.
	(is_longjmp_call_p): Likewise.
	* call-details.h: Likewise.
	* call-summary.cc (call_summary::get_user_facing_desc): Likewise.
	* checker-event.cc (start_cfg_edge_event::maybe_describe_condition): Likewise.
	* constraint-manager.cc (constraint_manager::get_or_add_equiv_class): Likewise.
	* engine.cc (exploded_node::on_longjmp): Likewise.
	(mark_params_as_tainted): Likewise.
	* program-state.cc (sm_state_map::canonicalize_svalue): Likewise.
	* region-model-manager.cc (region_model_manager::get_or_create_null_ptr): Likewise.
	(region_model_manager::maybe_fold_unaryop): Likewise.
	* region-model.cc (region_model::deref_rvalue): Likewise.
	(region_model::check_region_size): Likewise.
	(region_model::on_top_level_param): Likewise.
	* sm.cc (any_pointer_p): Likewise.
	* svalue.cc (svalue::can_merge_p): Likewise.
	* varargs.cc (get_stateful_arg): Likewise.

gcc/c-family/ChangeLog:

	* c-ada-spec.cc (dump_ada_function_declaration): Use
	INDIRECT_TYPE_P instead of POINTER_TYPE_P.
	* c-attribs.cc (handle_mode_attribute): Likewise.
	(handle_copy_attribute): Likewise.
	(handle_malloc_attribute): Likewise.
	(handle_alloc_size_attribute): Likewise.
	(handle_alloc_align_attribute): Likewise.
	(type_for_vector_size): Likewise.
	(handle_nonstring_attribute): Likewise.
	(handle_access_attribute): Likewise.
	(build_attr_access_from_parms): Likewise.
	(handle_nsobject_attribute): Likewise.
	(handle_objc_nullability_attribute): Likewise.
	* c-common.cc (shorten_binary_op): Likewise.
	(c_common_truthvalue_conversion): Likewise.
	(c_apply_type_quals_to_decl): Likewise.
	(build_va_arg): Likewise.
	(strip_pointer_operator): Likewise.
	(strip_pointer_or_array_types): Likewise.
	(c_add_case_label): Likewise.
	(check_function_sentinel): Likewise.
	(check_function_restrict): Likewise.
	(check_builtin_function_arguments): Likewise.
	(fold_offsetof): Likewise.
	(speculation_safe_value_resolve_call): Likewise.
	(sync_resolve_size): Likewise.
	(get_atomic_generic_size): Likewise.
	(pointer_to_zero_sized_aggr_p): Likewise.
	* c-omp.cc (c_finish_omp_atomic): Likewise.
	(c_omp_for_incr_canonicalize_ptr): Likewise.
	(c_omp_adjust_map_clauses): Likewise.
	* c-pretty-print.cc (pp_c_space_for_pointer_operator): Likewise.
	* c-ubsan.cc (ubsan_maybe_instrument_reference_or_call): Likewise.
	(ubsan_maybe_instrument_member_call): Likewise.
	* c-warn.cc (strict_aliasing_warning): Likewise.
	(sizeof_pointer_memaccess_warning): Likewise.
	(check_main_parameter_types): Likewise.
	(check_address_or_pointer_of_packed_member): Likewise.
	(warn_for_address_or_pointer_of_packed_member): Likewise.
	(warn_parm_array_mismatch): Likewise.

gcc/c/ChangeLog:

	* c-decl.cc (types_close_enough_to_match): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.
	(match_builtin_function_types): Likewise.
	(grokdeclarator): Likewise.
	* c-parser.cc (c_parser_binary_expression): Likewise.
	(c_parser_oacc_data_clause_deviceptr): Likewise.
	* c-typeck.cc (parser_build_binary_op): Likewise.
	(build_atomic_assign): Likewise.
	(build_unary_op): Likewise.
	(convert_to_anonymous_field): Likewise.
	(check_constexpr_init): Likewise.
	(c_finish_goto_ptr): Likewise.
	(c_finish_return): Likewise.
	(handle_omp_array_sections_1): Likewise.
	(handle_omp_array_sections): Likewise.
	(c_omp_finish_iterators): Likewise.
	(c_finish_omp_clauses): Likewise.
	(c_build_qualified_type): Likewise.
	* gimple-parser.cc (c_parser_gimple_binary_expression): Likewise.
	(c_parser_gimple_unary_expression): Likewise.
	(c_parser_gimple_postfix_expression): Likewise.
	(c_parser_gimple_postfix_expression_after_primary): Likewise.

gcc/cp/ChangeLog:

	* class.cc (is_empty_base_ref): Use INDIRECT_TYPE_P instead of
	POINTER_TYPE_P.
	* constexpr.cc (cxx_maybe_fold_addr_pointer_plus): Likewise.
	(cxx_eval_binary_expression): Likewise.
	* coroutines.cc (morph_fn_to_coro): Likewise.
	* cp-gimplify.cc (predeclare_vla): Likewise.
	* semantics.cc (cp_omp_finish_iterators): Likewise.
	(finish_omp_target_clauses_r): Likewise.
	* typeck.cc (maybe_warn_about_returning_address_of_local): Likewise.

gcc/d/ChangeLog:

	* d-attribs.cc (handle_malloc_attribute): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.
	(d_handle_alloc_size_attribute): Likewise.
	(d_handle_restrict_attribute): Likewise.
	* d-codegen.cc (build_vindex_ref): Likewise.
	(build_boolop): Likewise.
	(build_deref): Likewise.
	(d_build_call): Likewise.
	* d-convert.cc (d_build_truthvalue_op): Likewise.
	(convert): Likewise.
	(convert_for_argument): Likewise.
	* expr.cc (binary_op): Likewise.
	* intrinsics.cc (maybe_warn_intrinsic_mismatch): Likewise.
	(expand_intrinsic_vaarg): Likewise.
	(expand_intrinsic_vastart): Likewise.
	(expand_volatile_load): Likewise.
	(expand_volatile_store): Likewise.

gcc/fortran/ChangeLog:

	* trans-array.cc (gfc_get_array_span): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.
	(gfc_trans_create_temp_array): Likewise.
	(gfc_trans_array_ctor_element): Likewise.
	(gfc_trans_array_constructor_value): Likewise.
	(gfc_build_constant_array_constructor): Likewise.
	(build_class_array_ref): Likewise.
	(non_negative_strides_array_p): Likewise.
	(gfc_array_allocate): Likewise.
	(gfc_conv_expr_descriptor): Likewise.
	(gfc_conv_array_parameter): Likewise.
	(structure_alloc_comps): Likewise.
	(gfc_alloc_allocatable_for_assignment): Likewise.
	* trans-decl.cc (gfc_build_qualified_array): Likewise.
	(gfc_build_dummy_array_decl): Likewise.
	(gfc_get_symbol_decl): Likewise.
	(create_function_arglist): Likewise.
	(gfc_trans_vla_type_sizes): Likewise.
	(gfc_conv_cfi_to_gfc): Likewise.
	(gfc_generate_function_code): Likewise.
	* trans-expr.cc (get_scalar_to_descriptor_type): Likewise.
	(gfc_conv_scalar_to_descriptor): Likewise.
	(gfc_class_data_get): Likewise.
	(gfc_class_vptr_get): Likewise.
	(gfc_class_len_get): Likewise.
	(gfc_class_len_or_zero_get): Likewise.
	(gfc_get_class_from_expr): Likewise.
	(gfc_conv_derived_to_class): Likewise.
	(gfc_conv_class_to_class): Likewise.
	(gfc_copy_class_to_class): Likewise.
	(gfc_get_tree_for_caf_expr): Likewise.
	(gfc_get_caf_token_offset): Likewise.
	(gfc_maybe_dereference_var): Likewise.
	(gfc_conv_string_tmp): Likewise.
	(gfc_string_to_single_character): Likewise.
	(build_memcmp_call): Likewise.
	(gfc_build_compare_string): Likewise.
	(conv_function_val): Likewise.
	(gfc_add_interface_mapping): Likewise.
	(set_dtype_for_unallocated): Likewise.
	(gfc_conv_gfc_desc_to_cfi_desc): Likewise.
	(gfc_conv_procedure_call): Likewise.
	(gfc_trans_string_copy): Likewise.
	(gfc_conv_initializer): Likewise.
	(gfc_conv_string_parameter): Likewise.
	(fcncall_realloc_result): Likewise.
	(gfc_trans_zero_assign): Likewise.
	(gfc_build_memcpy_call): Likewise.
	(gfc_trans_array_copy): Likewise.
	(gfc_trans_array_constructor_copy): Likewise.
	(trans_class_assignment): Likewise.
	(gfc_trans_assignment_1): Likewise.
	* trans-intrinsic.cc (gfc_conv_intrinsic_ichar): Likewise.
	(gfc_conv_intrinsic_sizeof): Likewise.
	(conv_intrinsic_atomic_op): Likewise.
	(conv_intrinsic_atomic_ref): Likewise.
	(conv_intrinsic_atomic_cas): Likewise.
	* trans-io.cc (nml_get_addr_expr): Likewise.
	* trans-openmp.cc (gfc_omp_array_data): Likewise.
	(gfc_omp_array_size): Likewise.
	(gfc_has_alloc_comps): Likewise.
	(gfc_is_polymorphic_nonptr): Likewise.
	(gfc_is_unlimited_polymorphic_nonptr): Likewise.
	(gfc_omp_clause_default_ctor): Likewise.
	(gfc_omp_clause_copy_ctor): Likewise.
	(gfc_omp_clause_assign_op): Likewise.
	(gfc_omp_linear_clause_add_loop): Likewise.
	(gfc_omp_clause_linear_ctor): Likewise.
	(gfc_omp_clause_dtor): Likewise.
	(gfc_omp_finish_clause): Likewise.
	(gfc_trans_omp_array_section): Likewise.
	(gfc_trans_omp_clauses): Likewise.
	(gfc_trans_omp_depobj): Likewise.
	(gfc_trans_omp_error): Likewise.
	* trans-stmt.cc (trans_associate_var): Likewise.
	(gfc_trans_allocate): Likewise.
	* trans-types.cc (gfc_get_character_type): Likewise.
	(gfc_get_derived_type): Likewise.
	(gfc_get_array_descr_info): Likewise.
	* trans.cc (gfc_build_addr_expr): Likewise.
	(get_array_span): Likewise.
	(get_final_proc_ref): Likewise.
	(get_var_descr): Likewise.
	(gfc_add_comp_finalizer_call): Likewise.
	(gfc_deallocate_with_status): Likewise.

gcc/go/ChangeLog:

	* go-gcc.cc (Gcc_backend::convert_tree): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.

gcc/jit/ChangeLog:

	* dummy-frontend.cc (handle_malloc_attribute): Use
	INDIRECT_TYPE_P instead of POINTER_TYPE_P.

gcc/lto/ChangeLog:

	* lto-common.cc (hash_canonical_type): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.
	(lto_register_canonical_types): Likewise.
	(compare_tree_sccs_1): Likewise.
	* lto-lang.cc (handle_malloc_attribute): Likewise.
	* lto-symtab.cc (warn_type_compatibility_p): Likewise.

gcc/m2/ChangeLog:

	* gm2-gcc/m2expr.cc (m2expr_build_binary_op_check): Use
	INDIRECT_TYPE_P instead of POINTER_TYPE_P.
	(m2expr_BuildAddAddress): Likewise.

gcc/objc/ChangeLog:

	* objc-act.cc (objc_add_property_declaration): Use
	INDIRECT_TYPE_P instead of POINTER_TYPE_P.
	(objc_common_type): Likewise.
	(objc_compare_types): Likewise.
	(objc_have_common_type): Likewise.
	(objc_is_object_ptr): Likewise.
	(objc_generate_write_barrier): Likewise.
	(objc_begin_catch_clause): Likewise.
	(objc_type_valid_for_messaging): Likewise.
	(gen_declaration): Likewise.
	(gen_type_name_0): Likewise.
	* objc-encoding.cc (pointee_is_readonly): Likewise.
	* objc-gnu-runtime-abi-01.cc (objc_eh_runtime_type): Likewise.
	* objc-next-runtime-abi-01.cc (objc_eh_runtime_type): Likewise.
	* objc-next-runtime-abi-02.cc (next_runtime_02_eh_type): Likewise.
	(begin_catch): Likewise.

gcc/rust/ChangeLog:

	* backend/rust-tree.cc (fold_offsetof): Use INDIRECT_TYPE_P
	instead of POINTER_TYPE_P.
	* rust-gcc.cc (Gcc_backend::convert_tree): Likewise.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/ada/gcc-interface/ada-tree.h           |   2 +-
 gcc/ada/gcc-interface/decl.cc              |   6 +-
 gcc/ada/gcc-interface/trans.cc             |  14 +-
 gcc/ada/gcc-interface/utils.cc             |  12 +-
 gcc/ada/gcc-interface/utils2.cc            |  12 +-
 gcc/alias.cc                               |  10 +-
 gcc/analyzer/analyzer.cc                   |   4 +-
 gcc/analyzer/call-details.h                |   2 +-
 gcc/analyzer/call-summary.cc               |   2 +-
 gcc/analyzer/checker-event.cc              |   4 +-
 gcc/analyzer/constraint-manager.cc         |   2 +-
 gcc/analyzer/engine.cc                     |   4 +-
 gcc/analyzer/program-state.cc              |   2 +-
 gcc/analyzer/region-model-manager.cc       |   6 +-
 gcc/analyzer/region-model.cc               |   6 +-
 gcc/analyzer/sm.cc                         |   4 +-
 gcc/analyzer/svalue.cc                     |   2 +-
 gcc/analyzer/varargs.cc                    |   2 +-
 gcc/asan.cc                                |   4 +-
 gcc/builtins.cc                            |  24 ++--
 gcc/c-family/c-ada-spec.cc                 |   2 +-
 gcc/c-family/c-attribs.cc                  |  30 ++--
 gcc/c-family/c-common.cc                   |  34 ++---
 gcc/c-family/c-omp.cc                      |   8 +-
 gcc/c-family/c-pretty-print.cc             |   2 +-
 gcc/c-family/c-ubsan.cc                    |   6 +-
 gcc/c-family/c-warn.cc                     |  32 ++---
 gcc/c/c-decl.cc                            |   8 +-
 gcc/c/c-parser.cc                          |   4 +-
 gcc/c/c-typeck.cc                          |  40 +++---
 gcc/c/gimple-parser.cc                     |   8 +-
 gcc/calls.cc                               |   2 +-
 gcc/cfgexpand.cc                           |   6 +-
 gcc/cgraph.cc                              |   2 +-
 gcc/cgraphunit.cc                          |   2 +-
 gcc/config/aarch64/aarch64-builtins.cc     |   2 +-
 gcc/config/aarch64/aarch64-sve-builtins.cc |   2 +-
 gcc/config/aarch64/aarch64.cc              |   6 +-
 gcc/config/arc/arc.cc                      |   2 +-
 gcc/config/arm/arm-builtins.cc             |   6 +-
 gcc/config/arm/arm-mve-builtins.cc         |   2 +-
 gcc/config/avr/avr.cc                      |   6 +-
 gcc/config/epiphany/epiphany.cc            |   2 +-
 gcc/config/gcn/gcn.cc                      |   6 +-
 gcc/config/i386/i386-builtins.cc           |   2 +-
 gcc/config/i386/i386-options.cc            |   2 +-
 gcc/config/i386/i386.cc                    |  10 +-
 gcc/config/m32c/m32c.cc                    |   2 +-
 gcc/config/m68k/m68k.cc                    |   4 +-
 gcc/config/mips/mips.cc                    |   2 +-
 gcc/config/mn10300/mn10300.cc              |   2 +-
 gcc/config/msp430/msp430.cc                |   2 +-
 gcc/config/nios2/nios2.cc                  |   2 +-
 gcc/config/pa/pa.cc                        |   4 +-
 gcc/config/pru/pru-passes.cc               |   2 +-
 gcc/config/pru/pru.cc                      |   2 +-
 gcc/config/rs6000/rs6000-builtin.cc        |   4 +-
 gcc/config/rs6000/rs6000-c.cc              |  10 +-
 gcc/config/rs6000/rs6000.cc                |   4 +-
 gcc/config/s390/s390-c.cc                  |   2 +-
 gcc/config/s390/s390.cc                    |  12 +-
 gcc/config/sparc/sparc.cc                  |   2 +-
 gcc/convert.cc                             |   4 +-
 gcc/cp/class.cc                            |   4 +-
 gcc/cp/constexpr.cc                        |   6 +-
 gcc/cp/coroutines.cc                       |   2 +-
 gcc/cp/cp-gimplify.cc                      |   2 +-
 gcc/cp/semantics.cc                        |   8 +-
 gcc/cp/typeck.cc                           |   4 +-
 gcc/d/d-attribs.cc                         |   6 +-
 gcc/d/d-codegen.cc                         |  10 +-
 gcc/d/d-convert.cc                         |   8 +-
 gcc/d/expr.cc                              |  10 +-
 gcc/d/intrinsics.cc                        |  12 +-
 gcc/dojump.cc                              |   4 +-
 gcc/dwarf2out.cc                           |   2 +-
 gcc/emit-rtl.cc                            |   2 +-
 gcc/expmed.cc                              |   2 +-
 gcc/expr.cc                                |  22 +--
 gcc/fold-const.cc                          |  56 ++++----
 gcc/fortran/trans-array.cc                 |  32 ++---
 gcc/fortran/trans-decl.cc                  |  30 ++--
 gcc/fortran/trans-expr.cc                  | 104 +++++++-------
 gcc/fortran/trans-intrinsic.cc             |  12 +-
 gcc/fortran/trans-io.cc                    |   8 +-
 gcc/fortran/trans-openmp.cc                |  78 +++++------
 gcc/fortran/trans-stmt.cc                  |  14 +-
 gcc/fortran/trans-types.cc                 |   8 +-
 gcc/fortran/trans.cc                       |  14 +-
 gcc/function-abi.cc                        |   2 +-
 gcc/function.cc                            |   6 +-
 gcc/gimple-array-bounds.cc                 |   6 +-
 gcc/gimple-expr.cc                         |   8 +-
 gcc/gimple-fold.cc                         |  20 +--
 gcc/gimple-loop-versioning.cc              |   4 +-
 gcc/gimple-low.cc                          |   2 +-
 gcc/gimple-pretty-print.cc                 |   4 +-
 gcc/gimple-range-cache.cc                  |   4 +-
 gcc/gimple-range-fold.cc                   |   2 +-
 gcc/gimple-range-infer.cc                  |   2 +-
 gcc/gimple-range-path.cc                   |   4 +-
 gcc/gimple-ssa-isolate-paths.cc            |   6 +-
 gcc/gimple-ssa-nonnull-compare.cc          |   4 +-
 gcc/gimple-ssa-sprintf.cc                  |   4 +-
 gcc/gimple-ssa-store-merging.cc            |   6 +-
 gcc/gimple-ssa-strength-reduction.cc       |  22 +--
 gcc/gimple-ssa-warn-access.cc              |   8 +-
 gcc/gimple-ssa-warn-restrict.cc            |   6 +-
 gcc/gimple.cc                              |   8 +-
 gcc/gimplify.cc                            |  26 ++--
 gcc/go/go-gcc.cc                           |   2 +-
 gcc/godump.cc                              |   4 +-
 gcc/graphite-isl-ast-to-gimple.cc          |   8 +-
 gcc/graphite-sese-to-poly.cc               |   2 +-
 gcc/ipa-cp.cc                              |   4 +-
 gcc/ipa-devirt.cc                          |   8 +-
 gcc/ipa-free-lang-data.cc                  |   6 +-
 gcc/ipa-icf-gimple.cc                      |   2 +-
 gcc/ipa-icf.cc                             |   6 +-
 gcc/ipa-modref-tree.cc                     |   2 +-
 gcc/ipa-modref.cc                          |   8 +-
 gcc/ipa-param-manipulation.cc              |   4 +-
 gcc/ipa-polymorphic-call.cc                |   6 +-
 gcc/ipa-prop.cc                            |  28 ++--
 gcc/ipa-sra.cc                             |   2 +-
 gcc/jit/dummy-frontend.cc                  |   2 +-
 gcc/lto-streamer-out.cc                    |   4 +-
 gcc/lto/lto-common.cc                      |   8 +-
 gcc/lto/lto-lang.cc                        |   2 +-
 gcc/lto/lto-symtab.cc                      |   2 +-
 gcc/m2/gm2-gcc/m2expr.cc                   |  12 +-
 gcc/match.pd                               |  46 +++---
 gcc/objc/objc-act.cc                       |  30 ++--
 gcc/objc/objc-encoding.cc                  |   2 +-
 gcc/objc/objc-gnu-runtime-abi-01.cc        |   4 +-
 gcc/objc/objc-next-runtime-abi-01.cc       |   4 +-
 gcc/objc/objc-next-runtime-abi-02.cc       |   6 +-
 gcc/omp-expand.cc                          | 156 ++++++++++-----------
 gcc/omp-general.cc                         |  10 +-
 gcc/omp-low.cc                             |  28 ++--
 gcc/omp-oacc-neuter-broadcast.cc           |   8 +-
 gcc/omp-offload.cc                         |   2 +-
 gcc/omp-simd-clone.cc                      |  20 +--
 gcc/pointer-query.cc                       |  12 +-
 gcc/predict.cc                             |   4 +-
 gcc/range-op.cc                            |   4 +-
 gcc/rust/backend/rust-tree.cc              |   2 +-
 gcc/rust/rust-gcc.cc                       |   2 +-
 gcc/sese.cc                                |   2 +-
 gcc/tree-affine.cc                         |  12 +-
 gcc/tree-cfg.cc                            |  38 ++---
 gcc/tree-chrec.cc                          |  14 +-
 gcc/tree-chrec.h                           |   4 +-
 gcc/tree-core.h                            |   2 +-
 gcc/tree-data-ref.cc                       |  18 +--
 gcc/tree-dfa.cc                            |   2 +-
 gcc/tree-if-conv.cc                        |   4 +-
 gcc/tree-inline.cc                         |   8 +-
 gcc/tree-nested.cc                         |   8 +-
 gcc/tree-object-size.cc                    |  10 +-
 gcc/tree-outof-ssa.cc                      |   2 +-
 gcc/tree-pretty-print.cc                   |   8 +-
 gcc/tree-profile.cc                        |   2 +-
 gcc/tree-scalar-evolution.cc               |   8 +-
 gcc/tree-sra.cc                            |   2 +-
 gcc/tree-ssa-address.cc                    |   6 +-
 gcc/tree-ssa-alias.cc                      |  18 +--
 gcc/tree-ssa-ccp.cc                        |  22 +--
 gcc/tree-ssa-copy.cc                       |   4 +-
 gcc/tree-ssa-dom.cc                        |   2 +-
 gcc/tree-ssa-dse.cc                        |   2 +-
 gcc/tree-ssa-forwprop.cc                   |   6 +-
 gcc/tree-ssa-ifcombine.cc                  |   2 +-
 gcc/tree-ssa-loop-ch.cc                    |   2 +-
 gcc/tree-ssa-loop-ivopts.cc                |  44 +++---
 gcc/tree-ssa-loop-manip.cc                 |  10 +-
 gcc/tree-ssa-loop-niter.cc                 |  40 +++---
 gcc/tree-ssa-loop-split.cc                 |  10 +-
 gcc/tree-ssa-phiopt.cc                     |   2 +-
 gcc/tree-ssa-phiprop.cc                    |   2 +-
 gcc/tree-ssa-reassoc.cc                    |  14 +-
 gcc/tree-ssa-sccvn.cc                      |   6 +-
 gcc/tree-ssa-strlen.cc                     |  10 +-
 gcc/tree-ssa-structalias.cc                |  14 +-
 gcc/tree-ssa-threadedge.cc                 |   2 +-
 gcc/tree-ssa-uninit.cc                     |  10 +-
 gcc/tree-ssa.cc                            |   2 +-
 gcc/tree-ssanames.cc                       |  22 +--
 gcc/tree-stdarg.cc                         |   6 +-
 gcc/tree-streamer-in.cc                    |   2 +-
 gcc/tree-streamer-out.cc                   |   2 +-
 gcc/tree-tailcall.cc                       |   8 +-
 gcc/tree-vect-data-refs.cc                 |   4 +-
 gcc/tree-vect-loop-manip.cc                |   2 +-
 gcc/tree-vect-loop.cc                      |   4 +-
 gcc/tree-vect-stmts.cc                     |  18 +--
 gcc/tree-vrp.cc                            |   6 +-
 gcc/tree.cc                                |  54 +++----
 gcc/tree.h                                 |  10 +-
 gcc/ubsan.cc                               |  18 +--
 gcc/value-pointer-equiv.cc                 |   4 +-
 gcc/value-pointer-equiv.h                  |   2 +-
 gcc/value-query.cc                         |  12 +-
 gcc/value-range.h                          |   6 +-
 gcc/varasm.cc                              |  10 +-
 gcc/vr-values.cc                           |   6 +-
 206 files changed, 1032 insertions(+), 1032 deletions(-)

diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index d0acf1de8f3..8a2f0f30e92 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -139,7 +139,7 @@ do {							 \
 
 /* True if NODE is a thin pointer.  */
 #define TYPE_IS_THIN_POINTER_P(NODE)			\
-  (POINTER_TYPE_P (NODE)				\
+  (INDIRECT_TYPE_P (NODE)				\
    && TREE_CODE (TREE_TYPE (NODE)) == RECORD_TYPE	\
    && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (NODE)))
 
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index ee913a017d2..f2f6563a52c 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -1204,7 +1204,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 	   initialize it to NULL, unless the object is declared imported as
 	   per RM B.1(24).  */
 	if (definition
-	    && (POINTER_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type))
+	    && (INDIRECT_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type))
 	    && !gnu_expr
 	    && !Is_Imported (gnat_entity))
 	  gnu_expr = null_pointer_node;
@@ -6179,7 +6179,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
 	     In parameter, then it may only read memory through it and can be
 	     considered pure in the GCC sense.  */
 	  if (pure_flag
-	      && ((POINTER_TYPE_P (gnu_param_type)
+	      && ((INDIRECT_TYPE_P (gnu_param_type)
 		   && TREE_CODE (TREE_TYPE (gnu_param_type)) != FUNCTION_TYPE)
 		  || TYPE_IS_FAT_POINTER_P (gnu_param_type)))
 	    pure_flag = DECL_POINTS_TO_READONLY_P (gnu_param);
@@ -6597,7 +6597,7 @@ array_type_has_nonaliased_component (tree gnu_type, Entity_Id gnat_type)
 
   /* Consider that an array of pointers has an aliased component, which is
      sort of logical and helps with Taft Amendment types in LTO mode.  */
-  if (POINTER_TYPE_P (TREE_TYPE (gnu_type)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (gnu_type)))
     return false;
 
   /* Otherwise, rely exclusively on properties of the element type.  */
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 203d63b2e5e..b71c90f2a98 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -4501,7 +4501,7 @@ is_array_of_scalar_type (tree type)
 
   type = TREE_TYPE (type);
 
-  return !AGGREGATE_TYPE_P (type) && !POINTER_TYPE_P (type);
+  return !AGGREGATE_TYPE_P (type) && !INDIRECT_TYPE_P (type);
 }
 
 /* Helper function for walk_tree, used by return_slot_opt_for_pure_call_p.  */
@@ -4546,7 +4546,7 @@ return_slot_opt_for_pure_call_p (tree target, tree call)
       if (is_array_of_scalar_type (arg_type))
 	walk_tree_without_duplicates (&arg, find_decls_r, decls);
 
-      else if (AGGREGATE_TYPE_P (arg_type) || POINTER_TYPE_P (arg_type))
+      else if (AGGREGATE_TYPE_P (arg_type) || INDIRECT_TYPE_P (arg_type))
 	return false;
     }
 
@@ -6970,7 +6970,7 @@ gnat_to_gnu (Node_Id gnat_node)
 
       /* If the result is a pointer type, see if we are improperly
 	 converting to a stricter alignment.  */
-      if (STRICT_ALIGNMENT && POINTER_TYPE_P (gnu_result_type)
+      if (STRICT_ALIGNMENT && INDIRECT_TYPE_P (gnu_result_type)
 	  && Is_Access_Type (Etype (gnat_node)))
 	{
 	  unsigned int align = known_alignment (gnu_expr);
@@ -6988,7 +6988,7 @@ gnat_to_gnu (Node_Id gnat_node)
 	 build the pointer.  */
       if (TARGET_VTABLE_USES_DESCRIPTORS
 	  && TREE_TYPE (gnu_expr) == fdesc_type_node
-	  && POINTER_TYPE_P (gnu_result_type))
+	  && INDIRECT_TYPE_P (gnu_result_type))
 	gnu_expr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr);
 
       gnu_result = unchecked_convert (gnu_result_type, gnu_expr,
@@ -10458,17 +10458,17 @@ validate_unchecked_conversion (Node_Id gnat_node)
   /* If the target is a pointer type, see if we are either converting from a
      non-pointer or from a pointer to a type with a different alias set and
      warn if so, unless the pointer has been marked to alias everything.  */
-  if (POINTER_TYPE_P (gnu_target_type)
+  if (INDIRECT_TYPE_P (gnu_target_type)
       && !TYPE_REF_CAN_ALIAS_ALL (gnu_target_type))
     {
-      tree gnu_source_desig_type = POINTER_TYPE_P (gnu_source_type)
+      tree gnu_source_desig_type = INDIRECT_TYPE_P (gnu_source_type)
 				   ? TREE_TYPE (gnu_source_type)
 				   : NULL_TREE;
       tree gnu_target_desig_type = TREE_TYPE (gnu_target_type);
       alias_set_type target_alias_set = get_alias_set (gnu_target_desig_type);
 
       if (target_alias_set != 0
-	  && (!POINTER_TYPE_P (gnu_source_type)
+	  && (!INDIRECT_TYPE_P (gnu_source_type)
 	      || !alias_sets_conflict_p (get_alias_set (gnu_source_desig_type),
 					 target_alias_set)))
 	{
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 8f1861b848e..bb5bc118fc6 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -2794,7 +2794,7 @@ create_var_decl (tree name, tree asm_name, tree type, tree init,
 
   /* Detect constants created by the front-end to hold 'reference to function
      calls for stabilization purposes.  This is needed for renaming.  */
-  if (const_flag && init && POINTER_TYPE_P (type))
+  if (const_flag && init && INDIRECT_TYPE_P (type))
     {
       tree inner = init;
       if (TREE_CODE (inner) == COMPOUND_EXPR)
@@ -5383,10 +5383,10 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
   /* If both types are integral or regular pointer, then just do a normal
      conversion.  Likewise for a conversion to an unconstrained array.  */
   if (((INTEGRAL_TYPE_P (type)
-	|| (POINTER_TYPE_P (type) && !TYPE_IS_THIN_POINTER_P (type))
+	|| (INDIRECT_TYPE_P (type) && !TYPE_IS_THIN_POINTER_P (type))
 	|| (code == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (type)))
        && (INTEGRAL_TYPE_P (etype)
-	   || (POINTER_TYPE_P (etype) && !TYPE_IS_THIN_POINTER_P (etype))
+	   || (INDIRECT_TYPE_P (etype) && !TYPE_IS_THIN_POINTER_P (etype))
 	   || (ecode == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (etype))))
       || code == UNCONSTRAINED_ARRAY_TYPE)
     {
@@ -5636,7 +5636,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
   /* If we are converting a string constant to a pointer to character, make
      sure that the string is not folded into an integer constant.  */
   else if (TREE_CODE (expr) == STRING_CST
-	   && POINTER_TYPE_P (type)
+	   && INDIRECT_TYPE_P (type)
 	   && TYPE_STRING_FLAG (TREE_TYPE (type)))
     expr = build1 (VIEW_CONVERT_EXPR, type, expr);
 
@@ -6746,7 +6746,7 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
 			 int ARG_UNUSED (flags), bool *no_add_attrs)
 {
   if (TREE_CODE (*node) == FUNCTION_DECL
-      && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
+      && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
     DECL_IS_MALLOC (*node) = 1;
   else
     {
@@ -7013,7 +7013,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
 
      In this case, the mode is SI, but the type being modified is
      HI, so we need to look further.  */
-  while (POINTER_TYPE_P (type)
+  while (INDIRECT_TYPE_P (type)
 	 || TREE_CODE (type) == FUNCTION_TYPE
 	 || TREE_CODE (type) == ARRAY_TYPE)
     type = TREE_TYPE (type);
diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc
index 022bbf97e8e..9ca61f475ff 100644
--- a/gcc/ada/gcc-interface/utils2.cc
+++ b/gcc/ada/gcc-interface/utils2.cc
@@ -192,7 +192,7 @@ known_alignment (tree exp)
 	 is at least as aligned as the pointed-to type.  Beware that we can
 	 have a dummy type here (e.g. a Taft Amendment type), for which the
 	 alignment is meaningless and should be ignored.  */
-      if (POINTER_TYPE_P (TREE_TYPE (exp))
+      if (INDIRECT_TYPE_P (TREE_TYPE (exp))
 	  && !TYPE_IS_DUMMY_P (TREE_TYPE (TREE_TYPE (exp)))
 	  && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (exp))))
 	this_alignment = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp)));
@@ -883,9 +883,9 @@ build_binary_op (enum tree_code op_code, tree result_type,
       while ((CONVERT_EXPR_P (left_operand)
 	      || TREE_CODE (left_operand) == VIEW_CONVERT_EXPR)
 	     && (((INTEGRAL_TYPE_P (left_type)
-		   || POINTER_TYPE_P (left_type))
+		   || INDIRECT_TYPE_P (left_type))
 		  && (INTEGRAL_TYPE_P (operand_type (left_operand))
-		      || POINTER_TYPE_P (operand_type (left_operand))))
+		      || INDIRECT_TYPE_P (operand_type (left_operand))))
 		 || (TREE_CODE (left_type) == RECORD_TYPE
 		     && !TYPE_JUSTIFIED_MODULAR_P (left_type)
 		     && TREE_CODE (operand_type (left_operand)) == RECORD_TYPE
@@ -1136,8 +1136,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
 	      best_type = left_base_type;
 	    }
 
-	  else if (POINTER_TYPE_P (left_base_type)
-		   && POINTER_TYPE_P (right_base_type))
+	  else if (INDIRECT_TYPE_P (left_base_type)
+		   && INDIRECT_TYPE_P (right_base_type))
 	    {
 	      tree left_ref_type = TREE_TYPE (left_base_type);
 	      tree right_ref_type = TREE_TYPE (right_base_type);
@@ -1397,7 +1397,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
 
 	  /* If the underlying object can alias everything, propagate the
 	     property since we are effectively retrieving the object.  */
-	  if (POINTER_TYPE_P (TREE_TYPE (result))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (result))
 	      && TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (result)))
 	    {
 	      if (TREE_CODE (result_type) == POINTER_TYPE
diff --git a/gcc/alias.cc b/gcc/alias.cc
index 3f2e74b00a4..b6964e51f67 100644
--- a/gcc/alias.cc
+++ b/gcc/alias.cc
@@ -1017,7 +1017,7 @@ get_alias_set (tree t)
      ptr_type_node but that is a bad idea, because it prevents disabiguations
      in between pointers.  For Firefox this accounts about 20% of all
      disambiguations in the program.  */
-  else if (POINTER_TYPE_P (t) && t != ptr_type_node)
+  else if (INDIRECT_TYPE_P (t) && t != ptr_type_node)
     {
       tree p;
       auto_vec <bool, 8> reference;
@@ -1025,7 +1025,7 @@ get_alias_set (tree t)
       /* Unnest all pointers and references.
 	 We also want to make pointer to array/vector equivalent to pointer to
 	 its element (see the reasoning above). Skip all those types, too.  */
-      for (p = t; POINTER_TYPE_P (p)
+      for (p = t; INDIRECT_TYPE_P (p)
 	   || (TREE_CODE (p) == ARRAY_TYPE
 	       && (!TYPE_NONALIASED_COMPONENT (p)
 		   || !COMPLETE_TYPE_P (p)
@@ -1136,7 +1136,7 @@ get_alias_set (tree t)
     record_component_aliases (t);
 
   /* We treat pointer types specially in alias_set_subset_of.  */
-  if (POINTER_TYPE_P (t) && set)
+  if (INDIRECT_TYPE_P (t) && set)
     {
       alias_set_entry *ase = get_alias_set_entry (set);
       if (!ase)
@@ -1276,12 +1276,12 @@ record_component_aliases (tree type, alias_set_type superset)
 		  /* VECTOR_TYPE and ARRAY_TYPE share the alias set with their
 		     element type and that type has to be normalized to void *,
 		     too, in the case it is a pointer. */
-		  while (!canonical_type_used_p (t) && !POINTER_TYPE_P (t))
+		  while (!canonical_type_used_p (t) && !INDIRECT_TYPE_P (t))
 		    {
 		      gcc_checking_assert (TYPE_STRUCTURAL_EQUALITY_P (t));
 		      t = TREE_TYPE (t);
 		    }
-		  if (POINTER_TYPE_P (t))
+		  if (INDIRECT_TYPE_P (t))
 		    t = ptr_type_node;
 		  else if (flag_checking)
 		    gcc_checking_assert (get_alias_set (t)
diff --git a/gcc/analyzer/analyzer.cc b/gcc/analyzer/analyzer.cc
index 5091fb7a583..7b456688c3b 100644
--- a/gcc/analyzer/analyzer.cc
+++ b/gcc/analyzer/analyzer.cc
@@ -359,7 +359,7 @@ is_setjmp_call_p (const gcall *call)
   if (is_special_named_call_p (call, "setjmp", 1)
       || is_special_named_call_p (call, "sigsetjmp", 2))
     /* region_model::on_setjmp requires a pointer.  */
-    if (POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
+    if (INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
       return true;
 
   return false;
@@ -374,7 +374,7 @@ is_longjmp_call_p (const gcall *call)
       || is_special_named_call_p (call, "siglongjmp", 2))
     /* exploded_node::on_longjmp requires a pointer for the initial
        argument.  */
-    if (POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
+    if (INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
       return true;
 
   return false;
diff --git a/gcc/analyzer/call-details.h b/gcc/analyzer/call-details.h
index 14a206ff5d6..f2b2d7e751a 100644
--- a/gcc/analyzer/call-details.h
+++ b/gcc/analyzer/call-details.h
@@ -45,7 +45,7 @@ public:
   unsigned num_args () const;
   bool arg_is_pointer_p (unsigned idx) const
   {
-    return POINTER_TYPE_P (get_arg_type (idx));
+    return INDIRECT_TYPE_P (get_arg_type (idx));
   }
   bool arg_is_size_p (unsigned idx) const;
 
diff --git a/gcc/analyzer/call-summary.cc b/gcc/analyzer/call-summary.cc
index a18a1b1b40a..a709a7245fa 100644
--- a/gcc/analyzer/call-summary.cc
+++ b/gcc/analyzer/call-summary.cc
@@ -108,7 +108,7 @@ call_summary::get_user_facing_desc (pretty_printer *pp) const
 		const constant_svalue *constant_sval
 		  = as_a <const constant_svalue *> (result_sval);
 		tree cst = constant_sval->get_constant ();
-		if (POINTER_TYPE_P (TREE_TYPE (result))
+		if (INDIRECT_TYPE_P (TREE_TYPE (result))
 		    && zerop (cst))
 		  pp_printf (pp, "when %qE returns NULL", fndecl);
 		else
diff --git a/gcc/analyzer/checker-event.cc b/gcc/analyzer/checker-event.cc
index 3612df7bd1d..61e70b86795 100644
--- a/gcc/analyzer/checker-event.cc
+++ b/gcc/analyzer/checker-event.cc
@@ -774,8 +774,8 @@ start_cfg_edge_event::maybe_describe_condition (bool can_colorize,
     return label_text::borrow (NULL);
 
   /* Special cases for pointer comparisons against NULL.  */
-  if (POINTER_TYPE_P (TREE_TYPE (lhs))
-      && POINTER_TYPE_P (TREE_TYPE (rhs))
+  if (INDIRECT_TYPE_P (TREE_TYPE (lhs))
+      && INDIRECT_TYPE_P (TREE_TYPE (rhs))
       && zerop (rhs))
     {
       if (op == EQ_EXPR)
diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint-manager.cc
index 9211366fb7c..4d1e6cd36a1 100644
--- a/gcc/analyzer/constraint-manager.cc
+++ b/gcc/analyzer/constraint-manager.cc
@@ -2362,7 +2362,7 @@ constraint_manager::get_or_add_equiv_class (const svalue *sval)
   /* Convert all NULL pointers to (void *) to avoid state explosions
      involving all of the various (foo *)NULL vs (bar *)NULL.  */
   if (sval->get_type ())
-    if (POINTER_TYPE_P (sval->get_type ()))
+    if (INDIRECT_TYPE_P (sval->get_type ()))
       if (tree cst = sval->maybe_get_constant ())
 	if (zerop (cst))
 	  sval = m_mgr->get_or_create_constant_svalue (null_pointer_node);
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 61685f43fba..5e2a316d49c 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -1855,7 +1855,7 @@ exploded_node::on_longjmp (exploded_graph &eg,
 			   region_model_context *ctxt)
 {
   tree buf_ptr = gimple_call_arg (longjmp_call, 0);
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (buf_ptr)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (buf_ptr)));
 
   region_model *new_region_model = new_state->m_region_model;
   const svalue *buf_ptr_sval = new_region_model->get_rvalue (buf_ptr, ctxt);
@@ -2654,7 +2654,7 @@ mark_params_as_tainted (program_state *state, tree fndecl,
       const svalue *init_sval = mgr->get_or_create_initial_value (param_reg);
       smap->set_state (state->m_region_model, init_sval,
 		       tainted, NULL /*origin_new_sval*/, ext_state);
-      if (POINTER_TYPE_P (TREE_TYPE (param)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (param)))
 	{
 	  const region *pointee_reg = mgr->get_symbolic_region (init_sval);
 	  /* Mark "*param" as tainted.  */
diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
index 8dade4b5b3e..e0a550d50ff 100644
--- a/gcc/analyzer/program-state.cc
+++ b/gcc/analyzer/program-state.cc
@@ -719,7 +719,7 @@ sm_state_map::canonicalize_svalue (const svalue *sval,
 				   const extrinsic_state &ext_state)
 {
   region_model_manager *mgr = ext_state.get_model_manager ();
-  if (mgr && sval->get_type () && POINTER_TYPE_P (sval->get_type ()))
+  if (mgr && sval->get_type () && INDIRECT_TYPE_P (sval->get_type ()))
     if (tree cst = sval->maybe_get_constant ())
       if (zerop (cst))
 	return mgr->get_or_create_constant_svalue (null_pointer_node);
diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc
index 4f11ef4bd29..0b9bdc9bc5c 100644
--- a/gcc/analyzer/region-model-manager.cc
+++ b/gcc/analyzer/region-model-manager.cc
@@ -245,7 +245,7 @@ const svalue *
 region_model_manager::get_or_create_null_ptr (tree pointer_type)
 {
   gcc_assert (pointer_type);
-  gcc_assert (POINTER_TYPE_P (pointer_type));
+  gcc_assert (INDIRECT_TYPE_P (pointer_type));
   return get_or_create_int_cst (pointer_type, 0);
 }
 
@@ -419,9 +419,9 @@ region_model_manager::maybe_fold_unaryop (tree type, enum tree_code op,
 	/* Avoid creating symbolic regions for pointer casts by
 	   simplifying (T*)(&REGION) to ((T*)&REGION).  */
 	if (const region_svalue *region_sval = arg->dyn_cast_region_svalue ())
-	  if (POINTER_TYPE_P (type)
+	  if (INDIRECT_TYPE_P (type)
 	      && region_sval->get_type ()
-	      && POINTER_TYPE_P (region_sval->get_type ()))
+	      && INDIRECT_TYPE_P (region_sval->get_type ()))
 	    return get_ptr_svalue (type, region_sval->get_pointee ());
       }
       break;
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index 187013a37cc..2d372501626 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -2463,7 +2463,7 @@ region_model::deref_rvalue (const svalue *ptr_sval, tree ptr_tree,
 			    region_model_context *ctxt) const
 {
   gcc_assert (ptr_sval);
-  gcc_assert (POINTER_TYPE_P (ptr_sval->get_type ()));
+  gcc_assert (INDIRECT_TYPE_P (ptr_sval->get_type ()));
 
   /* If we're dereferencing PTR_SVAL, assume that it is non-NULL; add this
      as a constraint.  This suppresses false positives from
@@ -3143,7 +3143,7 @@ region_model::check_region_size (const region *lhs_reg, const svalue *rhs_sval,
     return;
 
   tree pointer_type = lhs_reg->get_type ();
-  if (pointer_type == NULL_TREE || !POINTER_TYPE_P (pointer_type))
+  if (pointer_type == NULL_TREE || !INDIRECT_TYPE_P (pointer_type))
     return;
 
   tree pointee_type = TREE_TYPE (pointer_type);
@@ -4548,7 +4548,7 @@ region_model::on_top_level_param (tree param,
 				  bool nonnull,
 				  region_model_context *ctxt)
 {
-  if (POINTER_TYPE_P (TREE_TYPE (param)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (param)))
     {
       const region *param_reg = get_lvalue (param, ctxt);
       const svalue *init_ptr_sval
diff --git a/gcc/analyzer/sm.cc b/gcc/analyzer/sm.cc
index 2b88430c012..4d771f46e40 100644
--- a/gcc/analyzer/sm.cc
+++ b/gcc/analyzer/sm.cc
@@ -51,7 +51,7 @@ namespace ana {
 bool
 any_pointer_p (tree var)
 {
-  return POINTER_TYPE_P (TREE_TYPE (var));
+  return INDIRECT_TYPE_P (TREE_TYPE (var));
 }
 
 /* Return true if SVAL has pointer or reference type.  */
@@ -61,7 +61,7 @@ any_pointer_p (const svalue *sval)
 {
   if (!sval->get_type ())
     return false;
-  return POINTER_TYPE_P (sval->get_type ());
+  return INDIRECT_TYPE_P (sval->get_type ());
 }
 
 /* class state_machine::state.  */
diff --git a/gcc/analyzer/svalue.cc b/gcc/analyzer/svalue.cc
index 1444274ad7a..cc19787608a 100644
--- a/gcc/analyzer/svalue.cc
+++ b/gcc/analyzer/svalue.cc
@@ -175,7 +175,7 @@ svalue::can_merge_p (const svalue *other,
     return NULL;
 
   /* Reject attempts to merge NULL pointers with not-NULL-pointers.  */
-  if (POINTER_TYPE_P (get_type ()))
+  if (INDIRECT_TYPE_P (get_type ()))
     {
       bool null0 = false;
       bool null1 = false;
diff --git a/gcc/analyzer/varargs.cc b/gcc/analyzer/varargs.cc
index 72e1b31601c..ad45a401ee8 100644
--- a/gcc/analyzer/varargs.cc
+++ b/gcc/analyzer/varargs.cc
@@ -297,7 +297,7 @@ get_stateful_arg (sm_context *sm_ctxt, const gcall *call, unsigned arg_idx)
 {
   tree ap = gimple_call_arg (call, arg_idx);
   if (ap
-      && POINTER_TYPE_P (TREE_TYPE (ap)))
+      && INDIRECT_TYPE_P (TREE_TYPE (ap)))
     {
       if (const program_state *new_state = sm_ctxt->get_new_program_state ())
 	{
diff --git a/gcc/asan.cc b/gcc/asan.cc
index 2424cf69ef1..84053386061 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -2811,7 +2811,7 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t,
 static void
 maybe_update_mem_ref_hash_table (tree base, tree len)
 {
-  if (!POINTER_TYPE_P (TREE_TYPE (base))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (base))
       || !INTEGRAL_TYPE_P (TREE_TYPE (len)))
     return;
 
@@ -2834,7 +2834,7 @@ instrument_mem_region_access (tree base, tree len,
 			      gimple_stmt_iterator *iter,
 			      location_t location, bool is_store)
 {
-  if (!POINTER_TYPE_P (TREE_TYPE (base))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (base))
       || !INTEGRAL_TYPE_P (TREE_TYPE (len))
       || integer_zerop (len))
     return;
diff --git a/gcc/builtins.cc b/gcc/builtins.cc
index 6dff5214ff8..9624614a11c 100644
--- a/gcc/builtins.cc
+++ b/gcc/builtins.cc
@@ -450,7 +450,7 @@ get_pointer_alignment_1 (tree exp, unsigned int *alignp,
       return res;
     }
   else if (TREE_CODE (exp) == SSA_NAME
-	   && POINTER_TYPE_P (TREE_TYPE (exp)))
+	   && INDIRECT_TYPE_P (TREE_TYPE (exp)))
     {
       unsigned int ptr_align, ptr_misalign;
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (exp);
@@ -1375,7 +1375,7 @@ get_memory_rtx (tree exp, tree len)
   /* Get an expression we can use to find the attributes to assign to MEM.
      First remove any nops.  */
   while (CONVERT_EXPR_P (exp)
-	 && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
+	 && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
     exp = TREE_OPERAND (exp, 0);
 
   /* Build a MEM_REF representing the whole accessed area as a byte blob,
@@ -5112,7 +5112,7 @@ std_canonical_va_list_type (tree type)
 	 In that case, unwrap both types so that we can compare the
 	 underlying records.  */
       if (TREE_CODE (htype) == ARRAY_TYPE
-	  || POINTER_TYPE_P (htype))
+	  || INDIRECT_TYPE_P (htype))
 	{
 	  wtype = TREE_TYPE (wtype);
 	  htype = TREE_TYPE (htype);
@@ -5980,7 +5980,7 @@ static rtx
 get_builtin_sync_mem (tree loc, machine_mode mode)
 {
   rtx addr, mem;
-  int addr_space = TYPE_ADDR_SPACE (POINTER_TYPE_P (TREE_TYPE (loc))
+  int addr_space = TYPE_ADDR_SPACE (INDIRECT_TYPE_P (TREE_TYPE (loc))
 				    ? TREE_TYPE (TREE_TYPE (loc))
 				    : TREE_TYPE (loc));
   scalar_int_mode addr_mode = targetm.addr_space.address_mode (addr_space);
@@ -6821,13 +6821,13 @@ fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
 	 parameter at this point is usually cast to a void *, so check for that
 	 and look past the cast.  */
       if (CONVERT_EXPR_P (arg1)
-	  && POINTER_TYPE_P (ttype)
+	  && INDIRECT_TYPE_P (ttype)
 	  && VOID_TYPE_P (TREE_TYPE (ttype))
-	  && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0))))
+	  && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0))))
 	arg1 = TREE_OPERAND (arg1, 0);
 
       ttype = TREE_TYPE (arg1);
-      gcc_assert (POINTER_TYPE_P (ttype));
+      gcc_assert (INDIRECT_TYPE_P (ttype));
 
       /* Get the underlying type of the object.  */
       ttype = TREE_TYPE (ttype);
@@ -8523,9 +8523,9 @@ builtin_mathfn_code (const_tree t)
 	  if (! COMPLEX_FLOAT_TYPE_P (argtype))
 	    return END_BUILTINS;
 	}
-      else if (POINTER_TYPE_P (parmtype))
+      else if (INDIRECT_TYPE_P (parmtype))
 	{
-	  if (! POINTER_TYPE_P (argtype))
+	  if (! INDIRECT_TYPE_P (argtype))
 	    return END_BUILTINS;
 	}
       else if (INTEGRAL_TYPE_P (parmtype))
@@ -8576,7 +8576,7 @@ fold_builtin_constant_p (tree arg)
      more optimization done.  */
   if (TREE_SIDE_EFFECTS (arg)
       || AGGREGATE_TYPE_P (TREE_TYPE (arg))
-      || POINTER_TYPE_P (TREE_TYPE (arg))
+      || INDIRECT_TYPE_P (TREE_TYPE (arg))
       || cfun == 0
       || folding_initializer
       || force_folding_builtin_constant_p)
@@ -10162,7 +10162,7 @@ validate_arg (const_tree arg, enum tree_code code)
   if (!arg)
     return false;
   else if (code == POINTER_TYPE)
-    return POINTER_TYPE_P (TREE_TYPE (arg));
+    return INDIRECT_TYPE_P (TREE_TYPE (arg));
   else if (code == INTEGER_TYPE)
     return INTEGRAL_TYPE_P (TREE_TYPE (arg));
   return code == TREE_CODE (TREE_TYPE (arg));
@@ -10801,7 +10801,7 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
       if (nargs < 5)
 	return;
       arg = CALL_EXPR_ARG (exp, 4);
-      if (! POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (! INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	return;
 
       len = c_strlen (arg, 1);
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc
index 050994d8416..a241d9a381f 100644
--- a/gcc/c-family/c-ada-spec.cc
+++ b/gcc/c-family/c-ada-spec.cc
@@ -1679,7 +1679,7 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func,
 	 parameter that is not the first one of a method which either has a
 	 slot in the virtual table or is a constructor.  */
       if (TREE_TYPE (arg)
-	  && POINTER_TYPE_P (TREE_TYPE (arg))
+	  && INDIRECT_TYPE_P (TREE_TYPE (arg))
 	  && is_tagged_type (TREE_TYPE (TREE_TYPE (arg)))
 	  && !(num == 1 && is_method && (DECL_VINDEX (func) || is_constructor)))
 	pp_string (buffer, "'Class");
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index 852fd2503ec..bf0b1f1a9a4 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -2145,7 +2145,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
 	  return NULL_TREE;
 	}
 
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	{
 	  scalar_int_mode addr_mode;
 	  addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type));
@@ -2953,7 +2953,7 @@ handle_copy_attribute (tree *node, tree name, tree args,
      which copies type attributes from struct T to the declaration
      of struct U.  */
   if ((CONSTANT_CLASS_P (ref) || EXPR_P (ref))
-      && POINTER_TYPE_P (TREE_TYPE (ref))
+      && INDIRECT_TYPE_P (TREE_TYPE (ref))
       && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (ref)))
     ref = TREE_TYPE (ref);
 
@@ -2964,13 +2964,13 @@ handle_copy_attribute (tree *node, tree name, tree args,
       if ((VAR_P (decl)
 	   && (TREE_CODE (ref) == FUNCTION_DECL
 	       || (EXPR_P (ref)
-		   && POINTER_TYPE_P (reftype)
+		   && INDIRECT_TYPE_P (reftype)
 		   && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (reftype)))))
 	  || (TREE_CODE (decl) == FUNCTION_DECL
 	      && (VAR_P (ref)
 		  || (EXPR_P (ref)
 		      && !FUNC_OR_METHOD_TYPE_P (reftype)
-		      && (!POINTER_TYPE_P (reftype)
+		      && (!INDIRECT_TYPE_P (reftype)
 			  || !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (reftype)))))))
 	{
 	  /* It makes no sense to try to copy function attributes
@@ -3046,7 +3046,7 @@ handle_copy_attribute (tree *node, tree name, tree args,
       && FUNC_OR_METHOD_TYPE_P (reftype))
     TREE_THIS_VOLATILE (decl) = true;
 
-  if (POINTER_TYPE_P (reftype))
+  if (INDIRECT_TYPE_P (reftype))
     reftype = TREE_TYPE (reftype);
 
   if (!TYPE_P (reftype))
@@ -3389,7 +3389,7 @@ handle_malloc_attribute (tree *node, tree name, tree args, int flags,
     }
 
   tree rettype = TREE_TYPE (TREE_TYPE (*node));
-  if (!POINTER_TYPE_P (rettype))
+  if (!INDIRECT_TYPE_P (rettype))
     {
       warning (OPT_Wattributes, "%qE attribute ignored on functions "
 	       "returning %qT; valid only for pointer return types",
@@ -3587,7 +3587,7 @@ handle_alloc_size_attribute (tree *node, tree name, tree args,
 {
   tree fntype = *node;
   tree rettype = TREE_TYPE (fntype);
-  if (!POINTER_TYPE_P (rettype))
+  if (!INDIRECT_TYPE_P (rettype))
     {
       warning (OPT_Wattributes,
 	       "%qE attribute ignored on a function returning %qT",
@@ -3635,7 +3635,7 @@ handle_alloc_align_attribute (tree *node, tree name, tree args, int,
 {
   tree fntype = *node;
   tree rettype = TREE_TYPE (fntype);
-  if (!POINTER_TYPE_P (rettype))
+  if (!INDIRECT_TYPE_P (rettype))
     {
       warning (OPT_Wattributes,
 	       "%qE attribute ignored on a function returning %qT",
@@ -4332,7 +4332,7 @@ type_for_vector_size (tree type)
      In this case, the mode is SI, but the type being modified is
      HI, so we need to look further.  */
 
-  while (POINTER_TYPE_P (type)
+  while (INDIRECT_TYPE_P (type)
 	 || TREE_CODE (type) == FUNCTION_TYPE
 	 || TREE_CODE (type) == METHOD_TYPE
 	 || TREE_CODE (type) == ARRAY_TYPE
@@ -4625,7 +4625,7 @@ handle_nonstring_attribute (tree *node, tree name, tree ARG_UNUSED (args),
     {
       tree type = TREE_TYPE (*node);
 
-      if (POINTER_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
+      if (INDIRECT_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
 	{
 	  /* Accept the attribute on arrays and pointers to all three
 	     narrow character types.  */
@@ -4942,7 +4942,7 @@ handle_access_attribute (tree node[3], tree name, tree args, int flags,
 {
   tree attrs = TYPE_ATTRIBUTES (*node);
   tree type = *node;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       tree ptype = TREE_TYPE (type);
       if (FUNC_OR_METHOD_TYPE_P (ptype))
@@ -5153,7 +5153,7 @@ handle_access_attribute (tree node[3], tree name, tree args, int flags,
       return NULL_TREE;
     }
 
-  if (!POINTER_TYPE_P (argtypes[0]))
+  if (!INDIRECT_TYPE_P (argtypes[0]))
     {
       /* The first argument must have a pointer or reference type.  */
       error ("attribute %qs positional argument 1 references "
@@ -5292,7 +5292,7 @@ build_attr_access_from_parms (tree parms, bool skip_voidptr)
       if (!argspec)
 	continue;
 
-      if (POINTER_TYPE_P (argtype))
+      if (INDIRECT_TYPE_P (argtype))
 	{
 	  /* void* arguments in user-defined functions could point to
 	     anything; skip them.  */
@@ -5879,7 +5879,7 @@ handle_nsobject_attribute (tree *node, tree name, tree args,
   /* The original implementation only allowed pointers to records, however
      recent implementations also allow void *.  */
   tree type = TREE_TYPE (*node);
-  if (!type || !POINTER_TYPE_P (type)
+  if (!type || !INDIRECT_TYPE_P (type)
       || (TREE_CODE (TREE_TYPE (type)) != RECORD_TYPE
           && !VOID_TYPE_P (TREE_TYPE (type))))
     {
@@ -5923,7 +5923,7 @@ handle_objc_nullability_attribute (tree *node, tree name, tree args,
   if (TREE_CODE (*node) == FUNCTION_DECL)
     type = TREE_TYPE (type);
 
-  if (type && !POINTER_TYPE_P (type))
+  if (type && !INDIRECT_TYPE_P (type))
     {
       error ("%qE cannot be applied to non-pointer type %qT", name, type);
       return NULL_TREE;
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 6add84c9504..6583acecea7 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -1412,7 +1412,7 @@ shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
 	   && (type
 	       = c_common_signed_or_unsigned_type (unsigned1,
 						   TREE_TYPE (arg1)))
-	   && !POINTER_TYPE_P (type)
+	   && !INDIRECT_TYPE_P (type)
 	   && int_fits_type_p (arg0, type))
     return type;
 
@@ -1423,7 +1423,7 @@ shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
 	   && (type
 	       = c_common_signed_or_unsigned_type (unsigned0,
 						   TREE_TYPE (arg0)))
-	   && !POINTER_TYPE_P (type)
+	   && !INDIRECT_TYPE_P (type)
 	   && int_fits_type_p (arg1, type))
     return type;
 
@@ -3655,7 +3655,7 @@ c_common_truthvalue_conversion (location_t location, tree expr)
 	tree totype = TREE_TYPE (expr);
 	tree fromtype = TREE_TYPE (TREE_OPERAND (expr, 0));
 
-	if (POINTER_TYPE_P (totype)
+	if (INDIRECT_TYPE_P (totype)
 	    && !c_inhibit_evaluation_warnings
 	    && TYPE_REF_P (fromtype))
 	  {
@@ -3784,7 +3784,7 @@ c_apply_type_quals_to_decl (int type_quals, tree decl)
 	   FIXME currently we just ignore it.  */
 	type = TREE_TYPE (type);
       if (!type
-	  || !POINTER_TYPE_P (type)
+	  || !INDIRECT_TYPE_P (type)
 	  || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type)))
 	error ("invalid use of %<restrict%>");
     }
@@ -4865,7 +4865,7 @@ build_va_arg (location_t loc, tree expr, tree type)
   else
     {
       /* Case 2b: va_list is pointer to array elem type.  */
-      gcc_assert (POINTER_TYPE_P (va_type));
+      gcc_assert (INDIRECT_TYPE_P (va_type));
 
       /* Comparison as in std_canonical_va_list_type.  */
       gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (va_type))
@@ -5023,7 +5023,7 @@ self_promoting_args_p (const_tree parms)
 tree
 strip_pointer_operator (tree t)
 {
-  while (POINTER_TYPE_P (t))
+  while (INDIRECT_TYPE_P (t))
     t = TREE_TYPE (t);
   return t;
 }
@@ -5032,7 +5032,7 @@ strip_pointer_operator (tree t)
 tree
 strip_pointer_or_array_types (tree t)
 {
-  while (TREE_CODE (t) == ARRAY_TYPE || POINTER_TYPE_P (t))
+  while (TREE_CODE (t) == ARRAY_TYPE || INDIRECT_TYPE_P (t))
     t = TREE_TYPE (t);
   return t;
 }
@@ -5085,9 +5085,9 @@ c_add_case_label (location_t loc, splay_tree cases, tree cond,
     goto error_out;
 
   if ((low_value && TREE_TYPE (low_value)
-       && POINTER_TYPE_P (TREE_TYPE (low_value)))
+       && INDIRECT_TYPE_P (TREE_TYPE (low_value)))
       || (high_value && TREE_TYPE (high_value)
-	  && POINTER_TYPE_P (TREE_TYPE (high_value))))
+	  && INDIRECT_TYPE_P (TREE_TYPE (high_value))))
     {
       error_at (loc, "pointers are not permitted as case values");
       goto error_out;
@@ -5703,7 +5703,7 @@ check_function_sentinel (const_tree fntype, int nargs, tree *argarray)
 
       /* Validate the sentinel.  */
       sentinel = fold_for_warn (argarray[nargs - 1 - pos]);
-      if ((!POINTER_TYPE_P (TREE_TYPE (sentinel))
+      if ((!INDIRECT_TYPE_P (TREE_TYPE (sentinel))
 	   || !integer_zerop (sentinel))
 	  /* Although __null (in C++) is only an integer we allow it
 	     nevertheless, as we are guaranteed that it's exactly
@@ -5764,7 +5764,7 @@ check_function_restrict (const_tree fndecl, const_tree fntype,
 	  type = TREE_VALUE (parms);
 	  parms = TREE_CHAIN (parms);
 	}
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  && TYPE_RESTRICT (type)
 	  && !TYPE_READONLY (TREE_TYPE (type)))
 	warned |= warn_for_restrict (i, argarray.address (), nargs);
@@ -6466,7 +6466,7 @@ check_builtin_function_arguments (location_t loc, vec<location_t> arg_loc,
     case BUILT_IN_CLEAR_PADDING:
       if (builtin_function_validate_nargs (loc, fndecl, nargs, 1))
 	{
-	  if (!POINTER_TYPE_P (TREE_TYPE (args[0])))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (args[0])))
 	    {
 	      error_at (ARG_LOCATION (0), "argument %u in call to function "
 			"%qE does not have pointer type", 1, fndecl);
@@ -6852,7 +6852,7 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx)
       gcc_unreachable ();
     }
 
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return size_binop (PLUS_EXPR, base, convert (type, off));
   return fold_build_pointer_plus (base, off);
 }
@@ -7088,7 +7088,7 @@ speculation_safe_value_resolve_call (tree function, vec<tree, va_gc> *params)
       type = TREE_TYPE ((*params)[0]);
     }
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     return BUILT_IN_SPECULATION_SAFE_VALUE_PTR;
 
   if (!INTEGRAL_TYPE_P (type))
@@ -7213,7 +7213,7 @@ sync_resolve_size (tree function, vec<tree, va_gc> *params, bool fetch)
     goto incompatible;
 
   type = TREE_TYPE (type);
-  if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+  if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
     goto incompatible;
 
   if (!COMPLETE_TYPE_P (type))
@@ -7432,7 +7432,7 @@ get_atomic_generic_size (location_t loc, tree function,
 	  (*params)[x] = default_conversion ((*params)[x]);
 	  type = TREE_TYPE ((*params)[x]);
 	}
-      if (!POINTER_TYPE_P (type))
+      if (!INDIRECT_TYPE_P (type))
 	{
 	  error_at (loc, "argument %d of %qE must be a pointer type", x + 1,
 		    function);
@@ -8710,7 +8710,7 @@ cxx_fundamental_alignment_p (unsigned align)
 bool
 pointer_to_zero_sized_aggr_p (tree t)
 {
-  if (!POINTER_TYPE_P (t))
+  if (!INDIRECT_TYPE_P (t))
     return false;
   t = TREE_TYPE (t);
   return (TYPE_SIZE (t) && integer_zerop (TYPE_SIZE (t)));
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc
index 4faddb00bbc..974adb23a77 100644
--- a/gcc/c-family/c-omp.cc
+++ b/gcc/c-family/c-omp.cc
@@ -234,7 +234,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
      And lets not even talk about vector types...  */
   type = TREE_TYPE (lhs);
   if (!INTEGRAL_TYPE_P (type)
-      && !POINTER_TYPE_P (type)
+      && !INDIRECT_TYPE_P (type)
       && !SCALAR_FLOAT_TYPE_P (type))
     {
       error_at (loc, "invalid expression type for %<#pragma omp atomic%>");
@@ -912,7 +912,7 @@ check_omp_for_incr_expr (location_t loc, tree exp, tree decl)
 static tree
 c_omp_for_incr_canonicalize_ptr (location_t loc, tree decl, tree incr)
 {
-  if (POINTER_TYPE_P (TREE_TYPE (decl))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl))
       && TREE_OPERAND (incr, 1))
     {
       tree t = fold_convert_loc (loc,
@@ -3032,7 +3032,7 @@ c_omp_adjust_map_clauses (tree clauses, bool is_target)
 	if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
 	    && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER
 	    && DECL_P (OMP_CLAUSE_DECL (c))
-	    && POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
+	    && INDIRECT_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
 	  {
 	    tree ptr = OMP_CLAUSE_DECL (c);
 	    OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_ATTACH_DETACH);
@@ -3057,7 +3057,7 @@ c_omp_adjust_map_clauses (tree clauses, bool is_target)
 	   and merge them with a hash_map to process below.  */
 
 	if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER
-	    && POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
+	    && INDIRECT_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
 	  {
 	    tree ptr = OMP_CLAUSE_DECL (c);
 	    map_clause &mc = maps.get_or_insert (ptr);
diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc
index 63a77231500..629b02c294e 100644
--- a/gcc/c-family/c-pretty-print.cc
+++ b/gcc/c-family/c-pretty-print.cc
@@ -210,7 +210,7 @@ pp_c_type_cast (c_pretty_printer *pp, tree t)
 void
 pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
 {
-  if (POINTER_TYPE_P (t))
+  if (INDIRECT_TYPE_P (t))
     {
       tree pointee = strip_pointer_operator (TREE_TYPE (t));
       if (TREE_CODE (pointee) != ARRAY_TYPE
diff --git a/gcc/c-family/c-ubsan.cc b/gcc/c-family/c-ubsan.cc
index 355dc67aa61..2a427a81675 100644
--- a/gcc/c-family/c-ubsan.cc
+++ b/gcc/c-family/c-ubsan.cc
@@ -561,7 +561,7 @@ ubsan_maybe_instrument_reference_or_call (location_t loc, tree op, tree ptype,
 	instrument = true;
       if (mina && mina > 1)
 	{
-	  if (!POINTER_TYPE_P (TREE_TYPE (op))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (op))
 	      || mina > get_pointer_alignment (op) / BITS_PER_UNIT)
 	    instrument = true;
 	}
@@ -569,7 +569,7 @@ ubsan_maybe_instrument_reference_or_call (location_t loc, tree op, tree ptype,
   if (!instrument)
     return NULL_TREE;
   op = save_expr (orig_op);
-  gcc_assert (POINTER_TYPE_P (ptype));
+  gcc_assert (INDIRECT_TYPE_P (ptype));
   if (TYPE_REF_P (ptype))
     ptype = build_pointer_type (TREE_TYPE (ptype));
   tree kind = build_int_cst (ptype, ckind);
@@ -612,7 +612,7 @@ ubsan_maybe_instrument_member_call (tree stmt, bool is_ctor)
     return;
   tree op = CALL_EXPR_ARG (stmt, 0);
   if (op == error_mark_node
-      || !POINTER_TYPE_P (TREE_TYPE (op)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (op)))
     return;
   op = ubsan_maybe_instrument_reference_or_call (EXPR_LOCATION (stmt), op,
 						 TREE_TYPE (op),
diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc
index b92b4f9ecb1..2a40e70fbe1 100644
--- a/gcc/c-family/c-warn.cc
+++ b/gcc/c-family/c-warn.cc
@@ -702,8 +702,8 @@ strict_aliasing_warning (location_t loc, tree type, tree expr)
   tree otype = TREE_TYPE (expr);
 
   if (!(flag_strict_aliasing
-	&& POINTER_TYPE_P (type)
-	&& POINTER_TYPE_P (otype)
+	&& INDIRECT_TYPE_P (type)
+	&& INDIRECT_TYPE_P (otype)
 	&& !VOID_TYPE_P (TREE_TYPE (type)))
       /* If the type we are casting to is a ref-all pointer
 	 dereferencing it is always valid.  */
@@ -879,7 +879,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
   type = TYPE_P (sizeof_arg[idx])
 	 ? sizeof_arg[idx] : TREE_TYPE (sizeof_arg[idx]);
 
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     {
       /* The argument type may be an array.  Diagnose bounded string
 	 copy functions that specify the bound in terms of the source
@@ -921,13 +921,13 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
 
   if (dest
       && (tem = tree_strip_nop_conversions (dest))
-      && POINTER_TYPE_P (TREE_TYPE (tem))
+      && INDIRECT_TYPE_P (TREE_TYPE (tem))
       && comp_types (TREE_TYPE (TREE_TYPE (tem)), type))
     return;
 
   if (src
       && (tem = tree_strip_nop_conversions (src))
-      && POINTER_TYPE_P (TREE_TYPE (tem))
+      && INDIRECT_TYPE_P (TREE_TYPE (tem))
       && comp_types (TREE_TYPE (TREE_TYPE (tem)), type))
     return;
 
@@ -959,7 +959,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
 	  return;
 	}
 
-      if (POINTER_TYPE_P (TREE_TYPE (dest))
+      if (INDIRECT_TYPE_P (TREE_TYPE (dest))
 	  && !strop
 	  && comp_types (TREE_TYPE (dest), type)
 	  && !VOID_TYPE_P (TREE_TYPE (type)))
@@ -999,7 +999,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
 	  return;
 	}
 
-      if (POINTER_TYPE_P (TREE_TYPE (src))
+      if (INDIRECT_TYPE_P (TREE_TYPE (src))
 	  && !strop
 	  && comp_types (TREE_TYPE (src), type)
 	  && !VOID_TYPE_P (TREE_TYPE (type)))
@@ -1039,7 +1039,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
 	  return;
 	}
 
-      if (POINTER_TYPE_P (TREE_TYPE (dest))
+      if (INDIRECT_TYPE_P (TREE_TYPE (dest))
 	  && !strop
 	  && comp_types (TREE_TYPE (dest), type)
 	  && !VOID_TYPE_P (TREE_TYPE (type)))
@@ -1079,7 +1079,7 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
 	  return;
 	}
 
-      if (POINTER_TYPE_P (TREE_TYPE (src))
+      if (INDIRECT_TYPE_P (TREE_TYPE (src))
 	  && !strop
 	  && comp_types (TREE_TYPE (src), type)
 	  && !VOID_TYPE_P (TREE_TYPE (type)))
@@ -1116,7 +1116,7 @@ check_main_parameter_types (tree decl)
 	  pedwarn (input_location, OPT_Wmain,
 		   "%<_Atomic%>-qualified parameter type %qT of %q+D",
 		   type, decl);
-      while (POINTER_TYPE_P (t))
+      while (INDIRECT_TYPE_P (t))
 	{
 	  t = TREE_TYPE (t);
 	  if (TYPE_ATOMIC (t))
@@ -3012,7 +3012,7 @@ check_address_or_pointer_of_packed_member (tree type, tree rhs)
       rvalue = indirect;
     }
 
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return NULL_TREE;
 
   type = TREE_TYPE (type);
@@ -3030,15 +3030,15 @@ check_address_or_pointer_of_packed_member (tree type, tree rhs)
 	  rhs = TREE_TYPE (rhs);	/* Pointer type.  */
 	  /* We could be called while processing a template and RHS could be
 	     a functor.  In that case it's a class, not a pointer.  */
-	  if (!POINTER_TYPE_P (rhs))
+	  if (!INDIRECT_TYPE_P (rhs))
 	    return NULL_TREE;
 	  rhs = TREE_TYPE (rhs);	/* Function type.  */
 	  rhstype = TREE_TYPE (rhs);
-	  if (!rhstype || !POINTER_TYPE_P (rhstype))
+	  if (!rhstype || !INDIRECT_TYPE_P (rhstype))
 	    return NULL_TREE;
 	  rvalue = true;
 	}
-      if (rvalue && POINTER_TYPE_P (rhstype))
+      if (rvalue && INDIRECT_TYPE_P (rhstype))
 	rhstype = TREE_TYPE (rhstype);
       while (TREE_CODE (rhstype) == ARRAY_TYPE)
 	rhstype = TREE_TYPE (rhstype);
@@ -3168,7 +3168,7 @@ warn_for_address_or_pointer_of_packed_member (tree type, tree rhs)
     return;
 
   /* Don't warn if we don't assign RHS to a pointer.  */
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return;
 
   check_and_warn_address_or_pointer_of_packed_member (type, rhs);
@@ -3458,7 +3458,7 @@ warn_parm_array_mismatch (location_t origloc, tree fndecl, tree newparms)
       /* Only check pointers and C++ references.  */
       tree curptype = TREE_TYPE (curp);
       tree newptype = TREE_TYPE (newp);
-      if (!POINTER_TYPE_P (curptype) || !POINTER_TYPE_P (newptype))
+      if (!INDIRECT_TYPE_P (curptype) || !INDIRECT_TYPE_P (newptype))
 	continue;
 
       /* Skip mismatches in __builtin_va_list that is commonly
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index ecd10ebb69c..22bae0884b0 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -1731,7 +1731,7 @@ static bool
 types_close_enough_to_match (tree t1, tree t2)
 {
   return (TYPE_MODE (t1) == TYPE_MODE (t2)
-	  && POINTER_TYPE_P (t1) == POINTER_TYPE_P (t2)
+	  && INDIRECT_TYPE_P (t1) == INDIRECT_TYPE_P (t2)
 	  && FUNCTION_POINTER_TYPE_P (t1) == FUNCTION_POINTER_TYPE_P (t2));
 }
 
@@ -1789,7 +1789,7 @@ match_builtin_function_types (tree newtype, tree oldtype,
 	return NULL_TREE;
 
       unsigned j = nbst;
-      if (POINTER_TYPE_P (oldtype))
+      if (INDIRECT_TYPE_P (oldtype))
 	/* Iterate over well-known struct types like FILE (whose types
 	   aren't known to us) and compare the pointer to each to
 	   the pointer argument.  */
@@ -1816,7 +1816,7 @@ match_builtin_function_types (tree newtype, tree oldtype,
 
       if (j == nbst && !comptypes (oldtype, newtype))
 	{
-	  if (POINTER_TYPE_P (oldtype))
+	  if (INDIRECT_TYPE_P (oldtype))
 	    {
 	      /* For incompatible pointers, only reject differences in
 		 the unqualified variants of the referenced types but
@@ -7474,7 +7474,7 @@ grokdeclarator (const struct c_declarator *declarator,
 		   this.  */
 		if (flag_isoc11
 		    && (type_quals & TYPE_QUAL_RESTRICT)
-		    && (!POINTER_TYPE_P (type)
+		    && (!INDIRECT_TYPE_P (type)
 			|| !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type))))
 		  error_at (loc, "invalid use of %<restrict%>");
 		type = c_build_qualified_type (type, quals_used);
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 24a6eb6e459..eb31e3fcb63 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -8385,7 +8385,7 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after,
 	      type0 = TREE_TYPE (type0);				      \
 	    if (!TYPE_P (type1))					      \
 	      type1 = TREE_TYPE (type1);				      \
-	    if (POINTER_TYPE_P (type0)					      \
+	    if (INDIRECT_TYPE_P (type0)					      \
 		&& comptypes (TREE_TYPE (type0), type1)			      \
 		&& !(TREE_CODE (first_arg) == PARM_DECL			      \
 		     && C_ARRAY_PARAMETER (first_arg)			      \
@@ -14171,7 +14171,7 @@ c_parser_oacc_data_clause_deviceptr (c_parser *parser, tree list)
 	error_at (loc, "%qD is not a variable", v);
       else if (TREE_TYPE (v) == error_mark_node)
 	;
-      else if (!POINTER_TYPE_P (TREE_TYPE (v)))
+      else if (!INDIRECT_TYPE_P (TREE_TYPE (v)))
 	error_at (loc, "%qD is not a pointer variable", v);
 
       tree u = build_omp_clause (loc, OMP_CLAUSE_MAP);
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 7cf411155c6..a04e56673e5 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -4002,7 +4002,7 @@ parser_build_binary_op (location_t location, enum tree_code code,
 	warning_at (location, OPT_Waddress,
 		    "comparison with string literal results in unspecified behavior");
       /* Warn for ptr == '\0', it's likely that it should've been ptr[0].  */
-      if (POINTER_TYPE_P (type1)
+      if (INDIRECT_TYPE_P (type1)
 	  && null_pointer_constant_p (arg2.value)
 	  && char_type_p (type2))
 	{
@@ -4013,7 +4013,7 @@ parser_build_binary_op (location_t location, enum tree_code code,
 	    inform (arg1.get_start (),
 		      "did you mean to dereference the pointer?");
 	}
-      else if (POINTER_TYPE_P (type2)
+      else if (INDIRECT_TYPE_P (type2)
 	       && null_pointer_constant_p (arg1.value)
 	       && char_type_p (type1))
 	{
@@ -4309,7 +4309,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
   /* Attempt to implement the atomic operation as an __atomic_fetch_* or
      __atomic_*_fetch built-in rather than a CAS loop.  atomic_bool type
      isn't applicable for such builtins.  ??? Do we want to handle enums?  */
-  if ((TREE_CODE (lhs_type) == INTEGER_TYPE || POINTER_TYPE_P (lhs_type))
+  if ((TREE_CODE (lhs_type) == INTEGER_TYPE || INDIRECT_TYPE_P (lhs_type))
       && TREE_CODE (rhs_type) == INTEGER_TYPE)
     {
       built_in_function fncode;
@@ -4353,7 +4353,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
 
       /* If this is a pointer type, we need to multiply by the size of
 	 the pointer target type.  */
-      if (POINTER_TYPE_P (lhs_type))
+      if (INDIRECT_TYPE_P (lhs_type))
 	{
 	  if (!COMPLETE_TYPE_P (TREE_TYPE (lhs_type))
 	      /* ??? This would introduce -Wdiscarded-qualifiers
@@ -4977,7 +4977,7 @@ build_unary_op (location_t location, enum tree_code code, tree xarg,
 	  if (TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (TREE_OPERAND (arg, 0))))
 	    {
 	      if (!AGGREGATE_TYPE_P (TREE_TYPE (arg))
-		  && !POINTER_TYPE_P (TREE_TYPE (arg))
+		  && !INDIRECT_TYPE_P (TREE_TYPE (arg))
 		  && !VECTOR_TYPE_P (TREE_TYPE (arg)))
 		{
 		  error_at (location, "cannot take address of scalar with "
@@ -6607,11 +6607,11 @@ convert_to_anonymous_field (location_t location, tree type, tree rhs)
   bool found_sub_field;
   tree ret;
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (rhs)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (rhs)));
   rhs_struct_type = TREE_TYPE (TREE_TYPE (rhs));
   gcc_assert (RECORD_OR_UNION_TYPE_P (rhs_struct_type));
 
-  gcc_assert (POINTER_TYPE_P (type));
+  gcc_assert (INDIRECT_TYPE_P (type));
   lhs_main_type = (TYPE_ATOMIC (TREE_TYPE (type))
 		   ? c_build_qualified_type (TREE_TYPE (type),
 					     TYPE_QUAL_ATOMIC)
@@ -8161,7 +8161,7 @@ static void
 check_constexpr_init (location_t loc, tree type, tree init,
 		      bool int_const_expr, bool arith_const_expr)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       /* The initializer must be null.  */
       if (TREE_CODE (init) != INTEGER_CST || !integer_zerop (init))
@@ -11216,7 +11216,7 @@ c_finish_goto_ptr (location_t loc, c_expr val)
   tree t;
   pedwarn (loc, OPT_Wpedantic, "ISO C forbids %<goto *expr;%>");
   if (expr != error_mark_node
-      && !POINTER_TYPE_P (TREE_TYPE (expr))
+      && !INDIRECT_TYPE_P (TREE_TYPE (expr))
       && !null_pointer_constant_p (expr))
     {
       error_at (val.get_location (),
@@ -11348,12 +11348,12 @@ c_finish_return (location_t loc, tree retval, tree origtype)
 	      {
 		tree op1 = TREE_OPERAND (inner, 1);
 
-		while (!POINTER_TYPE_P (TREE_TYPE (op1))
+		while (!INDIRECT_TYPE_P (TREE_TYPE (op1))
 		       && (CONVERT_EXPR_P (op1)
 			   || TREE_CODE (op1) == NON_LVALUE_EXPR))
 		  op1 = TREE_OPERAND (op1, 0);
 
-		if (POINTER_TYPE_P (TREE_TYPE (op1)))
+		if (INDIRECT_TYPE_P (TREE_TYPE (op1)))
 		  break;
 
 		inner = TREE_OPERAND (inner, 0);
@@ -11371,7 +11371,7 @@ c_finish_return (location_t loc, tree retval, tree origtype)
 		  && !DECL_EXTERNAL (inner)
 		  && !TREE_STATIC (inner)
 		  && DECL_CONTEXT (inner) == current_function_decl
-		  && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
+		  && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
 		{
 		  if (TREE_CODE (inner) == LABEL_DECL)
 		    warning_at (loc, OPT_Wreturn_local_addr,
@@ -13729,7 +13729,7 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
       if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_AFFINITY
 	   || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND)
 	  && TYPE_ATOMIC (TREE_TYPE (t))
-	  && POINTER_TYPE_P (TREE_TYPE (t)))
+	  && INDIRECT_TYPE_P (TREE_TYPE (t)))
 	{
 	  /* If the array section is pointer based and the pointer
 	     itself is _Atomic qualified, we need to atomically load
@@ -14266,7 +14266,7 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort)
       t = build_fold_addr_expr (first);
       t = fold_convert_loc (OMP_CLAUSE_LOCATION (c), ptrdiff_type_node, t);
       tree ptr = OMP_CLAUSE_DECL (c2);
-      if (!POINTER_TYPE_P (TREE_TYPE (ptr)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	ptr = build_fold_addr_expr (ptr);
       t = fold_build2_loc (OMP_CLAUSE_LOCATION (c), MINUS_EXPR,
 			   ptrdiff_type_node, t,
@@ -14381,7 +14381,7 @@ c_omp_finish_iterators (tree iter)
 	  ret = true;
 	  continue;
 	}
-      if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+      if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
 	{
 	  error_at (loc, "iterator %qD has neither integral nor pointer type",
 		    var);
@@ -14416,9 +14416,9 @@ c_omp_finish_iterators (tree iter)
       begin = c_fully_fold (build_c_cast (loc, type, begin), false, NULL);
       end = c_fully_fold (build_c_cast (loc, type, end), false, NULL);
       orig_step = save_expr (c_fully_fold (step, false, NULL));
-      tree stype = POINTER_TYPE_P (type) ? sizetype : type;
+      tree stype = INDIRECT_TYPE_P (type) ? sizetype : type;
       step = c_fully_fold (build_c_cast (loc, stype, orig_step), false, NULL);
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	{
 	  begin = save_expr (begin);
 	  step = pointer_int_sum (loc, PLUS_EXPR, begin, step);
@@ -15119,7 +15119,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
 			"%qE is not a variable in %<aligned%> clause", t);
 	      remove = true;
 	    }
-	  else if (!POINTER_TYPE_P (TREE_TYPE (t))
+	  else if (!INDIRECT_TYPE_P (TREE_TYPE (t))
 		   && TREE_CODE (TREE_TYPE (t)) != ARRAY_TYPE)
 	    {
 	      error_at (OMP_CLAUSE_LOCATION (c),
@@ -16312,10 +16312,10 @@ c_build_qualified_type (tree type, int type_quals, tree orig_qual_type,
     }
 
   /* A restrict-qualified pointer type must be a pointer to object or
-     incomplete type.  Note that the use of POINTER_TYPE_P also allows
+     incomplete type.  Note that the use of INDIRECT_TYPE_P also allows
      REFERENCE_TYPEs, which is appropriate for C++.  */
   if ((type_quals & TYPE_QUAL_RESTRICT)
-      && (!POINTER_TYPE_P (type)
+      && (!INDIRECT_TYPE_P (type)
 	  || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type))))
     {
       error ("invalid use of %<restrict%>");
diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc
index cc3a8899d97..7873a8633af 100644
--- a/gcc/c/gimple-parser.cc
+++ b/gcc/c/gimple-parser.cc
@@ -952,7 +952,7 @@ c_parser_gimple_binary_expression (gimple_parser &parser)
       code = TRUNC_MOD_EXPR;
       break;
     case CPP_PLUS:
-      if (POINTER_TYPE_P (TREE_TYPE (lhs.value)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (lhs.value)))
 	code = POINTER_PLUS_EXPR;
       else
 	code = PLUS_EXPR;
@@ -1115,7 +1115,7 @@ c_parser_gimple_unary_expression (gimple_parser &parser)
 	op = c_parser_gimple_postfix_expression (parser);
 	if (op.value == error_mark_node)
 	  return ret;
-	if (! POINTER_TYPE_P (TREE_TYPE (op.value)))
+	if (! INDIRECT_TYPE_P (TREE_TYPE (op.value)))
 	  {
 	    error_at (op_loc, "expected pointer as argument of unary %<*%>");
 	    return ret;
@@ -1468,7 +1468,7 @@ c_parser_gimple_postfix_expression (gimple_parser &parser)
 		    }
 		  ptr = c_parser_gimple_unary_expression (parser);
 		  if (ptr.value == error_mark_node
-		      || ! POINTER_TYPE_P (TREE_TYPE (ptr.value)))
+		      || ! INDIRECT_TYPE_P (TREE_TYPE (ptr.value)))
 		    {
 		      if (ptr.value != error_mark_node)
 			error_at (ptr.get_start (),
@@ -1832,7 +1832,7 @@ c_parser_gimple_postfix_expression_after_primary (gimple_parser &parser,
 	case CPP_DEREF:
 	  {
 	    /* Structure element reference.  */
-	    if (!POINTER_TYPE_P (TREE_TYPE (expr.value)))
+	    if (!INDIRECT_TYPE_P (TREE_TYPE (expr.value)))
 	      {
 		c_parser_error (parser, "dereference of non-pointer");
 		expr.set_error ();
diff --git a/gcc/calls.cc b/gcc/calls.cc
index 1f3a6d5c450..e38a4d08816 100644
--- a/gcc/calls.cc
+++ b/gcc/calls.cc
@@ -2873,7 +2873,7 @@ expand_call (tree exp, rtx target, int ignore)
 
   /* Operand 0 is a pointer-to-function; get the type of the function.  */
   funtype = TREE_TYPE (addr);
-  gcc_assert (POINTER_TYPE_P (funtype));
+  gcc_assert (INDIRECT_TYPE_P (funtype));
   funtype = TREE_TYPE (funtype);
 
   /* Count whether there are actual complex arguments that need to be split
diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index edf292cfbe9..d3cfa5fe92d 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -851,7 +851,7 @@ update_alias_info_with_stack_vars (void)
 	{
 	  struct ptr_info_def *pi;
 
-	  if (POINTER_TYPE_P (TREE_TYPE (name))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (name))
 	      && ((pi = SSA_NAME_PTR_INFO (name)) != NULL))
 	    add_partitioned_vars_to_ptset (&pi->pt, decls_to_partitions,
 					   &visited, temp);
@@ -1585,7 +1585,7 @@ adjust_one_expanded_partition_var (tree var)
   if (decl && !DECL_ARTIFICIAL (decl))
     mark_user_reg (x);
 
-  if (POINTER_TYPE_P (decl ? TREE_TYPE (decl) : TREE_TYPE (var)))
+  if (INDIRECT_TYPE_P (decl ? TREE_TYPE (decl) : TREE_TYPE (var)))
     mark_reg_pointer (x, get_pointer_alignment (var));
 }
 
@@ -1619,7 +1619,7 @@ expand_one_register_var (tree var)
   if (!DECL_ARTIFICIAL (decl))
     mark_user_reg (x);
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     mark_reg_pointer (x, get_pointer_alignment (var));
 }
 
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index e41e5ad3ae7..2f1d5880891 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -3501,7 +3501,7 @@ cgraph_node::verify_node (void)
 	}
     }
   if (DECL_IS_MALLOC (decl)
-      && !POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
+      && !INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
     {
       error ("malloc attribute should be used for a function that "
 	     "returns a pointer");
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index bccd2f2abb5..f26de2cf38c 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -1456,7 +1456,7 @@ maybe_diag_incompatible_alias (tree alias, tree target)
 
       targtype = TREE_TYPE (targtype);
 
-      if (POINTER_TYPE_P (targtype))
+      if (INDIRECT_TYPE_P (targtype))
 	{
 	  targtype = TREE_TYPE (targtype);
 
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc
index 04f59fd9a54..fb2c6a58b21 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -2100,7 +2100,7 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval,
 	  switch (thisarg)
 	    {
 	    case SIMD_ARG_COPY_TO_REG:
-	      if (POINTER_TYPE_P (TREE_TYPE (arg)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (arg)))
 		op[opc] = convert_memory_address (Pmode, op[opc]);
 	      /*gcc_assert (GET_MODE (op[opc]) == mode); */
 	      if (!(*insn_data[icode].operand[opc].predicate)
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc
index 161a14edde7..9362e0a6760 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -1198,7 +1198,7 @@ function_resolver::scalar_argument_p (unsigned int i)
   return (INTEGRAL_TYPE_P (type)
 	  /* Allow pointer types, leaving the frontend to warn where
 	     necessary.  */
-	  || POINTER_TYPE_P (type)
+	  || INDIRECT_TYPE_P (type)
 	  || SCALAR_FLOAT_TYPE_P (type));
 }
 
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 560e5431636..5b4f346b1d7 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -7501,7 +7501,7 @@ aarch64_function_arg_alignment (machine_mode mode, const_tree type,
 	 TYPE_MAIN_VARIANT, but not always; see PR108910 for a counterexample.
 	 For now we just handle the known exceptions explicitly.  */
       type = TYPE_MAIN_VARIANT (type);
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	{
 	  gcc_assert (known_eq (POINTER_SIZE, GET_MODE_BITSIZE (mode)));
 	  return POINTER_SIZE;
@@ -8071,7 +8071,7 @@ aarch64_function_arg_padding (machine_mode mode, const_tree type)
      byte address of the stack slot.  */
   if (type
       ? (INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type)
-	 || POINTER_TYPE_P (type))
+	 || INDIRECT_TYPE_P (type))
       : (SCALAR_INT_MODE_P (mode) || SCALAR_FLOAT_MODE_P (mode)))
     return PAD_DOWNWARD;
 
@@ -27186,7 +27186,7 @@ aarch64_estimated_poly_value (poly_int64 val,
 static bool
 supported_simd_type (tree t)
 {
-  if (SCALAR_FLOAT_TYPE_P (t) || INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t))
+  if (SCALAR_FLOAT_TYPE_P (t) || INTEGRAL_TYPE_P (t) || INDIRECT_TYPE_P (t))
     {
       HOST_WIDE_INT s = tree_to_shwi (TYPE_SIZE_UNIT (t));
       return s == 1 || s == 2 || s == 4 || s == 8;
diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc
index fef8a504f77..dbaf5ed0d97 100644
--- a/gcc/config/arc/arc.cc
+++ b/gcc/config/arc/arc.cc
@@ -7003,7 +7003,7 @@ arc_expand_builtin_aligned (tree exp)
 	    return const1_rtx;
 	  /* Another attempt to ascertain alignment.  Check the type
 	     we are pointing to.  */
-	  if (POINTER_TYPE_P (TREE_TYPE (arg0))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (arg0))
 	      && TYPE_ALIGN (TREE_TYPE (TREE_TYPE (arg0))) >= numBits)
 	    return const1_rtx;
 	}
diff --git a/gcc/config/arm/arm-builtins.cc b/gcc/config/arm/arm-builtins.cc
index fca7dcaf565..4db0ada264a 100644
--- a/gcc/config/arm/arm-builtins.cc
+++ b/gcc/config/arm/arm-builtins.cc
@@ -2919,7 +2919,7 @@ neon_dereference_pointer (tree exp, tree type, machine_mode mem_mode,
   nvectors = reg_size / vector_size;
 
   /* Work out the type of each element.  */
-  gcc_assert (POINTER_TYPE_P (type));
+  gcc_assert (INDIRECT_TYPE_P (type));
   elem_type = TREE_TYPE (type);
 
   /* Work out how many elements are being loaded or stored.
@@ -2966,7 +2966,7 @@ mve_dereference_pointer (tree exp, tree type, machine_mode reg_mode,
   reg_size = GET_MODE_SIZE (reg_mode);
 
   /* Work out the type of each element.  */
-  gcc_assert (POINTER_TYPE_P (type));
+  gcc_assert (INDIRECT_TYPE_P (type));
   elem_type = TREE_TYPE (type);
 
   nelems = reg_size / vector_size;
@@ -3042,7 +3042,7 @@ arm_general_expand_builtin_args (rtx target, machine_mode map_mode, int fcode,
 	    {
 	    case ARG_BUILTIN_MEMORY:
 	    case ARG_BUILTIN_COPY_TO_REG:
-	      if (POINTER_TYPE_P (TREE_TYPE (arg[argc])))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (arg[argc])))
 		op[argc] = convert_memory_address (Pmode, op[argc]);
 
 	      /* MVE uses mve_pred16_t (aka HImode) for vectors of
diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc
index 7eec9d2861c..4fbf2e2fb05 100644
--- a/gcc/config/arm/arm-mve-builtins.cc
+++ b/gcc/config/arm/arm-mve-builtins.cc
@@ -1069,7 +1069,7 @@ function_resolver::scalar_argument_p (unsigned int i)
   return (INTEGRAL_TYPE_P (type)
 	  /* Allow pointer types, leaving the frontend to warn where
 	     necessary.  */
-	  || POINTER_TYPE_P (type)
+	  || INDIRECT_TYPE_P (type)
 	  || SCALAR_FLOAT_TYPE_P (type));
 }
 
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 0447641a8e9..a5e8f8be7ef 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -10582,7 +10582,7 @@ avr_nonconst_pointer_addrspace (tree typ)
   while (ARRAY_TYPE == TREE_CODE (typ))
     typ = TREE_TYPE (typ);
 
-  if (POINTER_TYPE_P (typ))
+  if (INDIRECT_TYPE_P (typ))
     {
       addr_space_t as;
       tree target = TREE_TYPE (typ);
@@ -13640,8 +13640,8 @@ avr_convert_to_type (tree type, tree expr)
 
   if (avr_warn_addr_space_convert
       && expr != error_mark_node
-      && POINTER_TYPE_P (type)
-      && POINTER_TYPE_P (TREE_TYPE (expr)))
+      && INDIRECT_TYPE_P (type)
+      && INDIRECT_TYPE_P (TREE_TYPE (expr)))
     {
       addr_space_t as_old = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (expr)));
       addr_space_t as_new = TYPE_ADDR_SPACE (TREE_TYPE (type));
diff --git a/gcc/config/epiphany/epiphany.cc b/gcc/config/epiphany/epiphany.cc
index 60a2845d6d1..64af2c66468 100644
--- a/gcc/config/epiphany/epiphany.cc
+++ b/gcc/config/epiphany/epiphany.cc
@@ -2157,7 +2157,7 @@ epiphany_function_ok_for_sibcall (tree decl, tree exp)
     {
       tree fn_type = TREE_TYPE (CALL_EXPR_FN (exp));
 
-      gcc_assert (POINTER_TYPE_P (fn_type));
+      gcc_assert (INDIRECT_TYPE_P (fn_type));
       fn_type = TREE_TYPE (fn_type);
       gcc_assert (FUNC_OR_METHOD_TYPE_P (fn_type));
       call_interrupt_p
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 02f4dedec42..b7688021683 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -1882,8 +1882,8 @@ gcn_addr_space_subset_p (addr_space_t subset, addr_space_t superset)
 static rtx
 gcn_addr_space_convert (rtx op, tree from_type, tree to_type)
 {
-  gcc_assert (POINTER_TYPE_P (from_type));
-  gcc_assert (POINTER_TYPE_P (to_type));
+  gcc_assert (INDIRECT_TYPE_P (from_type));
+  gcc_assert (INDIRECT_TYPE_P (to_type));
 
   addr_space_t as_from = TYPE_ADDR_SPACE (TREE_TYPE (from_type));
   addr_space_t as_to = TYPE_ADDR_SPACE (TREE_TYPE (to_type));
@@ -2860,7 +2860,7 @@ gcn_detect_incoming_pointer_arg (tree fndecl)
   for (tree arg = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
        arg;
        arg = TREE_CHAIN (arg))
-    if (POINTER_TYPE_P (TREE_VALUE (arg)))
+    if (INDIRECT_TYPE_P (TREE_VALUE (arg)))
       cfun->machine->use_flat_addressing = true;
 }
 
diff --git a/gcc/config/i386/i386-builtins.cc b/gcc/config/i386/i386-builtins.cc
index e436ca4e5b1..21af34db9f8 100644
--- a/gcc/config/i386/i386-builtins.cc
+++ b/gcc/config/i386/i386-builtins.cc
@@ -1662,7 +1662,7 @@ ix86_vectorize_builtin_gather (const_tree mem_vectype,
     return NULL_TREE;
 
   if ((TREE_CODE (index_type) != INTEGER_TYPE
-       && !POINTER_TYPE_P (index_type))
+       && !INDIRECT_TYPE_P (index_type))
       || (TYPE_MODE (index_type) != SImode
 	  && TYPE_MODE (index_type) != DImode))
     return NULL_TREE;
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index edbb927293c..1fedcf079bf 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -3791,7 +3791,7 @@ ix86_handle_interrupt_attribute (tree *node, tree, tree, int, bool *)
     {
       if (nargs == 0)
 	{
-	  if (! POINTER_TYPE_P (TREE_VALUE (current_arg_type)))
+	  if (! INDIRECT_TYPE_P (TREE_VALUE (current_arg_type)))
 	    error ("interrupt service routine should have a pointer "
 		   "as the first argument");
 	}
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index f0d6167e667..ca3d35b8e2d 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -3393,7 +3393,7 @@ ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
   if (!cum->caller && cfun->machine->func_type != TYPE_NORMAL)
     {
       gcc_assert (arg.type != NULL_TREE);
-      if (POINTER_TYPE_P (arg.type))
+      if (INDIRECT_TYPE_P (arg.type))
 	{
 	  /* This is the pointer argument.  */
 	  gcc_assert (TYPE_MODE (arg.type) == ptr_mode);
@@ -4104,7 +4104,7 @@ function_value_64 (machine_mode orig_mode, machine_mode mode,
 
       return gen_rtx_REG (mode, regno);
     }
-  else if (POINTER_TYPE_P (valtype))
+  else if (INDIRECT_TYPE_P (valtype))
     {
       /* Pointers are always returned in word_mode.  */
       mode = word_mode;
@@ -4220,7 +4220,7 @@ ix86_promote_function_mode (const_tree type, machine_mode mode,
 {
   if (cfun->machine->func_type == TYPE_NORMAL
       && type != NULL_TREE
-      && POINTER_TYPE_P (type))
+      && INDIRECT_TYPE_P (type))
     {
       *punsignedp = POINTERS_EXTEND_UNSIGNED;
       return word_mode;
@@ -19176,7 +19176,7 @@ ix86_vectorize_builtin_scatter (const_tree vectype,
     return NULL_TREE;
 
   if ((TREE_CODE (index_type) != INTEGER_TYPE
-       && !POINTER_TYPE_P (index_type))
+       && !INDIRECT_TYPE_P (index_type))
       || (TYPE_MODE (index_type) != SImode
 	  && TYPE_MODE (index_type) != DImode))
     return NULL_TREE;
@@ -23422,7 +23422,7 @@ ix86_canonical_va_list_type (tree type)
 
       if ((TREE_CODE (type) == ARRAY_TYPE
 	   && integer_zerop (array_type_nelts (type)))
-	  || POINTER_TYPE_P (type))
+	  || INDIRECT_TYPE_P (type))
 	{
 	  tree elem_type = TREE_TYPE (type);
 	  if (TREE_CODE (elem_type) == RECORD_TYPE
diff --git a/gcc/config/m32c/m32c.cc b/gcc/config/m32c/m32c.cc
index 65971d62990..f56742582f0 100644
--- a/gcc/config/m32c/m32c.cc
+++ b/gcc/config/m32c/m32c.cc
@@ -1346,7 +1346,7 @@ m32c_function_arg (cumulative_args_t ca_v, const function_arg_info &arg)
       return NULL_RTX;
     }
 
-  if (arg.type && INTEGRAL_TYPE_P (arg.type) && POINTER_TYPE_P (arg.type))
+  if (arg.type && INTEGRAL_TYPE_P (arg.type) && INDIRECT_TYPE_P (arg.type))
     return NULL_RTX;
 
   if (arg.aggregate_type_p ())
diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc
index 03db2b6a936..f79fbcecb6f 100644
--- a/gcc/config/m68k/m68k.cc
+++ b/gcc/config/m68k/m68k.cc
@@ -5867,7 +5867,7 @@ m68k_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
   }
 
   /* If the function returns a pointer, push that into %a0.  */
-  if (func && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (func))))
+  if (func && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (func))))
     /* For compatibility with the large body of existing code which
        does not always properly declare external functions returning
        pointer types, the m68k/SVR4 convention is to copy the value
@@ -5884,7 +5884,7 @@ m68k_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
 		  gen_rtx_EXPR_LIST (VOIDmode,
 				     gen_rtx_REG (mode, D0_REG),
 				     const0_rtx)));
-  else if (POINTER_TYPE_P (valtype))
+  else if (INDIRECT_TYPE_P (valtype))
     return gen_rtx_REG (mode, A0_REG);
   else
     return gen_rtx_REG (mode, D0_REG);
diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index f9861020902..364e602fded 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -6352,7 +6352,7 @@ mips_function_arg_padding (machine_mode mode, const_tree type)
      stack argument is passed in the last byte of the stack slot.  */
   if (type != 0
       ? (INTEGRAL_TYPE_P (type)
-	 || POINTER_TYPE_P (type)
+	 || INDIRECT_TYPE_P (type)
 	 || FIXED_POINT_TYPE_P (type))
       : (SCALAR_INT_MODE_P (mode)
 	 || ALL_SCALAR_FIXED_POINT_MODE_P (mode)))
diff --git a/gcc/config/mn10300/mn10300.cc b/gcc/config/mn10300/mn10300.cc
index a8b01a543cc..2b50dae9842 100644
--- a/gcc/config/mn10300/mn10300.cc
+++ b/gcc/config/mn10300/mn10300.cc
@@ -1634,7 +1634,7 @@ mn10300_function_value (const_tree valtype,
   rtx rv;
   machine_mode mode = TYPE_MODE (valtype);
 
-  if (! POINTER_TYPE_P (valtype))
+  if (! INDIRECT_TYPE_P (valtype))
     return gen_rtx_REG (mode, FIRST_DATA_REGNUM);
   else if (! TARGET_PTR_A0D0 || ! outgoing
 	   || cfun->returns_struct)
diff --git a/gcc/config/msp430/msp430.cc b/gcc/config/msp430/msp430.cc
index 6f9c56187ee..933b21c4898 100644
--- a/gcc/config/msp430/msp430.cc
+++ b/gcc/config/msp430/msp430.cc
@@ -850,7 +850,7 @@ msp430_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
     {
       /* FIXME: This is where this function diverts from targhooks.cc:
 	 std_gimplify_va_arg_expr().  It works, but I do not know why...  */
-      if (! POINTER_TYPE_P (type))
+      if (! INDIRECT_TYPE_P (type))
 	{
 	  t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
 		      fold_build_pointer_plus_hwi (valist_tmp, boundary - 1));
diff --git a/gcc/config/nios2/nios2.cc b/gcc/config/nios2/nios2.cc
index 936eb34ace4..9ebab983986 100644
--- a/gcc/config/nios2/nios2.cc
+++ b/gcc/config/nios2/nios2.cc
@@ -3443,7 +3443,7 @@ nios2_function_arg_padding (machine_mode mode, const_tree type)
   /* Otherwise, integral types are padded downward: the last byte of a
      stack argument is passed in the last byte of the stack slot.  */
   if (type != 0
-      ? INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)
+      ? INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type)
       : GET_MODE_CLASS (mode) == MODE_INT)
     return PAD_DOWNWARD;
 
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 0fa9e5fd632..edd31894cdf 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -2099,7 +2099,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg)
 		  type = TREE_TYPE (decl);
 		  type = strip_array_types (type);
 
-		  if (POINTER_TYPE_P (type))
+		  if (INDIRECT_TYPE_P (type))
 		    mark_reg_pointer (operand0, BITS_PER_UNIT);
 		}
 	    }
@@ -9704,7 +9704,7 @@ pa_function_value (const_tree valtype,
 
   if ((INTEGRAL_TYPE_P (valtype)
        && GET_MODE_BITSIZE (TYPE_MODE (valtype)) < BITS_PER_WORD)
-      || POINTER_TYPE_P (valtype))
+      || INDIRECT_TYPE_P (valtype))
     valmode = word_mode;
   else
     valmode = TYPE_MODE (valtype);
diff --git a/gcc/config/pru/pru-passes.cc b/gcc/config/pru/pru-passes.cc
index ddbf98fd995..9e89c183c41 100644
--- a/gcc/config/pru/pru-passes.cc
+++ b/gcc/config/pru/pru-passes.cc
@@ -83,7 +83,7 @@ chkp_type_has_function_pointer (const_tree type)
 {
   bool res = false;
 
-  if (POINTER_TYPE_P (type) && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (type)))
+  if (INDIRECT_TYPE_P (type) && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (type)))
     res = true;
   else if (RECORD_OR_UNION_TYPE_P (type))
     {
diff --git a/gcc/config/pru/pru.cc b/gcc/config/pru/pru.cc
index e855bbb8195..3092bb25805 100644
--- a/gcc/config/pru/pru.cc
+++ b/gcc/config/pru/pru.cc
@@ -2080,7 +2080,7 @@ pru_nongeneric_pointer_addrspace (tree typ)
   while (ARRAY_TYPE == TREE_CODE (typ))
     typ = TREE_TYPE (typ);
 
-  if (POINTER_TYPE_P (typ))
+  if (INDIRECT_TYPE_P (typ))
     {
       addr_space_t as;
       tree target = TREE_TYPE (typ);
diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index a8f291c6a72..42592b65345 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -435,7 +435,7 @@ const char *rs6000_type_string (tree type_node)
     return "__ieee128";
   else if (type_node == opaque_V4SI_type_node)
     return "opaque";
-  else if (POINTER_TYPE_P (type_node))
+  else if (INDIRECT_TYPE_P (type_node))
     return "void*";
   else if (type_node == intQI_type_node || type_node == char_type_node)
     return "sc";
@@ -2462,7 +2462,7 @@ rs6000_expand_ldst_mask (rtx target, tree arg0)
 
   gcc_assert (TARGET_ALTIVEC);
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg0)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (arg0)));
   rtx op = expand_expr (arg0, NULL_RTX, Pmode, EXPAND_NORMAL);
   rtx addr = memory_address (mode, op);
   /* We need to negate the address.  */
diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index a353bca19ef..a625b6aa611 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -834,7 +834,7 @@ rs6000_builtin_type_compatible (tree parmtype, tree argtype)
       && is_float128_p (parmtype) && is_float128_p (argtype))
     return true;
 
-  if (POINTER_TYPE_P (parmtype) && POINTER_TYPE_P (argtype))
+  if (INDIRECT_TYPE_P (parmtype) && INDIRECT_TYPE_P (argtype))
     {
       parmtype = TREE_TYPE (parmtype);
       argtype = TREE_TYPE (argtype);
@@ -1803,7 +1803,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
 
       /* The C++ front-end converts float * to const void * using
 	 NOP_EXPR<const void *> (NOP_EXPR<void *> (x)).  */
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  && TREE_CODE (arg) == NOP_EXPR
 	  && lang_hooks.types_compatible_p (TREE_TYPE (arg),
 					    const_ptr_type_node)
@@ -1816,8 +1816,8 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
 
       /* Remove the const from the pointers to simplify the overload
 	 matching further down.  */
-      if (POINTER_TYPE_P (decl_type)
-	  && POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (decl_type)
+	  && INDIRECT_TYPE_P (type)
 	  && TYPE_QUALS (TREE_TYPE (type)) != 0)
 	{
 	  if (TYPE_READONLY (TREE_TYPE (type))
@@ -1833,7 +1833,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
       /* For RS6000_OVLD_VEC_LXVL, convert any const * to its non constant
 	 equivalent to simplify the overload matching below.  */
       if (fcode == RS6000_OVLD_VEC_LXVL
-	  && POINTER_TYPE_P (type)
+	  && INDIRECT_TYPE_P (type)
 	  && TYPE_READONLY (TREE_TYPE (type)))
 	{
 	  type = build_qualified_type (TREE_TYPE (type), 0);
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 44b448d2ba6..eeb1d43aa1b 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -20271,7 +20271,7 @@ rs6000_handle_altivec_attribute (tree *node,
        ? *IDENTIFIER_POINTER (TREE_VALUE (args))
        : '?');
 
-  while (POINTER_TYPE_P (type)
+  while (INDIRECT_TYPE_P (type)
 	 || TREE_CODE (type) == FUNCTION_TYPE
 	 || TREE_CODE (type) == METHOD_TYPE
 	 || TREE_CODE (type) == ARRAY_TYPE)
@@ -23761,7 +23761,7 @@ rs6000_function_value (const_tree valtype,
 
   if ((INTEGRAL_TYPE_P (valtype)
        && GET_MODE_BITSIZE (mode) < (TARGET_32BIT ? 32 : 64))
-      || POINTER_TYPE_P (valtype))
+      || INDIRECT_TYPE_P (valtype))
     mode = TARGET_32BIT ? SImode : DImode;
 
   if (DECIMAL_FLOAT_MODE_P (mode) && TARGET_HARD_FLOAT)
diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc
index 269f4f8e978..4b3d865d42e 100644
--- a/gcc/config/s390/s390-c.cc
+++ b/gcc/config/s390/s390-c.cc
@@ -813,7 +813,7 @@ s390_fn_types_compatible (enum s390_builtin_ov_type_index typeindex,
 
       /* If the incoming pointer argument has more qualifiers than the
 	 argument type it can still be an imperfect match.  */
-      if (POINTER_TYPE_P (b_arg_type) && POINTER_TYPE_P (in_type)
+      if (INDIRECT_TYPE_P (b_arg_type) && INDIRECT_TYPE_P (in_type)
 	  && !(TYPE_QUALS (TREE_TYPE (in_type))
 	       & ~TYPE_QUALS (TREE_TYPE (b_arg_type)))
 	  && (TYPE_QUALS (TREE_TYPE (b_arg_type))
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 13970edcb5e..4fc28e4df1e 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -604,7 +604,7 @@ s390_check_type_for_vector_abi (const_tree type, bool arg_p, bool in_struct_p)
 
       s390_vector_abi = TARGET_VX_ABI ? 2 : 1;
     }
-  else if (POINTER_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
+  else if (INDIRECT_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
     {
       /* ARRAY_TYPE: Since with neither of the ABIs we have more than
 	 natural alignment there will never be ABI dependent padding
@@ -1019,7 +1019,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 	 "memory_operand"..) in the insn patterns instead of (mem
 	 (match_operand "address_operand)).  This is helpful for
 	 patterns not just accepting MEMs.  */
-      if (POINTER_TYPE_P (TREE_TYPE (arg))
+      if (INDIRECT_TYPE_P (TREE_TYPE (arg))
 	  && insn_op->predicate != address_operand)
 	op[arity] = gen_rtx_MEM (insn_op->mode, op[arity]);
 
@@ -1211,7 +1211,7 @@ s390_handle_vectorbool_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
   tree type = *node, result = NULL_TREE;
   machine_mode mode;
 
-  while (POINTER_TYPE_P (type)
+  while (INDIRECT_TYPE_P (type)
 	 || TREE_CODE (type) == FUNCTION_TYPE
 	 || TREE_CODE (type) == METHOD_TYPE
 	 || TREE_CODE (type) == ARRAY_TYPE)
@@ -12764,7 +12764,7 @@ s390_function_arg_integer (machine_mode mode, const_tree type)
 
   /* We accept small integral (and similar) types.  */
   if (INTEGRAL_TYPE_P (type)
-      || POINTER_TYPE_P (type)
+      || INDIRECT_TYPE_P (type)
       || TREE_CODE (type) == NULLPTR_TYPE
       || TREE_CODE (type) == OFFSET_TYPE
       || (TARGET_SOFT_FLOAT && SCALAR_FLOAT_TYPE_P (type)))
@@ -12934,7 +12934,7 @@ s390_return_in_memory (const_tree type, const_tree fundecl ATTRIBUTE_UNUSED)
 {
   /* We accept small integral (and similar) types.  */
   if (INTEGRAL_TYPE_P (type)
-      || POINTER_TYPE_P (type)
+      || INDIRECT_TYPE_P (type)
       || TREE_CODE (type) == OFFSET_TYPE
       || SCALAR_FLOAT_TYPE_P (type))
     return int_size_in_bytes (type) > 8;
@@ -12969,7 +12969,7 @@ s390_promote_function_mode (const_tree type, machine_mode mode,
   if (INTEGRAL_MODE_P (mode)
       && GET_MODE_SIZE (mode) < UNITS_PER_LONG)
     {
-      if (type != NULL_TREE && POINTER_TYPE_P (type))
+      if (type != NULL_TREE && INDIRECT_TYPE_P (type))
 	*punsignedp = POINTERS_EXTEND_UNSIGNED;
       return Pmode;
     }
diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 0aade05faf5..d1fe35cab8e 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -6718,7 +6718,7 @@ static machine_mode
 sparc_promote_function_mode (const_tree type, machine_mode mode,
 			     int *punsignedp, const_tree, int)
 {
-  if (type && POINTER_TYPE_P (type))
+  if (type && INDIRECT_TYPE_P (type))
     {
       *punsignedp = POINTERS_EXTEND_UNSIGNED;
       return Pmode;
diff --git a/gcc/convert.cc b/gcc/convert.cc
index fe85bcb3323..a3216bcb461 100644
--- a/gcc/convert.cc
+++ b/gcc/convert.cc
@@ -840,8 +840,8 @@ convert_to_integer_1 (tree type, tree expr, bool dofold)
 	      if (ex_form == MINUS_EXPR
 		  && CONVERT_EXPR_P (arg0)
 		  && CONVERT_EXPR_P (arg1)
-		  && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg0, 0)))
-		  && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0))))
+		  && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg0, 0)))
+		  && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg1, 0))))
 		break;
 
 	      tree tem = do_narrow (loc, ex_form, type, arg0, arg1,
diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc
index 778759237dc..9f3992aa2ed 100644
--- a/gcc/cp/class.cc
+++ b/gcc/cp/class.cc
@@ -678,14 +678,14 @@ is_empty_base_ref (tree expr)
   if (TREE_CODE (expr) != NOP_EXPR)
     return false;
   tree type = TREE_TYPE (expr);
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return false;
   type = TREE_TYPE (type);
   if (!is_empty_class (type))
     return false;
   STRIP_NOPS (expr);
   tree fromtype = TREE_TYPE (expr);
-  if (!POINTER_TYPE_P (fromtype))
+  if (!INDIRECT_TYPE_P (fromtype))
     return false;
   fromtype = TREE_TYPE (fromtype);
   return (CLASS_TYPE_P (fromtype)
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 8c416d7bdfc..03f73c51393 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -3561,7 +3561,7 @@ static tree
 cxx_maybe_fold_addr_pointer_plus (tree t)
 {
   while (CONVERT_EXPR_P (t)
-	 && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0))))
+	 && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0))))
     t = TREE_OPERAND (t, 0);
   if (TREE_CODE (t) != POINTER_PLUS_EXPR)
     return NULL_TREE;
@@ -3570,7 +3570,7 @@ cxx_maybe_fold_addr_pointer_plus (tree t)
   if (TREE_CODE (op1) != INTEGER_CST)
     return NULL_TREE;
   while (CONVERT_EXPR_P (op0)
-	 && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (op0, 0))))
+	 && INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (op0, 0))))
     op0 = TREE_OPERAND (op0, 0);
   if (TREE_CODE (op0) != ADDR_EXPR)
     return NULL_TREE;
@@ -3640,7 +3640,7 @@ cxx_eval_binary_expression (const constexpr_ctx *ctx, tree t,
     }
   if (r == NULL_TREE
       && TREE_CODE_CLASS (code) == tcc_comparison
-      && POINTER_TYPE_P (TREE_TYPE (lhs)))
+      && INDIRECT_TYPE_P (TREE_TYPE (lhs)))
     {
       if (tree lhso = cxx_maybe_fold_addr_pointer_plus (lhs))
 	lhs = fold_convert (TREE_TYPE (lhs), lhso);
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index a6e04dc0f10..85b2434e0cf 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -4875,7 +4875,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
 	    {
 	      /* We pass a reference to *this to the param preview.  */
 	      tree tt = TREE_TYPE (arg);
-	      gcc_checking_assert (POINTER_TYPE_P (tt));
+	      gcc_checking_assert (INDIRECT_TYPE_P (tt));
 	      tree ct = TREE_TYPE (tt);
 	      tree this_ref = build1 (INDIRECT_REF, ct, arg);
 	      tree rt = cp_build_reference_type (ct, false);
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index f5734197774..0a0f508acda 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -1226,7 +1226,7 @@ predeclare_vla (tree expr)
 
   /* We need to strip pointers for gimplify_type_sizes.  */
   tree vla = type;
-  while (POINTER_TYPE_P (vla))
+  while (INDIRECT_TYPE_P (vla))
     {
       if (TYPE_NAME (vla))
 	return expr;
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index 8f4b2532934..ea2fc772688 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -6666,7 +6666,7 @@ cp_omp_finish_iterators (tree iter)
 	}
       if (type_dependent_expression_p (var))
 	continue;
-      if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+      if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
 	{
 	  error_at (loc, "iterator %qD has neither integral nor pointer type",
 		    var);
@@ -6706,10 +6706,10 @@ cp_omp_finish_iterators (tree iter)
       orig_step = step;
       if (!processing_template_decl)
 	step = orig_step = save_expr (step);
-      tree stype = POINTER_TYPE_P (type) ? sizetype : type;
+      tree stype = INDIRECT_TYPE_P (type) ? sizetype : type;
       step = cp_build_c_cast (input_location, stype, step,
 			      tf_warning_or_error);
-      if (POINTER_TYPE_P (type) && !processing_template_decl)
+      if (INDIRECT_TYPE_P (type) && !processing_template_decl)
 	{
 	  begin = save_expr (begin);
 	  step = pointer_int_sum (loc, PLUS_EXPR, begin, step);
@@ -9637,7 +9637,7 @@ finish_omp_target_clauses_r (tree *tp, int *walk_subtrees, void *ptr)
 	}
 
       if (TREE_CODE (t) == COMPONENT_REF
-	  && POINTER_TYPE_P (TREE_TYPE (t))
+	  && INDIRECT_TYPE_P (TREE_TYPE (t))
 	  && operand_equal_p (TREE_OPERAND (t, 0), current_object)
 	  && TREE_CODE (TREE_OPERAND (t, 1)) == FIELD_DECL)
 	{
diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc
index 859b133a18d..89a85978fa1 100644
--- a/gcc/cp/typeck.cc
+++ b/gcc/cp/typeck.cc
@@ -10569,12 +10569,12 @@ maybe_warn_about_returning_address_of_local (tree retval, location_t loc)
 			"returning local %<initializer_list%> variable %qD "
 			"does not extend the lifetime of the underlying array",
 			whats_returned);
-      else if (POINTER_TYPE_P (valtype)
+      else if (INDIRECT_TYPE_P (valtype)
 	       && TREE_CODE (whats_returned) == LABEL_DECL)
 	w = warning_at (loc, OPT_Wreturn_local_addr,
 			"address of label %qD returned",
 			whats_returned);
-      else if (POINTER_TYPE_P (valtype))
+      else if (INDIRECT_TYPE_P (valtype))
 	w = warning_at (loc, OPT_Wreturn_local_addr,
 			"address of local variable %qD returned",
 			whats_returned);
diff --git a/gcc/d/d-attribs.cc b/gcc/d/d-attribs.cc
index cc46220ddc2..5068b98a0d1 100644
--- a/gcc/d/d-attribs.cc
+++ b/gcc/d/d-attribs.cc
@@ -518,7 +518,7 @@ tree
 handle_malloc_attribute (tree *node, tree, tree, int, bool *)
 {
   gcc_assert (TREE_CODE (*node) == FUNCTION_DECL
-	      && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))));
+	      && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (*node))));
   DECL_IS_MALLOC (*node) = 1;
   return NULL_TREE;
 }
@@ -1320,7 +1320,7 @@ d_handle_alloc_size_attribute (tree *node, tree name, tree args, int,
 {
   tree fntype = *node;
   tree rettype = TREE_TYPE (fntype);
-  if (!POINTER_TYPE_P (rettype))
+  if (!INDIRECT_TYPE_P (rettype))
     {
       warning (OPT_Wattributes,
 	       "%qE attribute ignored on a function returning %qT",
@@ -1477,7 +1477,7 @@ static tree
 d_handle_restrict_attribute (tree *node, tree name, tree, int,
 			     bool *no_add_attrs)
 {
-  if (TREE_CODE (*node) == PARM_DECL && POINTER_TYPE_P (TREE_TYPE (*node)))
+  if (TREE_CODE (*node) == PARM_DECL && INDIRECT_TYPE_P (TREE_TYPE (*node)))
     {
       TREE_TYPE (*node) = build_qualified_type (TREE_TYPE (*node),
 						TYPE_QUAL_RESTRICT);
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index ab48b55ada7..590ad84b70a 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -502,7 +502,7 @@ build_vindex_ref (tree object, tree fntype, size_t index)
   tree result = build_deref (object);
   result = component_ref (result, TYPE_FIELDS (TREE_TYPE (result)));
 
-  gcc_assert (POINTER_TYPE_P (fntype));
+  gcc_assert (INDIRECT_TYPE_P (fntype));
 
   return build_memref (fntype, result, size_int (target.ptrsize * index));
 }
@@ -1464,9 +1464,9 @@ build_boolop (tree_code code, tree arg0, tree arg1)
   if (code == EQ_EXPR || code == NE_EXPR)
     {
       /* Check if comparing the address of a variable to null.  */
-      if (POINTER_TYPE_P (TREE_TYPE (arg0)) && integer_zerop (arg1))
+      if (INDIRECT_TYPE_P (TREE_TYPE (arg0)) && integer_zerop (arg1))
 	warn_for_null_address (arg0);
-      if (POINTER_TYPE_P (TREE_TYPE (arg1)) && integer_zerop (arg0))
+      if (INDIRECT_TYPE_P (TREE_TYPE (arg1)) && integer_zerop (arg0))
 	warn_for_null_address (arg1);
     }
 
@@ -1647,7 +1647,7 @@ build_deref (tree exp)
   /* Maybe rewrite: *(e1, e2) => (e1, *e2)  */
   tree init = stabilize_expr (&exp);
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (exp)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (exp)));
 
   if (TREE_CODE (exp) == ADDR_EXPR)
     exp = TREE_OPERAND (exp, 0);
@@ -2150,7 +2150,7 @@ d_build_call (TypeFunction *tf, tree callable, tree object,
   tree ctype = TREE_TYPE (callable);
   tree callee = callable;
 
-  if (POINTER_TYPE_P (ctype))
+  if (INDIRECT_TYPE_P (ctype))
     ctype = TREE_TYPE (ctype);
   else
     callee = build_address (callable);
diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc
index ec75eccbbaf..8f8fc63e226 100644
--- a/gcc/d/d-convert.cc
+++ b/gcc/d/d-convert.cc
@@ -53,12 +53,12 @@ d_build_truthvalue_op (tree_code code, tree op0, tree op1)
   STRIP_TYPE_NOPS (op1);
 
   /* Also need to convert pointer/int comparison.  */
-  if (POINTER_TYPE_P (type0) && TREE_CODE (op1) == INTEGER_CST
+  if (INDIRECT_TYPE_P (type0) && TREE_CODE (op1) == INTEGER_CST
       && integer_zerop (op1))
     {
       result_type = type0;
     }
-  else if (POINTER_TYPE_P (type1) && TREE_CODE (op0) == INTEGER_CST
+  else if (INDIRECT_TYPE_P (type1) && TREE_CODE (op0) == INTEGER_CST
 	   && integer_zerop (op0))
     {
       result_type = type1;
@@ -270,7 +270,7 @@ convert (tree type, tree expr)
 
     case INTEGER_TYPE:
     case ENUMERAL_TYPE:
-      if (POINTER_TYPE_P (etype))
+      if (INDIRECT_TYPE_P (etype))
 	{
 	  if (integer_zerop (e))
 	    return build_int_cst (type, 0);
@@ -767,7 +767,7 @@ convert_for_argument (tree expr, Parameter *arg)
   if (valist_array_p (arg->type))
     {
       /* Do nothing if the va_list has already been decayed to a pointer.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (expr)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (expr)))
 	return build_address (expr);
     }
   else if (parameter_reference_p (arg))
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 8fb1eea65a6..09ec4a260d9 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -106,13 +106,13 @@ binary_op (tree_code code, tree type, tree arg0, tree arg1)
   if (code == FLOAT_MOD_EXPR)
     return build_float_modulus (type, arg0, arg1);
 
-  if (POINTER_TYPE_P (t0) && INTEGRAL_TYPE_P (t1))
+  if (INDIRECT_TYPE_P (t0) && INTEGRAL_TYPE_P (t1))
     return build_nop (type, build_offset_op (code, arg0, arg1));
 
-  if (INTEGRAL_TYPE_P (t0) && POINTER_TYPE_P (t1))
+  if (INTEGRAL_TYPE_P (t0) && INDIRECT_TYPE_P (t1))
     return build_nop (type, build_offset_op (code, arg1, arg0));
 
-  if (POINTER_TYPE_P (t0) && POINTER_TYPE_P (t1))
+  if (INDIRECT_TYPE_P (t0) && INDIRECT_TYPE_P (t1))
     {
       gcc_assert (code == MINUS_EXPR);
       tree ptrtype = lang_hooks.types.type_for_mode (ptr_mode, 0);
@@ -1625,7 +1625,7 @@ public:
 		  thisexp = force_target_expr (thisexp);
 
 		/* Want reference to `this' object.  */
-		if (!POINTER_TYPE_P (TREE_TYPE (thisexp)))
+		if (!INDIRECT_TYPE_P (TREE_TYPE (thisexp)))
 		  thisexp = build_address (thisexp);
 
 		/* Make the callee a virtual call.  */
@@ -2051,7 +2051,7 @@ public:
     TREE_USED (result) = 1;
 
     if (declaration_reference_p (e->var))
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (result)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (result)));
     else
       result = build_address (result);
 
diff --git a/gcc/d/intrinsics.cc b/gcc/d/intrinsics.cc
index aaf04e50baa..8be226bfe90 100644
--- a/gcc/d/intrinsics.cc
+++ b/gcc/d/intrinsics.cc
@@ -310,7 +310,7 @@ maybe_warn_intrinsic_mismatch (tree function, tree callexp)
 
 	tree ptr = TREE_TYPE (CALL_EXPR_ARG (callexp, 0));
 	if (!VECTOR_TYPE_P (TREE_TYPE (callexp))
-	    || !POINTER_TYPE_P (ptr) || !VECTOR_TYPE_P (TREE_TYPE (ptr)))
+	    || !INDIRECT_TYPE_P (ptr) || !VECTOR_TYPE_P (TREE_TYPE (ptr)))
 	  return warn_mismatched_return_type (callexp, "__vector(T)");
 
 	return false;
@@ -325,7 +325,7 @@ maybe_warn_intrinsic_mismatch (tree function, tree callexp)
 	tree ptr = TREE_TYPE (CALL_EXPR_ARG (callexp, 0));
 	tree val = TREE_TYPE (CALL_EXPR_ARG (callexp, 1));
 	if (!VECTOR_TYPE_P (TREE_TYPE (callexp))
-	    || !POINTER_TYPE_P (ptr) || !VECTOR_TYPE_P (TREE_TYPE (ptr))
+	    || !INDIRECT_TYPE_P (ptr) || !VECTOR_TYPE_P (TREE_TYPE (ptr))
 	    || !VECTOR_TYPE_P (val))
 	  return warn_mismatched_return_type (callexp, "__vector(T)");
 
@@ -839,7 +839,7 @@ expand_intrinsic_vaarg (tree callexp)
 
       /* The `ref' argument to va_arg is either an address or reference,
 	 get the value of it.  */
-      if (TREE_CODE (parmn) == PARM_DECL && POINTER_TYPE_P (TREE_TYPE (parmn)))
+      if (TREE_CODE (parmn) == PARM_DECL && INDIRECT_TYPE_P (TREE_TYPE (parmn)))
 	parmn = build_deref (parmn);
       else
 	{
@@ -882,7 +882,7 @@ expand_intrinsic_vastart (tree callexp)
      warning.  Could be casting, so need to check type too?  */
   gcc_assert (TREE_CODE (ap) == ADDR_EXPR
 	      || (TREE_CODE (ap) == PARM_DECL
-		  && POINTER_TYPE_P (TREE_TYPE (ap))));
+		  && INDIRECT_TYPE_P (TREE_TYPE (ap))));
 
   /* Assuming nobody tries to change the return type.  */
   if (TREE_CODE (parmn) != PARM_DECL)
@@ -1001,7 +1001,7 @@ expand_volatile_load (tree callexp)
 {
   tree ptr = CALL_EXPR_ARG (callexp, 0);
   tree ptrtype = TREE_TYPE (ptr);
-  gcc_assert (POINTER_TYPE_P (ptrtype));
+  gcc_assert (INDIRECT_TYPE_P (ptrtype));
 
   /* (T) *(volatile T *) ptr;  */
   tree type = build_qualified_type (TREE_TYPE (ptrtype), TYPE_QUAL_VOLATILE);
@@ -1029,7 +1029,7 @@ expand_volatile_store (tree callexp)
 {
   tree ptr = CALL_EXPR_ARG (callexp, 0);
   tree ptrtype = TREE_TYPE (ptr);
-  gcc_assert (POINTER_TYPE_P (ptrtype));
+  gcc_assert (INDIRECT_TYPE_P (ptrtype));
 
   /* (T) *(volatile T *) ptr;  */
   tree type = build_qualified_type (TREE_TYPE (ptrtype), TYPE_QUAL_VOLATILE);
diff --git a/gcc/dojump.cc b/gcc/dojump.cc
index 564343e821e..a98f6555897 100644
--- a/gcc/dojump.cc
+++ b/gcc/dojump.cc
@@ -1294,9 +1294,9 @@ do_compare_and_jump (tree treeop0, tree treeop1, enum rtx_code signed_code,
      handles the case where the other operand is a void pointer.  See
      PR middle-end/17564.  */
   if (targetm.have_canonicalize_funcptr_for_compare ()
-      && ((POINTER_TYPE_P (TREE_TYPE (treeop0))
+      && ((INDIRECT_TYPE_P (TREE_TYPE (treeop0))
 	   && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (treeop0))))
-	  || (POINTER_TYPE_P (TREE_TYPE (treeop1))
+	  || (INDIRECT_TYPE_P (TREE_TYPE (treeop1))
 	      && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (treeop1))))))
     {
       rtx new_op0 = gen_reg_rtx (mode);
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 238d0a94400..28f99b821ff 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -18966,7 +18966,7 @@ loc_list_from_tree_1 (tree loc, int want_address,
 		&& want_address != 1
 		&& ! DECL_IGNORED_P (loc)
 		&& (INTEGRAL_TYPE_P (TREE_TYPE (loc))
-		    || POINTER_TYPE_P (TREE_TYPE (loc)))
+		    || INDIRECT_TYPE_P (TREE_TYPE (loc)))
 		&& (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (loc)))
 		    <= DWARF2_ADDR_SIZE))
 	      {
diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index f6276a2d0b6..09e63a2563c 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -1975,7 +1975,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
   attrs.alias = get_alias_set (t);
 
   MEM_VOLATILE_P (ref) |= TYPE_VOLATILE (type);
-  MEM_POINTER (ref) = POINTER_TYPE_P (type);
+  MEM_POINTER (ref) = INDIRECT_TYPE_P (type);
 
   /* Default values from pre-existing memory attributes if present.  */
   refattrs = MEM_ATTRS (ref);
diff --git a/gcc/expmed.cc b/gcc/expmed.cc
index fbd4ce2d42f..d8a8a0088bb 100644
--- a/gcc/expmed.cc
+++ b/gcc/expmed.cc
@@ -5451,7 +5451,7 @@ make_tree (tree type, rtx x)
 
       /* If TYPE is a POINTER_TYPE, we might need to convert X from
 	 address mode to pointer mode.  */
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	x = convert_memory_address_addr_space
 	  (SCALAR_INT_TYPE_MODE (type), x, TYPE_ADDR_SPACE (TREE_TYPE (type)));
 
diff --git a/gcc/expr.cc b/gcc/expr.cc
index fff09dc9951..1e61b3e6eff 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -5967,7 +5967,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
 	}
       else
 	{
-	  if (POINTER_TYPE_P (TREE_TYPE (to)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (to)))
 	    value = convert_memory_address_addr_space
 	      (as_a <scalar_int_mode> (GET_MODE (to_rtx)), value,
 	       TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (to))));
@@ -8810,7 +8810,7 @@ expand_expr_addr_expr (tree exp, rtx target, machine_mode tmode,
   if (tmode == VOIDmode)
     tmode = TYPE_MODE (TREE_TYPE (exp));
 
-  if (POINTER_TYPE_P (TREE_TYPE (exp)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (exp)))
     {
       as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
       address_mode = targetm.addr_space.address_mode (as);
@@ -9389,8 +9389,8 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
       {
 	tree treeop0_type = TREE_TYPE (treeop0);
 
-	gcc_assert (POINTER_TYPE_P (type));
-	gcc_assert (POINTER_TYPE_P (treeop0_type));
+	gcc_assert (INDIRECT_TYPE_P (type));
+	gcc_assert (INDIRECT_TYPE_P (treeop0_type));
 
 	addr_space_t as_to = TYPE_ADDR_SPACE (TREE_TYPE (type));
 	addr_space_t as_from = TYPE_ADDR_SPACE (TREE_TYPE (treeop0_type));
@@ -9535,9 +9535,9 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
 
       /* Use TER to expand pointer addition of a negated value
 	 as pointer subtraction.  */
-      if ((POINTER_TYPE_P (TREE_TYPE (treeop0))
+      if ((INDIRECT_TYPE_P (TREE_TYPE (treeop0))
 	   || (TREE_CODE (TREE_TYPE (treeop0)) == VECTOR_TYPE
-	       && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (treeop0)))))
+	       && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (treeop0)))))
 	  && TREE_CODE (treeop1) == SSA_NAME
 	  && TYPE_MODE (TREE_TYPE (treeop0))
 	     == TYPE_MODE (TREE_TYPE (treeop1)))
@@ -12311,7 +12311,7 @@ constant_byte_string (tree arg, tree *ptr_offset, tree *mem_size, tree *decl,
       if (str)
 	{
 	  /* Avoid pointers to arrays (see bug 86622).  */
-	  if (POINTER_TYPE_P (TREE_TYPE (arg))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (arg))
 	      && TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) == ARRAY_TYPE
 	      && !(decl && !*decl)
 	      && !(decl && tree_fits_uhwi_p (DECL_SIZE_UNIT (*decl))
@@ -12343,7 +12343,7 @@ constant_byte_string (tree arg, tree *ptr_offset, tree *mem_size, tree *decl,
       if (tree str = string_constant (rhs1, &offset, mem_size, decl))
 	{
 	  /* Avoid pointers to arrays (see bug 86622).  */
-	  if (POINTER_TYPE_P (TREE_TYPE (rhs1))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (rhs1))
 	      && TREE_CODE (TREE_TYPE (TREE_TYPE (rhs1))) == ARRAY_TYPE
 	      && !(decl && !*decl)
 	      && !(decl && tree_fits_uhwi_p (DECL_SIZE_UNIT (*decl))
@@ -12517,7 +12517,7 @@ constant_byte_string (tree arg, tree *ptr_offset, tree *mem_size, tree *decl,
       /* Determine the character type from that of the original
 	 expression.  */
       tree chartype = argtype;
-      if (POINTER_TYPE_P (chartype))
+      if (INDIRECT_TYPE_P (chartype))
 	chartype = TREE_TYPE (chartype);
       while (TREE_CODE (chartype) == ARRAY_TYPE)
 	chartype = TREE_TYPE (chartype);
@@ -13041,9 +13041,9 @@ do_store_flag (sepops ops, rtx target, machine_mode mode)
   /* We won't bother with store-flag operations involving function pointers
      when function pointers must be canonicalized before comparisons.  */
   if (targetm.have_canonicalize_funcptr_for_compare ()
-      && ((POINTER_TYPE_P (TREE_TYPE (arg0))
+      && ((INDIRECT_TYPE_P (TREE_TYPE (arg0))
 	   && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (arg0))))
-	  || (POINTER_TYPE_P (TREE_TYPE (arg1))
+	  || (INDIRECT_TYPE_P (TREE_TYPE (arg1))
 	      && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (arg1))))))
     return 0;
 
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index 15a4e120201..e3463bd9e2e 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -1052,9 +1052,9 @@ associate_trees (location_t loc, tree t1, tree t2, enum tree_code code, tree typ
 static bool
 int_binop_types_match_p (enum tree_code code, const_tree type1, const_tree type2)
 {
-  if (!INTEGRAL_TYPE_P (type1) && !POINTER_TYPE_P (type1))
+  if (!INTEGRAL_TYPE_P (type1) && !INDIRECT_TYPE_P (type1))
     return false;
-  if (!INTEGRAL_TYPE_P (type2) && !POINTER_TYPE_P (type2))
+  if (!INTEGRAL_TYPE_P (type2) && !INDIRECT_TYPE_P (type2))
     return false;
 
   switch (code)
@@ -2113,7 +2113,7 @@ fold_convert_const_int_from_int (tree type, const_tree arg1)
      appropriately sign-extended or truncated.  Use widest_int
      so that any extension is done according ARG1's type.  */
   return force_fit_type (type, wi::to_widest (arg1),
-			 !POINTER_TYPE_P (TREE_TYPE (arg1)),
+			 !INDIRECT_TYPE_P (TREE_TYPE (arg1)),
 			 TREE_OVERFLOW (arg1));
 }
 
@@ -2394,14 +2394,14 @@ fold_convert_const (enum tree_code code, tree type, tree arg1)
   /* We can't widen types, since the runtime value could overflow the
      original type before being extended to the new type.  */
   if (POLY_INT_CST_P (arg1)
-      && (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type))
+      && (INDIRECT_TYPE_P (type) || INTEGRAL_TYPE_P (type))
       && TYPE_PRECISION (type) <= TYPE_PRECISION (arg_type))
     return build_poly_int_cst (type,
 			       poly_wide_int::from (poly_int_cst_value (arg1),
 						    TYPE_PRECISION (type),
 						    TYPE_SIGN (arg_type)));
 
-  if (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type)
+  if (INDIRECT_TYPE_P (type) || INTEGRAL_TYPE_P (type)
       || TREE_CODE (type) == OFFSET_TYPE)
     {
       if (TREE_CODE (arg1) == INTEGER_CST)
@@ -2508,7 +2508,7 @@ fold_convertible_p (const_tree type, const_tree arg)
     case POINTER_TYPE: case REFERENCE_TYPE:
     case OFFSET_TYPE:
       return (INTEGRAL_TYPE_P (orig)
-	      || (POINTER_TYPE_P (orig)
+	      || (INDIRECT_TYPE_P (orig)
 		  && TYPE_PRECISION (type) <= TYPE_PRECISION (orig))
 	      || TREE_CODE (orig) == OFFSET_TYPE);
 
@@ -2550,7 +2550,7 @@ fold_convert_loc (location_t loc, tree type, tree arg)
     case POINTER_TYPE:
     case REFERENCE_TYPE:
       /* Handle conversions between pointers to different address spaces.  */
-      if (POINTER_TYPE_P (orig)
+      if (INDIRECT_TYPE_P (orig)
 	  && (TYPE_ADDR_SPACE (TREE_TYPE (type))
 	      != TYPE_ADDR_SPACE (TREE_TYPE (orig))))
 	return fold_build1_loc (loc, ADDR_SPACE_CONVERT_EXPR, type, arg);
@@ -2564,7 +2564,7 @@ fold_convert_loc (location_t loc, tree type, tree arg)
 	  if (tem != NULL_TREE)
 	    return tem;
 	}
-      if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)
+      if (INTEGRAL_TYPE_P (orig) || INDIRECT_TYPE_P (orig)
 	  || TREE_CODE (orig) == OFFSET_TYPE)
 	return fold_build1_loc (loc, NOP_EXPR, type, arg);
       if (TREE_CODE (orig) == COMPLEX_TYPE)
@@ -2683,7 +2683,7 @@ fold_convert_loc (location_t loc, tree type, tree arg)
       if (integer_zerop (arg))
 	return build_zero_vector (type);
       gcc_assert (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
-      gcc_assert (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)
+      gcc_assert (INTEGRAL_TYPE_P (orig) || INDIRECT_TYPE_P (orig)
 		  || VECTOR_TYPE_P (orig));
       return fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, arg);
 
@@ -3110,8 +3110,8 @@ operand_compare::operand_equal_p (const_tree arg0, const_tree arg1,
     return false;
 
   /* We cannot consider pointers to different address space equal.  */
-  if (POINTER_TYPE_P (TREE_TYPE (arg0))
-      && POINTER_TYPE_P (TREE_TYPE (arg1))
+  if (INDIRECT_TYPE_P (TREE_TYPE (arg0))
+      && INDIRECT_TYPE_P (TREE_TYPE (arg1))
       && (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg0)))
 	  != TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg1)))))
     return false;
@@ -3134,8 +3134,8 @@ operand_compare::operand_equal_p (const_tree arg0, const_tree arg1,
 	 strictly don't have a signedness, require either two pointers or
 	 two non-pointers as well.  */
       if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1))
-	  || POINTER_TYPE_P (TREE_TYPE (arg0))
-			     != POINTER_TYPE_P (TREE_TYPE (arg1)))
+	  || INDIRECT_TYPE_P (TREE_TYPE (arg0))
+			     != INDIRECT_TYPE_P (TREE_TYPE (arg1)))
 	return false;
 
       /* If both types don't have the same precision, then it is not safe
@@ -4592,7 +4592,7 @@ make_bit_field_ref (location_t loc, tree inner, tree orig_inner, tree type,
     {
       tree size = TYPE_SIZE (TREE_TYPE (inner));
       if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
-	   || POINTER_TYPE_P (TREE_TYPE (inner)))
+	   || INDIRECT_TYPE_P (TREE_TYPE (inner)))
 	  && tree_fits_shwi_p (size)
 	  && tree_to_shwi (size) == bitsize)
 	return fold_convert_loc (loc, type, inner);
@@ -5537,7 +5537,7 @@ range_check_type (tree etype)
       else
 	return NULL_TREE;
     }
-  else if (POINTER_TYPE_P (etype) || TREE_CODE (etype) == OFFSET_TYPE)
+  else if (INDIRECT_TYPE_P (etype) || TREE_CODE (etype) == OFFSET_TYPE)
     etype = unsigned_type_for (etype);
   return etype;
 }
@@ -5555,7 +5555,7 @@ build_range_check (location_t loc, tree type, tree exp, int in_p,
   /* Disable this optimization for function pointer expressions
      on targets that require function pointer canonicalization.  */
   if (targetm.have_canonicalize_funcptr_for_compare ()
-      && POINTER_TYPE_P (etype)
+      && INDIRECT_TYPE_P (etype)
       && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (etype)))
     return NULL_TREE;
 
@@ -7522,7 +7522,7 @@ fold_to_nonsharp_ineq_using_bound (location_t loc, tree ineq, tree bound)
 
   typea = TREE_TYPE (a);
   if (!INTEGRAL_TYPE_P (typea)
-      && !POINTER_TYPE_P (typea))
+      && !INDIRECT_TYPE_P (typea))
     return NULL_TREE;
 
   if (TREE_CODE (ineq) == LT_EXPR)
@@ -7541,7 +7541,7 @@ fold_to_nonsharp_ineq_using_bound (location_t loc, tree ineq, tree bound)
   if (TREE_TYPE (a1) != typea)
     return NULL_TREE;
 
-  if (POINTER_TYPE_P (typea))
+  if (INDIRECT_TYPE_P (typea))
     {
       /* Convert the pointer types into integer before taking the difference.  */
       tree ta = fold_convert_loc (loc, ssizetype, a);
@@ -9396,7 +9396,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
 	 living at offset zero.  This occurs frequently in
 	 C++ upcasting and then accessing the base.  */
       if (TREE_CODE (op0) == ADDR_EXPR
-	  && POINTER_TYPE_P (type)
+	  && INDIRECT_TYPE_P (type)
 	  && handled_component_p (TREE_OPERAND (op0, 0)))
         {
 	  poly_int64 bitsize, bitpos;
@@ -9487,7 +9487,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
       /* Convert (T1)(X p+ Y) into ((T1)X p+ Y), for pointer type, when the new
 	 cast (T1)X will fold away.  We assume that this happens when X itself
 	 is a cast.  */
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  && TREE_CODE (arg0) == POINTER_PLUS_EXPR
 	  && CONVERT_EXPR_P (TREE_OPERAND (arg0, 0)))
 	{
@@ -9834,7 +9834,7 @@ maybe_canonicalize_comparison_1 (location_t loc, enum tree_code code, tree type,
 	 && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0)))
 	/* In principle pointers also have undefined overflow behavior,
 	   but that causes problems elsewhere.  */
-	&& !POINTER_TYPE_P (TREE_TYPE (arg0))
+	&& !INDIRECT_TYPE_P (TREE_TYPE (arg0))
 	&& (code0 == MINUS_EXPR
 	    || code0 == PLUS_EXPR)
 	&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST))
@@ -9934,7 +9934,7 @@ maybe_canonicalize_comparison (location_t loc, enum tree_code code, tree type,
 static bool
 pointer_may_wrap_p (tree base, tree offset, poly_int64 bitpos)
 {
-  if (!POINTER_TYPE_P (TREE_TYPE (base)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (base)))
     return true;
 
   if (maybe_lt (bitpos, 0))
@@ -10032,7 +10032,7 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
      comparison of the base objects and the offsets into the object.
      This requires at least one operand being an ADDR_EXPR or a
      POINTER_PLUS_EXPR to do more than the operand_equal_p test below.  */
-  if (POINTER_TYPE_P (TREE_TYPE (arg0))
+  if (INDIRECT_TYPE_P (TREE_TYPE (arg0))
       && (TREE_CODE (arg0) == ADDR_EXPR
 	  || TREE_CODE (arg1) == ADDR_EXPR
 	  || TREE_CODE (arg0) == POINTER_PLUS_EXPR
@@ -10685,7 +10685,7 @@ tree_expr_nonzero_warnv_p (tree t, bool *strict_overflow_p)
   enum tree_code code;
 
   /* Doing something useful for floating point would need more work.  */
-  if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+  if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
     return false;
 
   code = TREE_CODE (t);
@@ -11307,7 +11307,7 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type,
 
 	  /* With undefined overflow prefer doing association in a type
 	     which wraps on overflow, if that is one of the operand types.  */
-	  if ((POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type))
+	  if ((INDIRECT_TYPE_P (type) || INTEGRAL_TYPE_P (type))
 	      && !TYPE_OVERFLOW_WRAPS (type))
 	    {
 	      if (INTEGRAL_TYPE_P (TREE_TYPE (arg0))
@@ -11321,7 +11321,7 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type,
 
 	  /* With undefined overflow we can only associate constants with one
 	     variable, and constants whose association doesn't overflow.  */
-	  if ((POINTER_TYPE_P (atype) || INTEGRAL_TYPE_P (atype))
+	  if ((INDIRECT_TYPE_P (atype) || INTEGRAL_TYPE_P (atype))
 	      && !TYPE_OVERFLOW_WRAPS (atype))
 	    {
 	      if ((var0 && var1) || (minus_var0 && minus_var1))
@@ -15970,7 +15970,7 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
 
   STRIP_NOPS (sub);
   subtype = TREE_TYPE (sub);
-  if (!POINTER_TYPE_P (subtype)
+  if (!INDIRECT_TYPE_P (subtype)
       || TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (op0)))
     return NULL_TREE;
 
@@ -16659,7 +16659,7 @@ address_compare (tree_code code, tree type, tree op0, tree op1,
 	  || known_eq (off0, off1)
 	  || TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (op0))
 	  /* Or if we compare using pointers to decls or strings.  */
-	  || (POINTER_TYPE_P (type)
+	  || (INDIRECT_TYPE_P (type)
 	      && (DECL_P (base0) || TREE_CODE (base0) == STRING_CST)))
 	return 1;
       return 2;
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 94d8e57750a..44a65fa1e59 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -946,11 +946,11 @@ gfc_get_array_span (tree desc, gfc_expr *expr)
 
   if (is_pointer_array (desc)
       || (get_CFI_desc (NULL, expr, &desc, NULL)
-	  && (POINTER_TYPE_P (TREE_TYPE (desc))
+	  && (INDIRECT_TYPE_P (TREE_TYPE (desc))
 	      ? GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (desc)))
 	      : GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc)))))
     {
-      if (POINTER_TYPE_P (TREE_TYPE (desc)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (desc)))
 	desc = build_fold_indirect_ref_loc (input_location, desc);
 
       /* This will have the span field set.  */
@@ -960,7 +960,7 @@ gfc_get_array_span (tree desc, gfc_expr *expr)
     {
       if (DECL_LANG_SPECIFIC (desc) && GFC_DECL_SAVED_DESCRIPTOR (desc))
 	desc = GFC_DECL_SAVED_DESCRIPTOR (desc);
-      if (POINTER_TYPE_P (TREE_TYPE (desc)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (desc)))
 	desc = build_fold_indirect_ref_loc (input_location, desc);
       tmp = gfc_conv_descriptor_span_get (desc);
     }
@@ -1441,7 +1441,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss,
      dynamic type.  Generate an eltype and then the class expression.  */
   if (eltype == NULL_TREE && initial)
     {
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (initial)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (initial)));
       class_expr = build_fold_indirect_ref_loc (input_location, initial);
       /* Obtain the structure (class) expression.  */
       class_expr = gfc_get_class_from_expr (class_expr);
@@ -1880,7 +1880,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
 					  gfc_character_kinds[i].bit_size / 8));
 
       gfc_conv_string_parameter (se);
-      if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	{
 	  /* The temporary is an array of pointers.  */
 	  se->expr = fold_convert (TREE_TYPE (tmp), se->expr);
@@ -2151,7 +2151,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock,
 		    se.expr = fold_convert (type, se.expr);
 		  /* For constant character array constructors we build
 		     an array of pointers.  */
-		  else if (POINTER_TYPE_P (type))
+		  else if (INDIRECT_TYPE_P (type))
 		    se.expr = gfc_build_addr_expr
 				(gfc_get_pchar_type (p->expr->ts.kind),
 				 se.expr);
@@ -2577,7 +2577,7 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type)
       gfc_conv_constant (&se, c->expr);
       if (c->expr->ts.type != BT_CHARACTER)
 	se.expr = fold_convert (type, se.expr);
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	se.expr = gfc_build_addr_expr (gfc_get_pchar_type (c->expr->ts.kind),
 				       se.expr);
       CONSTRUCTOR_APPEND_ELT (v, build_int_cst (gfc_array_index_type, nelem),
@@ -3695,7 +3695,7 @@ build_class_array_ref (gfc_se *se, tree base, tree index)
       else
 	decl = gfc_get_class_from_gfc_expr (class_expr);
 
-      if (POINTER_TYPE_P (TREE_TYPE (decl)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
 	decl = build_fold_indirect_ref_loc (input_location, decl);
 
       if (!GFC_CLASS_TYPE_P (TREE_TYPE (decl)))
@@ -3726,7 +3726,7 @@ non_negative_strides_array_p (tree expr)
     return false;
 
   tree type = TREE_TYPE (expr);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
 
   if (TYPE_LANG_SPECIFIC (type))
@@ -6251,7 +6251,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
     }
 
   /* Allocate memory to store the data.  */
-  if (POINTER_TYPE_P (TREE_TYPE (se->expr)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (se->expr)))
     se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
 
   if (coarray && flag_coarray == GFC_FCOARRAY_LIB)
@@ -7847,7 +7847,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
       if (expr->ts.type == BT_CHARACTER)
 	{
 	  gfc_conv_expr (&rse, expr);
-	  if (POINTER_TYPE_P (TREE_TYPE (rse.expr)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (rse.expr)))
 	    rse.expr = build_fold_indirect_ref_loc (input_location,
 						rse.expr);
 	}
@@ -8039,7 +8039,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
 	  tree tmp2 = desc;
 	  if (DECL_LANG_SPECIFIC (tmp2) && GFC_DECL_SAVED_DESCRIPTOR (tmp2))
 	    tmp2 = GFC_DECL_SAVED_DESCRIPTOR (tmp2);
-	  if (POINTER_TYPE_P (TREE_TYPE (tmp2)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (tmp2)))
 	    tmp2 = build_fold_indirect_ref_loc (input_location, tmp2);
 	  dtype = gfc_conv_descriptor_dtype (tmp2);
 	}
@@ -8431,7 +8431,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, bool g77,
         {
 	  /* Some variables are declared directly, others are declared as
 	     pointers and allocated on the heap.  */
-          if (sym->attr.dummy || POINTER_TYPE_P (TREE_TYPE (tmp)))
+          if (sym->attr.dummy || INDIRECT_TYPE_P (TREE_TYPE (tmp)))
             se->expr = tmp;
           else
 	    se->expr = gfc_build_addr_expr (NULL_TREE, tmp);
@@ -9104,7 +9104,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest,
 
   decl_type = TREE_TYPE (decl);
 
-  if ((POINTER_TYPE_P (decl_type))
+  if ((INDIRECT_TYPE_P (decl_type))
 	|| (TYPE_REF_P (decl_type) && rank == 0))
     {
       decl = build_fold_indirect_ref_loc (input_location, decl);
@@ -10075,7 +10075,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest,
 	      if (c->ts.type == BT_CLASS)
 		{
 		  tmp = gfc_get_vptr_from_expr (comp);
-		  if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 		    tmp = build_fold_indirect_ref_loc (input_location, tmp);
 		  tmp = gfc_vptr_size_get (tmp);
 		}
@@ -11086,7 +11086,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
       if (token == NULL_TREE)
 	{
 	  tmp = gfc_get_tree_for_caf_expr (expr1);
-	  if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	    tmp = build_fold_indirect_ref (tmp);
 	  gfc_get_caf_token_offset (&caf_se, &token, NULL, tmp, NULL_TREE,
 				    expr1);
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index a141fbdeed3..8f73cd11448 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -1107,7 +1107,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
       suppress_warning (GFC_TYPE_ARRAY_SIZE (type));
     }
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       gcc_assert (GFC_ARRAY_TYPE_P (TREE_TYPE (type)));
       gcc_assert (TYPE_LANG_SPECIFIC (type)
@@ -1232,7 +1232,7 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy)
 				  : TREE_TYPE (dummy));
   /* type now is the array descriptor w/o any indirection.  */
   gcc_assert (TREE_CODE (dummy) == PARM_DECL
-	  && POINTER_TYPE_P (TREE_TYPE (dummy)));
+	  && INDIRECT_TYPE_P (TREE_TYPE (dummy)));
 
   /* Do we know the element size?  */
   known_size = sym->ts.type != BT_CHARACTER
@@ -1604,7 +1604,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
 	&& TREE_CODE (sym->ts.u.cl->backend_decl) == PARM_DECL)
     {
       sym->ts.u.cl->passed_length = sym->ts.u.cl->backend_decl;
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (sym->ts.u.cl->passed_length)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (sym->ts.u.cl->passed_length)));
       sym->ts.u.cl->backend_decl = build_fold_indirect_ref (sym->ts.u.cl->backend_decl);
     }
 
@@ -1671,7 +1671,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
 		       && sym->ts.u.cl->backend_decl)
 		{
 		  sym->ts.u.cl->passed_length = sym->ts.u.cl->backend_decl;
-		  if (POINTER_TYPE_P (TREE_TYPE (sym->ts.u.cl->passed_length)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (sym->ts.u.cl->passed_length)))
 		    sym->ts.u.cl->backend_decl
 			= build_fold_indirect_ref (sym->ts.u.cl->backend_decl);
 		  else
@@ -1970,7 +1970,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
     }
 
   if (!TREE_STATIC (decl)
-      && POINTER_TYPE_P (TREE_TYPE (decl))
+      && INDIRECT_TYPE_P (TREE_TYPE (decl))
       && !sym->attr.pointer
       && !sym->attr.allocatable
       && !sym->attr.proc_pointer
@@ -2580,7 +2580,7 @@ create_function_arglist (gfc_symbol * sym)
 			       PARM_DECL,
 			       get_identifier (".__result"),
 			       len_type);
-	  if (POINTER_TYPE_P (len_type))
+	  if (INDIRECT_TYPE_P (len_type))
 	    {
 	      sym->ts.u.cl->passed_length = length;
 	      TREE_USED (length) = 1;
@@ -2677,7 +2677,7 @@ create_function_arglist (gfc_symbol * sym)
 	  if (!f->sym->ts.deferred)
 	    gcc_assert (len_type == gfc_charlen_type_node);
 	  else
-	    gcc_assert (POINTER_TYPE_P (len_type));
+	    gcc_assert (INDIRECT_TYPE_P (len_type));
 
 	  strcpy (&name[1], f->sym->name);
 	  name[0] = '_';
@@ -2725,7 +2725,7 @@ create_function_arglist (gfc_symbol * sym)
 	  if (f->sym->ts.u.cl->backend_decl == NULL
 	      || f->sym->ts.u.cl->backend_decl == length)
 	    {
-	      if (POINTER_TYPE_P (len_type))
+	      if (INDIRECT_TYPE_P (len_type))
 		f->sym->ts.u.cl->backend_decl
 		  = build_fold_indirect_ref_loc (input_location, length);
 	      else if (f->sym->ts.u.cl->backend_decl == NULL)
@@ -2811,7 +2811,7 @@ create_function_arglist (gfc_symbol * sym)
       /* All implementation args except for VALUE are read-only.  */
       if (!f->sym->attr.value)
 	TREE_READONLY (parm) = 1;
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  && (!f->sym->attr.proc_pointer
 	      && f->sym->attr.flavor != FL_PROCEDURE))
 	DECL_BY_REFERENCE (parm) = 1;
@@ -4299,14 +4299,14 @@ gfc_trans_vla_type_sizes (gfc_symbol *sym, stmtblock_t *body)
       type = TREE_TYPE (TREE_VALUE (current_fake_result_decl));
     }
 
-  while (POINTER_TYPE_P (type))
+  while (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
 
   if (GFC_DESCRIPTOR_TYPE_P (type))
     {
       tree etype = GFC_TYPE_ARRAY_DATAPTR_TYPE (type);
 
-      while (POINTER_TYPE_P (etype))
+      while (INDIRECT_TYPE_P (etype))
 	etype = TREE_TYPE (etype);
 
       gfc_trans_vla_type_sizes_1 (etype, body);
@@ -7062,7 +7062,7 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t *finally,
       tree data;
       if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (gfc_desc)))
 	data = gfc_conv_descriptor_data_get (gfc_desc);
-      else if (!POINTER_TYPE_P (TREE_TYPE (gfc_desc)))
+      else if (!INDIRECT_TYPE_P (TREE_TYPE (gfc_desc)))
 	data = gfc_build_addr_expr (NULL, gfc_desc);
       else
 	data = gfc_desc;
@@ -7368,7 +7368,7 @@ done:
       tree data, call;
       if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (gfc_desc)))
 	data = gfc_conv_descriptor_data_get (gfc_desc);
-      else if (!POINTER_TYPE_P (TREE_TYPE (gfc_desc)))
+      else if (!INDIRECT_TYPE_P (TREE_TYPE (gfc_desc)))
 	data = gfc_build_addr_expr (NULL, gfc_desc);
       else
 	data = gfc_desc;
@@ -7644,8 +7644,8 @@ gfc_generate_function_code (gfc_namespace * ns)
 	tree tmp = fsym->backend_decl;
 	fsym->backend_decl = NULL;
 	tree type = gfc_sym_type (fsym);
-	gcc_assert (POINTER_TYPE_P (type));
-	if (POINTER_TYPE_P (TREE_TYPE (type)))
+	gcc_assert (INDIRECT_TYPE_P (type));
+	if (INDIRECT_TYPE_P (TREE_TYPE (type)))
 	  /* For instance, allocatable scalars.  */
 	  type = TREE_TYPE (type);
 	if (TYPE_REF_P (type))
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index b019cda1813..2fc878a9481 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -97,7 +97,7 @@ get_scalar_to_descriptor_type (tree scalar, symbol_attribute attr)
   else
     akind = GFC_ARRAY_ASSUMED_SHAPE_CONT;
 
-  if (POINTER_TYPE_P (TREE_TYPE (scalar)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (scalar)))
     scalar = TREE_TYPE (scalar);
   return gfc_get_array_type_bounds (TREE_TYPE (scalar), 0, 0, NULL, NULL, 1,
 				    akind, !(attr.pointer || attr.target));
@@ -120,7 +120,7 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar, symbol_attribute attr)
       gfc_add_modify (&se->pre, tmp, scalar);
       scalar = tmp;
     }
-  if (!POINTER_TYPE_P (TREE_TYPE (scalar)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (scalar)))
     scalar = gfc_build_addr_expr (NULL_TREE, scalar);
   else if (TREE_TYPE (etype) && TREE_CODE (TREE_TYPE (etype)) == ARRAY_TYPE)
     etype = TREE_TYPE (etype);
@@ -228,7 +228,7 @@ tree
 gfc_class_data_get (tree decl)
 {
   tree data;
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref_loc (input_location, decl);
   data = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)),
 			    CLASS_DATA_FIELD);
@@ -247,7 +247,7 @@ gfc_class_vptr_get (tree decl)
   if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl)
       && GFC_DECL_SAVED_DESCRIPTOR (decl))
     decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref_loc (input_location, decl);
   vptr = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)),
 			    CLASS_VPTR_FIELD);
@@ -266,7 +266,7 @@ gfc_class_len_get (tree decl)
   if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl)
       && GFC_DECL_SAVED_DESCRIPTOR (decl))
     decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref_loc (input_location, decl);
   len = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)),
 			   CLASS_LEN_FIELD);
@@ -288,7 +288,7 @@ gfc_class_len_or_zero_get (tree decl)
   if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl)
       && GFC_DECL_SAVED_DESCRIPTOR (decl))
     decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref_loc (input_location, decl);
   len = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)),
 			   CLASS_LEN_FIELD);
@@ -645,7 +645,7 @@ gfc_get_class_from_expr (tree expr)
 	break;
     }
 
-  if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
     tmp = build_fold_indirect_ref_loc (input_location, tmp);
 
   if (GFC_CLASS_TYPE_P (TREE_TYPE (tmp)))
@@ -751,7 +751,7 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e,
   if (optional)
     cond_optional = gfc_conv_expr_present (e->symtree->n.sym);
 
-  if (parmse->expr && POINTER_TYPE_P (TREE_TYPE (parmse->expr)))
+  if (parmse->expr && INDIRECT_TYPE_P (TREE_TYPE (parmse->expr)))
     {
       /* If there is a ready made pointer to a derived type, use it
 	 rather than evaluating the expression again.  */
@@ -1216,7 +1216,7 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
 			  gfc_get_dtype (type));
 
 	  tmp = gfc_class_data_get (parmse->expr);
-	  if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	    tmp = gfc_build_addr_expr (NULL_TREE, tmp);
 
 	  gfc_conv_descriptor_data_set (&block, ctree, tmp);
@@ -1470,7 +1470,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited)
 	{
 	  /* Check that from is a class.  When the class is part of a coarray,
 	     then from is a common pointer and is to be used as is.  */
-	  tmp = POINTER_TYPE_P (TREE_TYPE (from))
+	  tmp = INDIRECT_TYPE_P (TREE_TYPE (from))
 	      ? build_fold_indirect_ref (from) : from;
 	  from_data =
 	      (GFC_CLASS_TYPE_P (TREE_TYPE (tmp))
@@ -2271,7 +2271,7 @@ gfc_get_tree_for_caf_expr (gfc_expr *expr)
       {
 	gfc_component *comp = ref->u.c.component;
 
-	if (POINTER_TYPE_P (TREE_TYPE (caf_decl)))
+	if (INDIRECT_TYPE_P (TREE_TYPE (caf_decl)))
 	  caf_decl = build_fold_indirect_ref_loc (input_location, caf_decl);
 	caf_decl = fold_build3_loc (input_location, COMPONENT_REF,
 				    TREE_TYPE (comp->backend_decl), caf_decl,
@@ -2338,7 +2338,7 @@ gfc_get_caf_token_offset (gfc_se *se, tree *token, tree *offset, tree caf_decl,
   else
     *offset = build_int_cst (gfc_array_index_type, 0);
 
-  if (POINTER_TYPE_P (TREE_TYPE (se_expr))
+  if (INDIRECT_TYPE_P (TREE_TYPE (se_expr))
       && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (se_expr))))
     {
       tmp = build_fold_indirect_ref_loc (input_location, se_expr);
@@ -2348,7 +2348,7 @@ gfc_get_caf_token_offset (gfc_se *se, tree *token, tree *offset, tree caf_decl,
     tmp = gfc_conv_descriptor_data_get (se_expr);
   else
     {
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (se_expr)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (se_expr)));
       tmp = se_expr;
     }
 
@@ -2399,7 +2399,7 @@ gfc_get_caf_token_offset (gfc_se *se, tree *token, tree *offset, tree caf_decl,
     tmp = gfc_conv_descriptor_data_get (caf_decl);
   else
    {
-     gcc_assert (POINTER_TYPE_P (TREE_TYPE (caf_decl)));
+     gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (caf_decl)));
      tmp = caf_decl;
    }
 
@@ -2899,7 +2899,7 @@ tree
 gfc_maybe_dereference_var (gfc_symbol *sym, tree var, bool descriptor_only_p,
 			   bool is_classarray)
 {
-  if (!POINTER_TYPE_P (TREE_TYPE (var)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (var)))
     return var;
   if (is_CFI_desc (sym, NULL))
     return build_fold_indirect_ref_loc (input_location, var);
@@ -3708,7 +3708,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
     {
       /* Allocate a temporary to hold the result.  */
       var = gfc_create_var (type, "pstr");
-      gcc_assert (POINTER_TYPE_P (type));
+      gcc_assert (INDIRECT_TYPE_P (type));
       tmp = TREE_TYPE (type);
       if (TREE_CODE (tmp) == ARRAY_TYPE)
         tmp = TREE_TYPE (tmp);
@@ -3982,7 +3982,7 @@ gfc_string_to_single_character (tree len, tree str, int kind)
 
   if (len == NULL
       || !tree_fits_uhwi_p (len)
-      || !POINTER_TYPE_P (TREE_TYPE (str)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (str)))
     return NULL_TREE;
 
   if (TREE_INT_CST_LOW (len) == 1)
@@ -4113,12 +4113,12 @@ build_memcmp_call (tree s1, tree s2, tree n)
 {
   tree tmp;
 
-  if (!POINTER_TYPE_P (TREE_TYPE (s1)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (s1)))
     s1 = gfc_build_addr_expr (pvoid_type_node, s1);
   else
     s1 = fold_convert (pvoid_type_node, s1);
 
-  if (!POINTER_TYPE_P (TREE_TYPE (s2)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (s2)))
     s2 = gfc_build_addr_expr (pvoid_type_node, s2);
   else
     s2 = fold_convert (pvoid_type_node, s2);
@@ -4143,8 +4143,8 @@ gfc_build_compare_string (tree len1, tree str1, tree len2, tree str2, int kind,
   tree sc2;
   tree fndecl;
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (str1)));
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (str2)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (str1)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (str2)));
 
   sc1 = gfc_string_to_single_character (len1, str1, kind);
   sc2 = gfc_string_to_single_character (len2, str2, kind);
@@ -4290,7 +4290,7 @@ conv_function_val (gfc_se * se, gfc_symbol * sym, gfc_expr * expr,
 	  tmp = gfc_evaluate_now (tmp, &se->pre);
 	}
 
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	{
 	  gcc_assert (TREE_CODE (tmp) == FUNCTION_DECL);
 	  tmp = gfc_build_addr_expr (NULL_TREE, tmp);
@@ -4539,7 +4539,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
 
   /* If the argument is an array descriptor, use it to determine
      information about the actual argument's shape.  */
-  else if (POINTER_TYPE_P (TREE_TYPE (se->expr))
+  else if (INDIRECT_TYPE_P (TREE_TYPE (se->expr))
 	   && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (se->expr))))
     {
       /* Get the actual argument's descriptor.  */
@@ -5260,7 +5260,7 @@ class_array_fcn:
       tree post_cond;
 
       type = TREE_TYPE (parmse->expr);
-      if (POINTER_TYPE_P (type) && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type)))
+      if (INDIRECT_TYPE_P (type) && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type)))
 	type = TREE_TYPE (type);
       pointer = gfc_create_var (type, "arg_ptr");
 
@@ -5401,7 +5401,7 @@ class_array_fcn:
       if (GFC_DESCRIPTOR_TYPE_P (type))
 	{
 	  type = TREE_TYPE (parmse->expr);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    {
 	      pointer = gfc_build_addr_expr (type, pointer);
 	      if (pass_optional)
@@ -5524,7 +5524,7 @@ set_dtype_for_unallocated (gfc_se *parmse, gfc_expr *e)
   if (desc == NULL_TREE)
     return;
 
-  if (POINTER_TYPE_P (TREE_TYPE (desc)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (desc)))
     desc = build_fold_indirect_ref_loc (input_location, desc);
   if (GFC_CLASS_TYPE_P (TREE_TYPE (desc)))
     desc = gfc_class_data_get (desc);
@@ -5578,7 +5578,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
       gfc_conv_expr (&se, e);
       gfc = se.expr;
       /* gfc_conv_constant ignores se.want_poiner, e.g. for string_cst.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (gfc)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (gfc)))
 	gfc = gfc_build_addr_expr (NULL, gfc);
     }
   else
@@ -5612,7 +5612,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
 	 elem_len = sizeof(dt) and base_addr = dt(lb) instead.
 	 gfc_get_dataptr_offset fixes the base_addr; for elem_len, see below.
 	 While sm is fine as it uses span*stride and not elem_len.  */
-      if (POINTER_TYPE_P (TREE_TYPE (gfc)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (gfc)))
 	gfc = build_fold_indirect_ref_loc (input_location, gfc);
       else if (is_subref_array (e) && e->ts.type != BT_CHARACTER)
 	 gfc_get_dataptr_offset (&se.pre, gfc, gfc, NULL, true, e);
@@ -7456,7 +7456,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 	      tmp = parmse.expr;
 	      if (fsym && fsym->ts.type == BT_CLASS)
 		{
-		  if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 		    tmp = build_fold_indirect_ref_loc (input_location, tmp);
 		  tmp = gfc_class_data_get (tmp);
 		  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
@@ -7465,7 +7465,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 
 	      /* If the argument is passed by value, we need to strip the
 		 INDIRECT_REF.  */
-	      if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+	      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 		tmp = gfc_build_addr_expr (NULL_TREE, tmp);
 
 	      cond = fold_build2_loc (input_location, EQ_EXPR,
@@ -7592,7 +7592,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 	    tmp = gfc_conv_descriptor_data_get (caf_decl);
 	  else
 	    {
-	      gcc_assert (POINTER_TYPE_P (caf_type));
+	      gcc_assert (INDIRECT_TYPE_P (caf_type));
 	      tmp = caf_decl;
 	    }
 
@@ -7606,10 +7606,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 		      || CLASS_DATA (fsym)->as->type == AS_ASSUMED_RANK)))
 	    {
 	      if (fsym->ts.type == BT_CLASS)
-		gcc_assert (!POINTER_TYPE_P (TREE_TYPE (tmp2)));
+		gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (tmp2)));
 	      else
 		{
-		  gcc_assert (POINTER_TYPE_P (TREE_TYPE (tmp2)));
+		  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (tmp2)));
 		  tmp2 = build_fold_indirect_ref_loc (input_location, tmp2);
 		}
 	      gcc_assert (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp2)));
@@ -7619,7 +7619,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 	    tmp2 = gfc_conv_descriptor_data_get (tmp2);
 	  else
 	    {
-	      gcc_assert (POINTER_TYPE_P (TREE_TYPE (tmp2)));
+	      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (tmp2)));
 	    }
 
 	  tmp = fold_build2_loc (input_location, MINUS_EXPR,
@@ -8299,12 +8299,12 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
 			  fold_convert (TREE_TYPE (dlen),
 					TYPE_SIZE_UNIT (chartype)));
 
-  if (dlength && POINTER_TYPE_P (TREE_TYPE (dest)))
+  if (dlength && INDIRECT_TYPE_P (TREE_TYPE (dest)))
     dest = fold_convert (pvoid_type_node, dest);
   else
     dest = gfc_build_addr_expr (pvoid_type_node, dest);
 
-  if (slength && POINTER_TYPE_P (TREE_TYPE (src)))
+  if (slength && INDIRECT_TYPE_P (TREE_TYPE (src)))
     src = fold_convert (pvoid_type_node, src);
   else
     src = gfc_build_addr_expr (pvoid_type_node, src);
@@ -8594,7 +8594,7 @@ gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type,
     {
       if (TREE_CODE (type) == ARRAY_TYPE)
 	return build_constructor (type, NULL);
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	return build_int_cst (type, 0);
       else
 	gcc_unreachable ();
@@ -10639,7 +10639,7 @@ gfc_conv_string_parameter (gfc_se * se)
 	}
     }
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (se->expr)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (se->expr)));
 }
 
 
@@ -10994,7 +10994,7 @@ fcncall_realloc_result (gfc_se *se, int rank)
   /* Use the allocation done by the library.  Substitute the lhs
      descriptor with a copy, whose data field is nulled.*/
   desc = build_fold_indirect_ref_loc (input_location, se->expr);
-  if (POINTER_TYPE_P (TREE_TYPE (desc)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (desc)))
     desc = build_fold_indirect_ref_loc (input_location, desc);
 
   /* Unallocated, the descriptor does not have a dtype.  */
@@ -11256,7 +11256,7 @@ gfc_trans_zero_assign (gfc_expr * expr)
   dest = gfc_get_symbol_decl (sym);
 
   type = TREE_TYPE (dest);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
   if (!GFC_ARRAY_TYPE_P (type))
     return NULL_TREE;
@@ -11272,7 +11272,7 @@ gfc_trans_zero_assign (gfc_expr * expr)
 
   /* If we are zeroing a local array avoid taking its address by emitting
      a = {} instead.  */
-  if (!POINTER_TYPE_P (TREE_TYPE (dest)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (dest)))
     return build2_loc (input_location, MODIFY_EXPR, void_type_node,
 		       dest, build_constructor (TREE_TYPE (dest),
 					      NULL));
@@ -11298,12 +11298,12 @@ gfc_build_memcpy_call (tree dst, tree src, tree len)
   tree tmp;
 
   /* Convert arguments to the correct types.  */
-  if (!POINTER_TYPE_P (TREE_TYPE (dst)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (dst)))
     dst = gfc_build_addr_expr (pvoid_type_node, dst);
   else
     dst = fold_convert (pvoid_type_node, dst);
 
-  if (!POINTER_TYPE_P (TREE_TYPE (src)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (src)))
     src = gfc_build_addr_expr (pvoid_type_node, src);
   else
     src = fold_convert (pvoid_type_node, src);
@@ -11334,10 +11334,10 @@ gfc_trans_array_copy (gfc_expr * expr1, gfc_expr * expr2)
   src = gfc_get_symbol_decl (expr2->symtree->n.sym);
 
   dtype = TREE_TYPE (dst);
-  if (POINTER_TYPE_P (dtype))
+  if (INDIRECT_TYPE_P (dtype))
     dtype = TREE_TYPE (dtype);
   stype = TREE_TYPE (src);
-  if (POINTER_TYPE_P (stype))
+  if (INDIRECT_TYPE_P (stype))
     stype = TREE_TYPE (stype);
 
   if (!GFC_ARRAY_TYPE_P (dtype) || !GFC_ARRAY_TYPE_P (stype))
@@ -11386,7 +11386,7 @@ gfc_trans_array_constructor_copy (gfc_expr * expr1, gfc_expr * expr2)
 
   dst = gfc_get_symbol_decl (expr1->symtree->n.sym);
   dtype = TREE_TYPE (dst);
-  if (POINTER_TYPE_P (dtype))
+  if (INDIRECT_TYPE_P (dtype))
     dtype = TREE_TYPE (dtype);
   if (!GFC_ARRAY_TYPE_P (dtype))
     return NULL_TREE;
@@ -11794,7 +11794,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
       class_han = GFC_CLASS_TYPE_P (TREE_TYPE (tmp))
 	  ? gfc_class_data_get (tmp) : tmp;
 
-      if (!POINTER_TYPE_P (TREE_TYPE (class_han)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (class_han)))
 	class_han = gfc_build_addr_expr (NULL_TREE, class_han);
 
       /* Allocate block.  */
@@ -11835,7 +11835,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
       ? gfc_class_data_get (rse->expr) : rse->expr;
   if (use_vptr_copy)
     {
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp))
 	  || INDIRECT_REF_P (tmp)
 	  || (rhs->ts.type == BT_DERIVED
 	      && rhs->ts.u.derived->attr.unlimited_polymorphic
@@ -11849,7 +11849,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
 	vec_safe_push (args, tmp);
       tmp = GFC_CLASS_TYPE_P (TREE_TYPE (lse->expr))
 	  ? gfc_class_data_get (lse->expr) : lse->expr;
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp))
 	  || INDIRECT_REF_P (tmp)
 	  || (lhs->ts.type == BT_DERIVED
 	      && lhs->ts.u.derived->attr.unlimited_polymorphic
@@ -11887,9 +11887,9 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
 	  ? gfc_class_data_get (lse->expr) : lse->expr;
       stmtblock_t tblock;
       gfc_init_block (&tblock);
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	tmp = gfc_build_addr_expr (NULL_TREE, tmp);
-      if (!POINTER_TYPE_P (TREE_TYPE (rhst)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (rhst)))
 	rhst = gfc_build_addr_expr (NULL_TREE, rhst);
       /* When coming from a ptr_copy lhs and rhs are swapped.  */
       gfc_add_modify_loc (input_location, &tblock, rhst,
@@ -12288,7 +12288,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
       if (tmp != NULL_TREE)
 	{
 	  tree fcn = gfc_vptr_copy_get (tmp);
-	  if (POINTER_TYPE_P (TREE_TYPE (fcn)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (fcn)))
 	    fcn = build_fold_indirect_ref_loc (input_location, fcn);
 	  tmp = build_call_expr_loc (input_location,
 				     fcn, 2,
diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index 87ff0a15237..4d1c5922b45 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -7486,7 +7486,7 @@ gfc_conv_intrinsic_ichar (gfc_se * se, gfc_expr * expr)
 
   nargs = gfc_intrinsic_argument_list_length (expr);
   gfc_conv_intrinsic_function_args (se, expr, args, nargs);
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (args[1])));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (args[1])));
   pchartype = gfc_get_pchar_type (expr->value.function.actual->expr->ts.kind);
   args[1] = fold_build1_loc (input_location, NOP_EXPR, pchartype, args[1]);
   type = gfc_typenode_for_spec (&expr->ts);
@@ -8103,7 +8103,7 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
       tmp = DECL_LANG_SPECIFIC (tmp)
 	    && GFC_DECL_SAVED_DESCRIPTOR (tmp) != NULL_TREE
 	    ? GFC_DECL_SAVED_DESCRIPTOR (tmp) : tmp;
-      if (POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	tmp = build_fold_indirect_ref_loc (input_location, tmp);
 
       tmp = gfc_conv_descriptor_dtype (tmp);
@@ -8120,7 +8120,7 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
 	 class object.  The class object may be a non-pointer object, e.g.
 	 located on the stack, or a memory location pointed to, e.g. a
 	 parameter, i.e., an indirect_ref.  */
-      if (POINTER_TYPE_P (TREE_TYPE (argse.expr))
+      if (INDIRECT_TYPE_P (TREE_TYPE (argse.expr))
 	  && GFC_CLASS_TYPE_P (TREE_TYPE (TREE_TYPE (argse.expr))))
 	byte_size
 	  = gfc_class_vtab_size_get (build_fold_indirect_ref (argse.expr));
@@ -11853,7 +11853,7 @@ conv_intrinsic_atomic_op (gfc_code *code)
       else
 	image_index = integer_zero_node;
 
-      if (!POINTER_TYPE_P (TREE_TYPE (value)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (value)))
 	{
 	  tmp = gfc_create_var (TREE_TYPE (TREE_TYPE (atom)), "value");
 	  gfc_add_modify (&block, tmp, fold_convert (TREE_TYPE (tmp), value));
@@ -12015,7 +12015,7 @@ conv_intrinsic_atomic_ref (gfc_code *code)
       gfc_add_block_to_block (&block, &argse.pre);
 
       /* Different type, need type conversion.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (value)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (value)))
 	{
 	  vardecl = gfc_create_var (TREE_TYPE (TREE_TYPE (atom)), "value");
           orig_value = value;
@@ -12139,7 +12139,7 @@ conv_intrinsic_atomic_cas (gfc_code *code)
 	}
 
       /* Convert a constant to a pointer.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (comp)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (comp)))
 	{
 	  tmp = gfc_create_var (TREE_TYPE (TREE_TYPE (old)), "comp");
 	  gfc_add_modify (&block, tmp, fold_convert (TREE_TYPE (tmp), comp));
diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc
index e36ad0e3db4..45335cfda15 100644
--- a/gcc/fortran/trans-io.cc
+++ b/gcc/fortran/trans-io.cc
@@ -1628,7 +1628,7 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
 
   /* Build indirect reference, if dummy argument.  */
 
-  if (POINTER_TYPE_P (TREE_TYPE(tmp)))
+  if (INDIRECT_TYPE_P (TREE_TYPE(tmp)))
     tmp = build_fold_indirect_ref_loc (input_location, tmp);
 
   /* Treat the component of a derived type, using base_addr for
@@ -1646,18 +1646,18 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
     tmp = gfc_conv_array_data (tmp);
   else
     {
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	tmp = gfc_build_addr_expr (NULL_TREE, tmp);
 
       if (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
          tmp = gfc_build_array_ref (tmp, gfc_index_zero_node, NULL);
 
-      if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (tmp)))
 	tmp = build_fold_indirect_ref_loc (input_location,
 				   tmp);
     }
 
-  gcc_assert (tmp && POINTER_TYPE_P (TREE_TYPE (tmp)));
+  gcc_assert (tmp && INDIRECT_TYPE_P (TREE_TYPE (tmp)));
 
   return tmp;
 }
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index a676442ca9e..d32aa5406d9 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -152,7 +152,7 @@ gfc_omp_array_data (tree decl, bool type_only)
 {
   tree type = TREE_TYPE (decl);
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
 
   if (!GFC_DESCRIPTOR_TYPE_P (type))
@@ -161,7 +161,7 @@ gfc_omp_array_data (tree decl, bool type_only)
   if (type_only)
     return GFC_TYPE_ARRAY_DATAPTR_TYPE (type);
 
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref (decl);
 
   decl = gfc_conv_descriptor_data_get (decl);
@@ -175,7 +175,7 @@ tree
 gfc_omp_array_size (tree decl, gimple_seq *pre_p)
 {
   stmtblock_t block;
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     decl = build_fold_indirect_ref (decl);
   tree type = TREE_TYPE (decl);
   gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
@@ -372,7 +372,7 @@ gfc_has_alloc_comps (tree type, tree decl)
 {
   tree field, ftype;
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl))
 	type = TREE_TYPE (type);
@@ -410,7 +410,7 @@ gfc_has_alloc_comps (tree type, tree decl)
 static bool
 gfc_is_polymorphic_nonptr (tree type)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
   return GFC_CLASS_TYPE_P (type);
 }
@@ -421,7 +421,7 @@ gfc_is_polymorphic_nonptr (tree type)
 static bool
 gfc_is_unlimited_polymorphic_nonptr (tree type)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = TREE_TYPE (type);
   if (!GFC_CLASS_TYPE_P (type))
     return false;
@@ -739,7 +739,7 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
   if ((! GFC_DESCRIPTOR_TYPE_P (type)
        || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
       && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
-	  || !POINTER_TYPE_P (type)))
+	  || !INDIRECT_TYPE_P (type)))
     {
       if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
 	{
@@ -863,7 +863,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
 
   if (gfc_is_polymorphic_nonptr (decl_type))
     {
-      if (POINTER_TYPE_P (decl_type))
+      if (INDIRECT_TYPE_P (decl_type))
 	decl_type = TREE_TYPE (decl_type);
       decl_type = TREE_TYPE (TYPE_FIELDS (decl_type));
       if (GFC_DESCRIPTOR_TYPE_P (decl_type) || GFC_ARRAY_TYPE_P (decl_type))
@@ -933,7 +933,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
   if ((! GFC_DESCRIPTOR_TYPE_P (type)
        || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
       && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
-	  || !POINTER_TYPE_P (type)))
+	  || !INDIRECT_TYPE_P (type)))
     {
       if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
 	{
@@ -1037,7 +1037,7 @@ gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
   if ((! GFC_DESCRIPTOR_TYPE_P (type)
        || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
       && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
-	  || !POINTER_TYPE_P (type)))
+	  || !INDIRECT_TYPE_P (type)))
     {
       if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
 	{
@@ -1234,7 +1234,7 @@ gfc_omp_linear_clause_add_loop (stmtblock_t *block, tree dest, tree src,
     }
   else
     {
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (dest)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (dest)));
       tree idx = fold_build2 (MULT_EXPR, sizetype,
 			      fold_convert (sizetype, index),
 			      TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (dest))));
@@ -1276,7 +1276,7 @@ gfc_omp_clause_linear_ctor (tree clause, tree dest, tree src, tree add)
   if ((! GFC_DESCRIPTOR_TYPE_P (type)
        || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
       && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
-	  || !POINTER_TYPE_P (type)))
+	  || !INDIRECT_TYPE_P (type)))
     {
       bool compute_nelts = false;
       gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
@@ -1380,7 +1380,7 @@ gfc_omp_clause_dtor (tree clause, tree decl)
 	= TREE_TYPE (GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_DECL (clause)));
   if (gfc_is_polymorphic_nonptr (decl_type))
     {
-      if (POINTER_TYPE_P (decl_type))
+      if (INDIRECT_TYPE_P (decl_type))
 	decl_type = TREE_TYPE (decl_type);
       decl_type = TREE_TYPE (TYPE_FIELDS (decl_type));
       if (GFC_DESCRIPTOR_TYPE_P (decl_type) || GFC_ARRAY_TYPE_P (decl_type))
@@ -1426,7 +1426,7 @@ gfc_omp_clause_dtor (tree clause, tree decl)
   if ((! GFC_DESCRIPTOR_TYPE_P (type)
        || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
       && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
-	  || !POINTER_TYPE_P (type)))
+	  || !INDIRECT_TYPE_P (type)))
     {
       if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
 	return gfc_walk_alloc_comps (decl, NULL_TREE,
@@ -1545,7 +1545,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
 
   tree c2 = NULL_TREE, c3 = NULL_TREE, c4 = NULL_TREE;
   tree present = gfc_omp_check_optional_argument (decl, true);
-  if (POINTER_TYPE_P (TREE_TYPE (decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
     {
       if (!gfc_omp_privatize_by_reference (decl)
 	  && !GFC_DECL_GET_SCALAR_POINTER (decl)
@@ -1616,7 +1616,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
       if (present)
 	ptr = gfc_build_cond_assign_expr (&block, present, ptr,
 					  null_pointer_node);
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
       ptr = build_fold_indirect_ref (ptr);
       OMP_CLAUSE_DECL (c) = ptr;
       c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
@@ -2452,11 +2452,11 @@ gfc_trans_omp_array_section (stmtblock_t *block, gfc_exec_op op,
 					    OMP_CLAUSE_SIZE (node), elemsz);
     }
   gcc_assert (se.post.head == NULL_TREE);
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
   OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (ptr);
   ptr = fold_convert (ptrdiff_type_node, ptr);
 
-  if (POINTER_TYPE_P (TREE_TYPE (decl))
+  if (INDIRECT_TYPE_P (TREE_TYPE (decl))
       && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))
       && ptr_kind == GOMP_MAP_POINTER
       && op != EXEC_OMP_TARGET_EXIT_DATA
@@ -2552,7 +2552,7 @@ gfc_trans_omp_array_section (stmtblock_t *block, gfc_exec_op op,
 	}
       else
 	{
-	  gcc_assert (POINTER_TYPE_P (TREE_TYPE (decl)));
+	  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (decl)));
 	  ptr2 = decl;
 	}
       node3 = build_omp_clause (input_location,
@@ -2848,7 +2848,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 				  }
 				else
 				  type = gfc_sym_type (n->sym);
-				if (POINTER_TYPE_P (type))
+				if (INDIRECT_TYPE_P (type))
 				  type = TREE_TYPE (type);
 				/* Otherwise to be determined what exactly
 				   should be done.  */
@@ -2980,7 +2980,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
 		    {
 		      decl = gfc_conv_descriptor_data_get (decl);
-		      gcc_assert (POINTER_TYPE_P (TREE_TYPE (decl)));
+		      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (decl)));
 		      decl = build_fold_indirect_ref (decl);
 		    }
 		  else if (n->sym->attr.allocatable || n->sym->attr.pointer)
@@ -3005,7 +3005,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		    }
 		  gfc_add_block_to_block (&iter_block, &se.pre);
 		  gfc_add_block_to_block (&iter_block, &se.post);
-		  gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+		  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
 		  OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (ptr);
 		}
 	      if (list == OMP_LIST_DEPEND)
@@ -3220,7 +3220,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		      OMP_CLAUSE_SIZE (node2) = size_int (0);
 		      goto finalize_map_clause;
 		    }
-		  else if (POINTER_TYPE_P (type)
+		  else if (INDIRECT_TYPE_P (type)
 			   && (gfc_omp_privatize_by_reference (decl)
 			       || GFC_DECL_GET_SCALAR_POINTER (decl)
 			       || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)
@@ -3310,7 +3310,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		      if (present)
 			ptr = gfc_build_cond_assign_expr (block, present, ptr,
 							  null_pointer_node);
-		      gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+		      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
 		      ptr = build_fold_indirect_ref (ptr);
 		      OMP_CLAUSE_DECL (node) = ptr;
 		      node2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
@@ -3469,7 +3469,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			   && INDIRECT_REF_P (TREE_OPERAND (decl, 0)))
 		    {
 		      /* A single indirectref is handled by the middle end.  */
-		      gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)));
+		      gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (decl)));
 		      decl = TREE_OPERAND (decl, 0);
 		      decl = gfc_build_cond_assign_expr (block, present, decl,
 							 null_pointer_node);
@@ -3521,7 +3521,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		  gomp_map_kind k = GOMP_MAP_POINTER;
 		  if (!openacc
 		      && !GFC_DESCRIPTOR_TYPE_P (type)
-		      && !(POINTER_TYPE_P (type)
+		      && !(INDIRECT_TYPE_P (type)
 			   && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))))
 		    k = GOMP_MAP_FIRSTPRIVATE_POINTER;
 		  gfc_trans_omp_array_section (block, op, n, decl, element, k,
@@ -3544,7 +3544,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		  gfc_add_block_to_block (block, &se.pre);
 		  /* For BT_CHARACTER a pointer is returned.  */
 		  OMP_CLAUSE_DECL (node)
-		    = POINTER_TYPE_P (TREE_TYPE (se.expr))
+		    = INDIRECT_TYPE_P (TREE_TYPE (se.expr))
 		      ? build_fold_indirect_ref (se.expr) : se.expr;
 		  gfc_add_block_to_block (block, &se.post);
 		  if (pointer || allocatable)
@@ -3569,7 +3569,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 				   : GOMP_MAP_ALWAYS_POINTER);
 		      OMP_CLAUSE_SET_MAP_KIND (node2, kind);
 		      OMP_CLAUSE_DECL (node2)
-			= POINTER_TYPE_P (TREE_TYPE (se.expr))
+			= INDIRECT_TYPE_P (TREE_TYPE (se.expr))
 			  ? se.expr
 			  : gfc_build_addr_expr (NULL, se.expr);
 		      OMP_CLAUSE_SIZE (node2) = size_int (0);
@@ -3656,7 +3656,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			  if (lastref->u.c.component->ts.type == BT_CLASS)
 			    {
 			      data = gfc_class_data_get (inner);
-			      gcc_assert (POINTER_TYPE_P (TREE_TYPE (data)));
+			      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (data)));
 			      data = build_fold_indirect_ref (data);
 			      size = gfc_class_vtab_size_get (inner);
 			    }
@@ -3691,7 +3691,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			 additional nodes.  */
 		      if ((n->u.map_op == OMP_MAP_ATTACH
 			   || n->u.map_op == OMP_MAP_DETACH)
-			  && (POINTER_TYPE_P (TREE_TYPE (inner))
+			  && (INDIRECT_TYPE_P (TREE_TYPE (inner))
 			      || GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (inner))))
 			{
 			  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (inner)))
@@ -3865,7 +3865,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		    {
 		      tree type = TREE_TYPE (decl);
 		      tree ptr = gfc_conv_descriptor_data_get (decl);
-		      gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+		      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
 		      ptr = build_fold_indirect_ref (ptr);
 		      OMP_CLAUSE_DECL (node) = ptr;
 		      OMP_CLAUSE_SIZE (node)
@@ -3915,7 +3915,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 				       OMP_CLAUSE_SIZE (node), elemsz);
 		    }
 		  gfc_add_block_to_block (block, &se.post);
-		  gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+		  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
 		  OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (ptr);
 		}
 	      if (n->u.present_modifier)
@@ -5989,7 +5989,7 @@ gfc_trans_omp_depobj (gfc_code *code)
   gcc_assert (se.pre.head == NULL && se.post.head == NULL);
   tree depobj = se.expr;
   location_t loc = EXPR_LOCATION (depobj);
-  if (!POINTER_TYPE_P (TREE_TYPE (depobj)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (depobj)))
     depobj = gfc_build_addr_expr (NULL, depobj);
   depobj = fold_convert (build_pointer_type_for_mode (ptr_type_node,
 						      TYPE_MODE (ptr_type_node),
@@ -6015,25 +6015,25 @@ gfc_trans_omp_depobj (gfc_code *code)
 	    }
 	  gfc_add_block_to_block (&block, &se.pre);
 	  gfc_add_block_to_block (&block, &se.post);
-	  gcc_assert (POINTER_TYPE_P (TREE_TYPE (var)));
+	  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (var)));
 	}
       else
 	{
 	  var = gfc_get_symbol_decl (n->sym);
-	  if (POINTER_TYPE_P (TREE_TYPE (var))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (var))
 	      && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (var))))
 	    var = build_fold_indirect_ref (var);
 	  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (var)))
 	    {
 	      var = gfc_conv_descriptor_data_get (var);
-	      gcc_assert (POINTER_TYPE_P (TREE_TYPE (var)));
+	      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (var)));
 	    }
 	  else if ((n->sym->attr.allocatable || n->sym->attr.pointer)
 		   && n->sym->attr.dummy)
 	    var = build_fold_indirect_ref (var);
-	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
+	  else if (!INDIRECT_TYPE_P (TREE_TYPE (var))
 		   || (n->sym->ts.f90_type == BT_VOID
-		       && !POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (var)))
+		       && !INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (var)))
 		       && !GFC_ARRAY_TYPE_P (TREE_TYPE (TREE_TYPE (var)))))
 	    {
 	      TREE_ADDRESSABLE (var) = 1;
@@ -6091,7 +6091,7 @@ gfc_trans_omp_error (gfc_code *code)
     {
       gfc_conv_expr (&se, code->ext.omp_clauses->message);
       message = se.expr;
-      if (!POINTER_TYPE_P (TREE_TYPE (message)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (message)))
 	/* To ensure an ARRAY_TYPE is not passed as such.  */
 	message = gfc_build_addr_expr (NULL, message);
       len = se.string_length;
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index 93f36bfb955..b80f5653551 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -1802,7 +1802,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 	      if (DECL_LANG_SPECIFIC (class_decl)
 		  && GFC_DECL_SAVED_DESCRIPTOR (class_decl))
 		class_decl = GFC_DECL_SAVED_DESCRIPTOR (class_decl);
-	      if (POINTER_TYPE_P (TREE_TYPE (class_decl)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (class_decl)))
 		class_decl = build_fold_indirect_ref_loc (input_location,
 							  class_decl);
 	      gcc_assert (GFC_CLASS_TYPE_P (TREE_TYPE (class_decl)));
@@ -1812,7 +1812,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 	    {
 	      class_decl = sym2->backend_decl;
 	      gfc_conv_expr_descriptor (&se, e);
-	      if (POINTER_TYPE_P (TREE_TYPE (se.expr)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (se.expr)))
 		se.expr = build_fold_indirect_ref_loc (input_location,
 						       se.expr);
 	    }
@@ -1831,7 +1831,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 
       /* The SELECT TYPE mechanisms turn class temporaries into pointers, which
 	 point to the selector. */
-      class_ptr = class_decl != NULL_TREE && POINTER_TYPE_P (TREE_TYPE (desc));
+      class_ptr = class_decl != NULL_TREE && INDIRECT_TYPE_P (TREE_TYPE (desc));
       if (class_ptr)
 	{
 	  tmp = gfc_create_var (TREE_TYPE (TREE_TYPE (desc)), "class");
@@ -1867,7 +1867,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 	  sym2 = sym2->assoc->target->symtree->n.sym;
 	  se.expr = sym2->backend_decl;
 
-	  if (POINTER_TYPE_P (TREE_TYPE (se.expr)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (se.expr)))
 	    se.expr = build_fold_indirect_ref_loc (input_location,
 						   se.expr);
 	}
@@ -2129,7 +2129,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 	}
 
       if (sym->ts.type == BT_CHARACTER && e->ts.type == BT_CHARACTER
-	  && POINTER_TYPE_P (TREE_TYPE (se.expr)))
+	  && INDIRECT_TYPE_P (TREE_TYPE (se.expr)))
 	{
 	  /* These are pointer types already.  */
 	  tmp = fold_convert (TREE_TYPE (sym->backend_decl), se.expr);
@@ -6490,7 +6490,7 @@ gfc_trans_allocate (gfc_code * code)
       if (code->expr3->ts.type == BT_CLASS)
 	{
 	  gfc_expr *rhs;
-	  tmp = expr3 != NULL_TREE && POINTER_TYPE_P (TREE_TYPE (expr3)) ?
+	  tmp = expr3 != NULL_TREE && INDIRECT_TYPE_P (TREE_TYPE (expr3)) ?
 		build_fold_indirect_ref (expr3): expr3;
 	  /* Polymorphic SOURCE: VPTR must be determined at run time.
 	     expr3 may be a temporary array declaration, therefore check for
@@ -6684,7 +6684,7 @@ gfc_trans_allocate (gfc_code * code)
 		}
 	      gfc_add_full_array_ref (e3rhs, arr);
 	    }
-	  else if (POINTER_TYPE_P (TREE_TYPE (expr3)))
+	  else if (INDIRECT_TYPE_P (TREE_TYPE (expr3)))
 	    newsym->n.sym->attr.pointer = 1;
 	  /* The string length is known, too.  Set it for char arrays.  */
 	  if (e3rhs->ts.type == BT_CHARACTER)
diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index 987e3d26c46..46e07712616 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -1142,7 +1142,7 @@ gfc_get_character_type (int kind, gfc_charlen * cl)
   tree len;
 
   len = (cl == NULL) ? NULL_TREE : cl->backend_decl;
-  if (len && POINTER_TYPE_P (TREE_TYPE (len)))
+  if (len && INDIRECT_TYPE_P (TREE_TYPE (len)))
     len = build_fold_indirect_ref (len);
 
   return gfc_get_character_type_len (kind, len);
@@ -2859,7 +2859,7 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
       /* Ensure that the CLASS language specific flag is set.  */
       if (c->ts.type == BT_CLASS)
 	{
-	  if (POINTER_TYPE_P (field_type))
+	  if (INDIRECT_TYPE_P (field_type))
 	    GFC_CLASS_TYPE_P (TREE_TYPE (field_type)) = 1;
 	  else
 	    GFC_CLASS_TYPE_P (field_type) = 1;
@@ -3445,7 +3445,7 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
 
   if (! GFC_DESCRIPTOR_TYPE_P (type))
     {
-      if (! POINTER_TYPE_P (type))
+      if (! INDIRECT_TYPE_P (type))
 	return false;
       type = TREE_TYPE (type);
       if (! GFC_DESCRIPTOR_TYPE_P (type))
@@ -3458,7 +3458,7 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
     return false;
 
   etype = GFC_TYPE_ARRAY_DATAPTR_TYPE (type);
-  gcc_assert (POINTER_TYPE_P (etype));
+  gcc_assert (INDIRECT_TYPE_P (etype));
   etype = TREE_TYPE (etype);
 
   /* If the type is not a scalar coarray.  */
diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc
index e2e1b694012..80951f22849 100644
--- a/gcc/fortran/trans.cc
+++ b/gcc/fortran/trans.cc
@@ -344,7 +344,7 @@ gfc_build_addr_expr (tree type, tree t)
   tree base_type = TREE_TYPE (t);
   tree natural_type;
 
-  if (type && POINTER_TYPE_P (type)
+  if (type && INDIRECT_TYPE_P (type)
       && TREE_CODE (base_type) == ARRAY_TYPE
       && TYPE_MAIN_VARIANT (TREE_TYPE (type))
 	 == TYPE_MAIN_VARIANT (TREE_TYPE (base_type)))
@@ -424,7 +424,7 @@ get_array_span (tree type, tree decl)
 	  else
 	    {
 	      /* Allow for dummy arguments and other good things.  */
-	      if (POINTER_TYPE_P (TREE_TYPE (decl)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (decl)))
 		decl = build_fold_indirect_ref_loc (input_location, decl);
 
 	      /* Check if '_data' is an array descriptor.  If it is not,
@@ -1117,7 +1117,7 @@ get_final_proc_ref (gfc_se *se, gfc_expr *expr, tree class_container)
       gfc_conv_expr (se, final_wrapper);
     }
 
-  if (POINTER_TYPE_P (TREE_TYPE (se->expr)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (se->expr)))
     se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
 }
 
@@ -1212,7 +1212,7 @@ get_var_descr (gfc_se *se, gfc_expr *var, tree class_container)
       gcc_assert (tmp_se.post.head == NULL_TREE);
     }
 
-  if (!POINTER_TYPE_P (TREE_TYPE (tmp_se.expr)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (tmp_se.expr)))
     tmp_se.expr = gfc_build_addr_expr (NULL, tmp_se.expr);
 
   gfc_add_block_to_block (&se->pre, &tmp_se.pre);
@@ -1309,7 +1309,7 @@ gfc_add_comp_finalizer_call (stmtblock_t *block, tree decl, gfc_component *comp,
       gcc_assert (se.post.head == NULL_TREE);
     }
 
-  if (!POINTER_TYPE_P (TREE_TYPE (array)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (array)))
     array = gfc_build_addr_expr (NULL, array);
 
   if (!final_expr)
@@ -1322,7 +1322,7 @@ gfc_add_comp_finalizer_call (stmtblock_t *block, tree decl, gfc_component *comp,
 			      logical_type_node, cond, tmp);
     }
 
-  if (POINTER_TYPE_P (TREE_TYPE (final_fndecl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (final_fndecl)))
     final_fndecl = build_fold_indirect_ref_loc (input_location, final_fndecl);
 
   tmp = build_call_expr_loc (input_location,
@@ -1912,7 +1912,7 @@ gfc_deallocate_with_status (tree pointer, tree status, tree errmsg,
       else
 	{
 	  gcc_assert (errlen != NULL_TREE);
-	  if (!POINTER_TYPE_P (TREE_TYPE (errmsg)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (errmsg)))
 	    errmsg = gfc_build_addr_expr (NULL_TREE, errmsg);
 	}
 
diff --git a/gcc/function-abi.cc b/gcc/function-abi.cc
index 2ab9b2c5649..81cfc35e575 100644
--- a/gcc/function-abi.cc
+++ b/gcc/function-abi.cc
@@ -249,6 +249,6 @@ expr_callee_abi (const_tree exp)
   if (type == error_mark_node)
     return default_function_abi;
 
-  gcc_assert (POINTER_TYPE_P (type));
+  gcc_assert (INDIRECT_TYPE_P (type));
   return fntype_abi (TREE_TYPE (type));
 }
diff --git a/gcc/function.cc b/gcc/function.cc
index dd2c1136e07..d4a40198302 100644
--- a/gcc/function.cc
+++ b/gcc/function.cc
@@ -2858,7 +2858,7 @@ assign_parm_adjust_stack_rtl (struct assign_parm_data_one *data)
   else if (crtl->stack_protect_guard
 	   && (flag_stack_protect == SPCT_FLAG_ALL
 	       || data->arg.pass_by_reference
-	       || POINTER_TYPE_P (data->nominal_type)))
+	       || INDIRECT_TYPE_P (data->nominal_type)))
     stack_parm = NULL;
 
   data->stack_parm = stack_parm;
@@ -3447,7 +3447,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
     }
 
   /* For pointer data type, suggest pointer register.  */
-  if (POINTER_TYPE_P (TREE_TYPE (parm)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (parm)))
     mark_reg_pointer (parmreg,
 		      TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
 }
@@ -6414,7 +6414,7 @@ used_types_insert_helper (tree type, struct function *func)
 void
 used_types_insert (tree t)
 {
-  while (POINTER_TYPE_P (t) || TREE_CODE (t) == ARRAY_TYPE)
+  while (INDIRECT_TYPE_P (t) || TREE_CODE (t) == ARRAY_TYPE)
     if (TYPE_NAME (t))
       break;
     else
diff --git a/gcc/gimple-array-bounds.cc b/gcc/gimple-array-bounds.cc
index e04c8e29d5a..fa246ba3e47 100644
--- a/gcc/gimple-array-bounds.cc
+++ b/gcc/gimple-array-bounds.cc
@@ -105,7 +105,7 @@ get_ref_size (tree arg, tree *pref)
 
   arg = TREE_OPERAND (arg, 0);
   tree type = TREE_TYPE (arg);
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return NULL_TREE;
 
   type = TREE_TYPE (type);
@@ -152,7 +152,7 @@ trailing_array (tree arg, tree *pref)
 
   tree basetype = TREE_TYPE (base);
   if (TREE_CODE (base) == PARM_DECL
-      && POINTER_TYPE_P (basetype))
+      && INDIRECT_TYPE_P (basetype))
     {
       tree ptype = TREE_TYPE (basetype);
       if (TREE_CODE (ptype) == ARRAY_TYPE)
@@ -517,7 +517,7 @@ array_bounds_checker::check_mem_ref (location_t location, tree ref,
   tree reftype = TREE_TYPE (aref.ref);
   /* The size of the referenced array element.  */
   offset_int eltsize = 1;
-  if (POINTER_TYPE_P (reftype))
+  if (INDIRECT_TYPE_P (reftype))
     reftype = TREE_TYPE (reftype);
 
   if (TREE_CODE (reftype) == FUNCTION_TYPE)
diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc
index f15cc0ba715..d333f1038d5 100644
--- a/gcc/gimple-expr.cc
+++ b/gcc/gimple-expr.cc
@@ -68,8 +68,8 @@ bool
 useless_type_conversion_p (tree outer_type, tree inner_type)
 {
   /* Do the following before stripping toplevel qualifiers.  */
-  if (POINTER_TYPE_P (inner_type)
-      && POINTER_TYPE_P (outer_type))
+  if (INDIRECT_TYPE_P (inner_type)
+      && INDIRECT_TYPE_P (outer_type))
     {
       /* Do not lose casts between pointers to different address spaces.  */
       if (TYPE_ADDR_SPACE (TREE_TYPE (outer_type))
@@ -128,8 +128,8 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
     return TYPE_SATURATING (inner_type) == TYPE_SATURATING (outer_type);
 
   /* We need to take special care recursing to pointed-to types.  */
-  else if (POINTER_TYPE_P (inner_type)
-	   && POINTER_TYPE_P (outer_type))
+  else if (INDIRECT_TYPE_P (inner_type)
+	   && INDIRECT_TYPE_P (outer_type))
     {
       /* We do not care for const qualification of the pointed-to types
 	 as const qualification has no semantic value to the middle-end.  */
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 4027ff71e10..dcfca7880ed 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -944,10 +944,10 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi,
 	 order barrier, i.e. is equivalent to a VIEW_CONVERT_EXPR that can
 	 modify the storage order of objects (see storage_order_barrier_p).  */
       tree srctype
-	= POINTER_TYPE_P (TREE_TYPE (src))
+	= INDIRECT_TYPE_P (TREE_TYPE (src))
 	  ? TREE_TYPE (TREE_TYPE (src)) : NULL_TREE;
       tree desttype
-	= POINTER_TYPE_P (TREE_TYPE (dest))
+	= INDIRECT_TYPE_P (TREE_TYPE (dest))
 	  ? TREE_TYPE (TREE_TYPE (dest)) : NULL_TREE;
       tree destvar, srcvar, srcoff;
       unsigned int src_align, dest_align;
@@ -1476,7 +1476,7 @@ gimple_fold_builtin_memset (gimple_stmt_iterator *gsi, tree c, tree len)
     etype = TREE_TYPE (etype);
 
   if (!INTEGRAL_TYPE_P (etype)
-      && !POINTER_TYPE_P (etype))
+      && !INDIRECT_TYPE_P (etype))
     return NULL_TREE;
 
   if (! var_decl_component_p (var))
@@ -3431,7 +3431,7 @@ gimple_fold_builtin_sprintf_chk (gimple_stmt_iterator *gsi,
 	  if (nargs == 5)
 	    {
 	      arg = gimple_call_arg (stmt, 4);
-	      if (POINTER_TYPE_P (TREE_TYPE (arg)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (arg)))
 		len = c_strlen (arg, 1);
 	    }
 	}
@@ -3554,7 +3554,7 @@ gimple_fold_builtin_sprintf (gimple_stmt_iterator *gsi)
 
       /* Don't fold calls with source arguments of invalid (nonpointer)
 	 types.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (orig)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (orig)))
 	return false;
 
       tree orig_len = NULL_TREE;
@@ -3806,7 +3806,7 @@ gimple_fold_builtin_fprintf (gimple_stmt_iterator *gsi,
   /* If the format specifier was "%s", call __builtin_fputs (arg, fp).  */
   else if (strcmp (fmt_str, target_percent_s) == 0)
     {
-      if (!arg || ! POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (!arg || ! INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	return false;
       if (fn_fputs)
 	{
@@ -3884,7 +3884,7 @@ gimple_fold_builtin_printf (gimple_stmt_iterator *gsi, tree fmt,
 	  if (fcode == BUILT_IN_VPRINTF || fcode == BUILT_IN_VPRINTF_CHK)
 	    return false;
 
-	  if (!arg || ! POINTER_TYPE_P (TREE_TYPE (arg)))
+	  if (!arg || ! INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	    return false;
 
 	  str = c_getstr (arg);
@@ -3958,7 +3958,7 @@ gimple_fold_builtin_printf (gimple_stmt_iterator *gsi, tree fmt,
   /* If the format specifier was "%s\n", call __builtin_puts(arg).  */
   else if (strcmp (fmt_str, target_percent_s_newline) == 0)
     {
-      if (!arg || ! POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (!arg || ! INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	return false;
       if (fn_puts)
 	{
@@ -6964,7 +6964,7 @@ follow_outer_ssa_edges (tree val)
       /* We cannot temporarily rewrite stmts with undefined overflow
 	 behavior, so avoid expanding them.  */
       if ((ANY_INTEGRAL_TYPE_P (TREE_TYPE (val))
-	   || POINTER_TYPE_P (TREE_TYPE (val)))
+	   || INDIRECT_TYPE_P (TREE_TYPE (val)))
 	  && !TYPE_OVERFLOW_WRAPS (TREE_TYPE (val)))
 	return NULL_TREE;
       /* If the definition does not dominate fosa_bb temporarily reset
@@ -8566,7 +8566,7 @@ gimple_fold_indirect_ref (tree t)
 
   STRIP_NOPS (sub);
   subtype = TREE_TYPE (sub);
-  if (!POINTER_TYPE_P (subtype)
+  if (!INDIRECT_TYPE_P (subtype)
       || TYPE_REF_CAN_ALIAS_ALL (ptype))
     return NULL_TREE;
 
diff --git a/gcc/gimple-loop-versioning.cc b/gcc/gimple-loop-versioning.cc
index 7b55129baa7..ff3f88151f0 100644
--- a/gcc/gimple-loop-versioning.cc
+++ b/gcc/gimple-loop-versioning.cc
@@ -378,7 +378,7 @@ static bool
 look_through_cast_p (tree type, tree from)
 {
   return (INTEGRAL_TYPE_P (TREE_TYPE (from)) == INTEGRAL_TYPE_P (type)
-	  && POINTER_TYPE_P (TREE_TYPE (from)) == POINTER_TYPE_P (type));
+	  && INDIRECT_TYPE_P (TREE_TYPE (from)) == INDIRECT_TYPE_P (type));
 }
 
 /* Strip all conversions of integers or pointers from EXPR, regardless
@@ -1076,7 +1076,7 @@ loop_versioning::analyze_address_fragment (address_info &address)
   for (unsigned int i = 0; i < address.terms.length (); ++i)
     if (!find_per_loop_multiplication (address, address.terms[i])
 	&& !analyze_term_using_scevs (address, address.terms[i])
-	&& !POINTER_TYPE_P (TREE_TYPE (address.terms[i].expr)))
+	&& !INDIRECT_TYPE_P (TREE_TYPE (address.terms[i].expr)))
       analyze_arbitrary_term (address, address.terms[i]);
 
   /* Check for strides that are likely to be for the innermost dimension.
diff --git a/gcc/gimple-low.cc b/gcc/gimple-low.cc
index e6f04f234df..0f98e1aca67 100644
--- a/gcc/gimple-low.cc
+++ b/gcc/gimple-low.cc
@@ -1328,7 +1328,7 @@ lower_builtin_assume_aligned (gimple_stmt_iterator *gsi)
   gcall *call = as_a <gcall *> (gsi_stmt (*gsi));
 
   tree lhs = gimple_call_lhs (call);
-  if (!lhs || !POINTER_TYPE_P (TREE_TYPE (lhs)) || TREE_CODE (lhs) != SSA_NAME)
+  if (!lhs || !INDIRECT_TYPE_P (TREE_TYPE (lhs)) || TREE_CODE (lhs) != SSA_NAME)
     return;
 
   tree align = gimple_call_arg (call, 1);
diff --git a/gcc/gimple-pretty-print.cc b/gcc/gimple-pretty-print.cc
index 8db221f65fe..65a77c58505 100644
--- a/gcc/gimple-pretty-print.cc
+++ b/gcc/gimple-pretty-print.cc
@@ -2338,7 +2338,7 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
   if (TREE_CODE (node) != SSA_NAME)
     return;
 
-  if (POINTER_TYPE_P (TREE_TYPE (node))
+  if (INDIRECT_TYPE_P (TREE_TYPE (node))
       && SSA_NAME_PTR_INFO (node))
     {
       unsigned int align, misalign;
@@ -2353,7 +2353,7 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
 	}
     }
 
-  if (!POINTER_TYPE_P (TREE_TYPE (node))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (node))
       && SSA_NAME_RANGE_INFO (node))
     {
       Value_Range r (TREE_TYPE (node));
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index 52165d2405b..53d77f006fa 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -272,7 +272,7 @@ sbr_sparse_bitmap::sbr_sparse_bitmap (tree t, vrange_allocator *allocator,
   // Pre-cache varying.
   m_range[0] = m_range_allocator->clone_varying (t);
   // Pre-cache zero and non-zero values for pointers.
-  if (POINTER_TYPE_P (t))
+  if (INDIRECT_TYPE_P (t))
     {
       int_range<2> nonzero;
       nonzero.set_nonzero (t);
@@ -1055,7 +1055,7 @@ ranger_cache::set_global_range (tree name, const vrange &r, bool changed)
   // not include this latest value. PR 100774.
 
   if (r.singleton_p ()
-      || (POINTER_TYPE_P (TREE_TYPE (name)) && r.nonzero_p ()))
+      || (INDIRECT_TYPE_P (TREE_TYPE (name)) && r.nonzero_p ()))
     m_gori.set_range_invariant (name);
   m_temporal->set_timestamp (name);
 }
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index d07246008f0..db28c5223db 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -941,7 +941,7 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src)
   bool loop_info_p = false;
   // If SCEV is available, query if this PHI has any known values.
   if (scev_initialized_p ()
-      && !POINTER_TYPE_P (TREE_TYPE (phi_def)))
+      && !INDIRECT_TYPE_P (TREE_TYPE (phi_def)))
     {
       class loop *l = loop_containing_stmt (phi);
       if (l && loop_outer (l))
diff --git a/gcc/gimple-range-infer.cc b/gcc/gimple-range-infer.cc
index a6f7d4e7991..2d8edfe3fe5 100644
--- a/gcc/gimple-range-infer.cc
+++ b/gcc/gimple-range-infer.cc
@@ -151,7 +151,7 @@ gimple_infer_range::gimple_infer_range (gimple *s)
 		  || bitmap_bit_p (nonnullargs, i))
 		{
 		  tree op = gimple_call_arg (s, i);
-		  if (POINTER_TYPE_P (TREE_TYPE (op)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (op)))
 		    add_nonzero (op);
 		}
 	    }
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index 7438b832b5a..58ab1643f6d 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -301,7 +301,7 @@ path_range_query::range_defined_in_block (vrange &r, tree name, basic_block bb)
 	r.set_varying (TREE_TYPE (name));
     }
 
-  if (bb && POINTER_TYPE_P (TREE_TYPE (name)))
+  if (bb && INDIRECT_TYPE_P (TREE_TYPE (name)))
     m_ranger.m_cache.m_exit.maybe_adjust_range (r, name, bb);
 
   if (DEBUG_SOLVER && (bb || !r.varying_p ()))
@@ -451,7 +451,7 @@ path_range_query::adjust_for_non_null_uses (basic_block bb)
     {
       tree name = ssa_name (i);
 
-      if (!POINTER_TYPE_P (TREE_TYPE (name)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (name)))
 	continue;
 
       if (get_cache (r, name))
diff --git a/gcc/gimple-ssa-isolate-paths.cc b/gcc/gimple-ssa-isolate-paths.cc
index 175598a189c..d5aeb3443e8 100644
--- a/gcc/gimple-ssa-isolate-paths.cc
+++ b/gcc/gimple-ssa-isolate-paths.cc
@@ -268,7 +268,7 @@ stmt_uses_name_in_undefined_way (gimple *use_stmt, tree name, location_t loc)
   /* If we are working with a non pointer type, then see
      if this use is a DIV/MOD operation using NAME as the
      divisor.  */
-  if (!POINTER_TYPE_P (TREE_TYPE (name)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (name)))
     {
       if (!cfun->can_throw_non_call_exceptions)
 	return is_divmod_with_given_divisor (use_stmt, name);
@@ -449,7 +449,7 @@ is_addr_local (gimple *return_stmt, tree exp, locmap_t *plocmap,
       return true;
     }
 
-  if (!POINTER_TYPE_P (TREE_TYPE (exp)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (exp)))
     return false;
 
   if (TREE_CODE (exp) == SSA_NAME)
@@ -460,7 +460,7 @@ is_addr_local (gimple *return_stmt, tree exp, locmap_t *plocmap,
       if (is_gimple_assign (def_stmt))
 	{
 	  tree type = TREE_TYPE (gimple_assign_lhs (def_stmt));
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    {
 	      tree_code code = gimple_assign_rhs_code (def_stmt);
 	      tree ptr1 = NULL_TREE, ptr2 = NULL_TREE;
diff --git a/gcc/gimple-ssa-nonnull-compare.cc b/gcc/gimple-ssa-nonnull-compare.cc
index b7729c3f9ec..8aafc3b09d5 100644
--- a/gcc/gimple-ssa-nonnull-compare.cc
+++ b/gcc/gimple-ssa-nonnull-compare.cc
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 static void
 do_warn_nonnull_compare (function *fun, tree arg)
 {
-  if (!POINTER_TYPE_P (TREE_TYPE (arg))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (arg))
       && TREE_CODE (TREE_TYPE (arg)) != OFFSET_TYPE)
     return;
 
@@ -95,7 +95,7 @@ do_warn_nonnull_compare (function *fun, tree arg)
 	    break;
 	  }
       if (op
-	  && (POINTER_TYPE_P (TREE_TYPE (arg))
+	  && (INDIRECT_TYPE_P (TREE_TYPE (arg))
 	      ? integer_zerop (op) : integer_minus_onep (op))
 	  && !warning_suppressed_p (stmt, OPT_Wnonnull_compare))
 	warning_at (loc, OPT_Wnonnull_compare,
diff --git a/gcc/gimple-ssa-sprintf.cc b/gcc/gimple-ssa-sprintf.cc
index 18975708d2c..8c678235df3 100644
--- a/gcc/gimple-ssa-sprintf.cc
+++ b/gcc/gimple-ssa-sprintf.cc
@@ -2416,7 +2416,7 @@ get_origin_and_offset_r (tree x, HOST_WIDE_INT *fldoff, HOST_WIDE_INT *fldsize,
 	  x = SSA_NAME_VAR (x);
 
 	tree xtype = TREE_TYPE (x);
-	if (POINTER_TYPE_P (xtype))
+	if (INDIRECT_TYPE_P (xtype))
 	  xtype = TREE_TYPE (xtype);
 
 	if (off)
@@ -4373,7 +4373,7 @@ handle_printf_call (gimple_stmt_iterator *gsi, pointer_query &ptr_qry)
       if (idx_format == UINT_MAX
 	  || idx_format >= gimple_call_num_args (info.callstmt)
 	  || idx_args > gimple_call_num_args (info.callstmt)
-	  || !POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (info.callstmt,
+	  || !INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (info.callstmt,
 							  idx_format))))
 	return false;
       info.fncode = BUILT_IN_NONE;
diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc
index 0d19b98ed73..4b6f2233a79 100644
--- a/gcc/gimple-ssa-store-merging.cc
+++ b/gcc/gimple-ssa-store-merging.cc
@@ -333,7 +333,7 @@ init_symbolic_number (struct symbolic_number *n, tree src)
 {
   int size;
 
-  if (!INTEGRAL_TYPE_P (TREE_TYPE (src)) && !POINTER_TYPE_P (TREE_TYPE (src)))
+  if (!INTEGRAL_TYPE_P (TREE_TYPE (src)) && !INDIRECT_TYPE_P (TREE_TYPE (src)))
     return false;
 
   n->base_addr = n->offset = n->alias_set = n->vuse = NULL_TREE;
@@ -1120,11 +1120,11 @@ bswap_view_convert (gimple_stmt_iterator *gsi, tree type, tree val,
 		    bool before)
 {
   gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (val))
-	      || POINTER_TYPE_P (TREE_TYPE (val)));
+	      || INDIRECT_TYPE_P (TREE_TYPE (val)));
   if (TYPE_SIZE (type) != TYPE_SIZE (TREE_TYPE (val)))
     {
       HOST_WIDE_INT prec = TREE_INT_CST_LOW (TYPE_SIZE (type));
-      if (POINTER_TYPE_P (TREE_TYPE (val)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (val)))
 	{
 	  gimple *g
 	    = gimple_build_assign (make_ssa_name (pointer_sized_int_node),
diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-strength-reduction.cc
index 65d6c06b629..83f68298940 100644
--- a/gcc/gimple-ssa-strength-reduction.cc
+++ b/gcc/gimple-ssa-strength-reduction.cc
@@ -1462,7 +1462,7 @@ slsr_process_add (gimple *gs, tree rhs1, tree rhs2, bool speed)
       /* First record an interpretation assuming RHS1 is the base expression
 	 and RHS2 is the stride.  But it doesn't make sense for the
 	 stride to be a pointer, so don't record a candidate in that case.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (rhs2)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (rhs2)))
 	{
 	  c = create_add_ssa_cand (gs, rhs1, rhs2, subtract_p, speed);
 
@@ -1479,7 +1479,7 @@ slsr_process_add (gimple *gs, tree rhs1, tree rhs2, bool speed)
       /* Otherwise, record another interpretation assuming RHS2 is the
 	 base expression and RHS1 is the stride, again provided that the
 	 stride is not a pointer.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (rhs1)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (rhs1)))
 	{
 	  c2 = create_add_ssa_cand (gs, rhs2, rhs1, false, speed);
 	  if (c)
@@ -1756,7 +1756,7 @@ find_candidates_dom_walker::before_dom_children (basic_block bb)
 
       else if (is_gimple_assign (gs)
 	       && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))
-		   || POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))))
+		   || INDIRECT_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))))
 	{
 	  tree rhs1 = NULL_TREE, rhs2 = NULL_TREE;
 
@@ -2293,27 +2293,27 @@ create_add_on_incoming_edge (slsr_cand_t c, tree basis_name,
   /* Occasionally people convert integers to pointers without a 
      cast, leading us into trouble if we aren't careful.  */
   enum tree_code plus_code
-    = POINTER_TYPE_P (basis_type) ? POINTER_PLUS_EXPR : PLUS_EXPR;
+    = INDIRECT_TYPE_P (basis_type) ? POINTER_PLUS_EXPR : PLUS_EXPR;
 
   if (known_stride)
     {
       tree bump_tree;
       enum tree_code code = plus_code;
       widest_int bump = increment * wi::to_widest (c->stride);
-      if (wi::neg_p (bump) && !POINTER_TYPE_P (basis_type))
+      if (wi::neg_p (bump) && !INDIRECT_TYPE_P (basis_type))
 	{
 	  code = MINUS_EXPR;
 	  bump = -bump;
 	}
 
-      tree stride_type = POINTER_TYPE_P (basis_type) ? sizetype : basis_type;
+      tree stride_type = INDIRECT_TYPE_P (basis_type) ? sizetype : basis_type;
       bump_tree = wide_int_to_tree (stride_type, bump);
       new_stmt = gimple_build_assign (lhs, code, basis_name, bump_tree);
     }
   else
     {
       int i;
-      bool negate_incr = !POINTER_TYPE_P (basis_type) && wi::neg_p (increment);
+      bool negate_incr = !INDIRECT_TYPE_P (basis_type) && wi::neg_p (increment);
       i = incr_vec_index (negate_incr ? -increment : increment);
       gcc_assert (i >= 0);
 
@@ -3092,7 +3092,7 @@ analyze_increments (slsr_cand_t first_dep, machine_mode mode, bool speed)
       else if (incr == 0
 	       || incr == 1
 	       || (incr == -1
-		   && !POINTER_TYPE_P (first_dep->cand_type)))
+		   && !INDIRECT_TYPE_P (first_dep->cand_type)))
 	incr_vec[i].cost = COST_NEUTRAL;
 
       /* If we need to add an initializer, give up if a cast from the
@@ -3123,7 +3123,7 @@ analyze_increments (slsr_cand_t first_dep, machine_mode mode, bool speed)
 	 scenarios.  */
       else if (!incr_vec[i].initializer
 	       && TREE_CODE (first_dep->stride) != INTEGER_CST
-	       && POINTER_TYPE_P (first_dep->stride_type))
+	       && INDIRECT_TYPE_P (first_dep->stride_type))
 	incr_vec[i].cost = COST_INFINITE;
 
       /* For any other increment, if this is a multiply candidate, we
@@ -3390,7 +3390,7 @@ insert_initializers (slsr_cand_t c)
       if (!profitable_increment_p (i)
 	  || incr == 1
 	  || (incr == -1
-	      && (!POINTER_TYPE_P (lookup_cand (c->basis)->cand_type)))
+	      && (!INDIRECT_TYPE_P (lookup_cand (c->basis)->cand_type)))
 	  || incr == 0)
 	continue;
 
@@ -3946,7 +3946,7 @@ analyze_candidates_and_replace (void)
 	  /* Determine whether we'll be generating pointer arithmetic
 	     when replacing candidates.  */
 	  address_arithmetic_p = (c->kind == CAND_ADD
-				  && POINTER_TYPE_P (c->cand_type));
+				  && INDIRECT_TYPE_P (c->cand_type));
 
 	  /* If all candidates have already been replaced under other
 	     interpretations, nothing remains to be done.  */
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index ac07a6f9b95..8e21076c9bc 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -1283,7 +1283,7 @@ check_access (GimpleOrTree exp, tree dstwrite,
     {
       /* SRCSTR is normally a pointer to string but as a special case
 	 it can be an integer denoting the length of a string.  */
-      if (POINTER_TYPE_P (TREE_TYPE (srcstr)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (srcstr)))
 	{
 	  if (!check_nul_terminated_array (exp, srcstr, maxread))
 	    /* Return if the array is not nul-terminated and a warning
@@ -3635,7 +3635,7 @@ pass_waccess::check_call_access (gcall *stmt)
 	 operand for later processing.  */
       if (attr_access *access = rdwr_idx.get (i))
 	{
-	  if (POINTER_TYPE_P (TREE_TYPE (arg)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	    {
 	      access->ptr = arg;
 	      /* A nonnull ACCESS->SIZE contains VLA bounds.  */
@@ -4661,7 +4661,7 @@ pass_waccess::check_dangling_uses ()
 	  tree rhs = gimple_assign_rhs1 (def_stmt);
 	  if (TREE_CODE (rhs) == ADDR_EXPR)
 	    {
-	      if (!POINTER_TYPE_P (TREE_TYPE (var)))
+	      if (!INDIRECT_TYPE_P (TREE_TYPE (var)))
 		continue;
 	      check_dangling_uses (var, TREE_OPERAND (rhs, 0));
 	    }
@@ -4675,7 +4675,7 @@ pass_waccess::check_dangling_uses ()
 		check_dangling_uses (var, decl, false, true);
 	    }
 	}
-      else if (POINTER_TYPE_P (TREE_TYPE (var)))
+      else if (INDIRECT_TYPE_P (TREE_TYPE (var)))
 	{
 	  if (gcall *call = dyn_cast<gcall *>(def_stmt))
 	    {
diff --git a/gcc/gimple-ssa-warn-restrict.cc b/gcc/gimple-ssa-warn-restrict.cc
index 56aed519b6d..c0208864515 100644
--- a/gcc/gimple-ssa-warn-restrict.cc
+++ b/gcc/gimple-ssa-warn-restrict.cc
@@ -435,7 +435,7 @@ builtin_memref::set_base_and_offset (tree expr)
 	  if (CONVERT_EXPR_CODE_P (code))
 	    {
 	      tree rhs = gimple_assign_rhs1 (stmt);
-	      if (POINTER_TYPE_P (TREE_TYPE (rhs)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (rhs)))
 		expr = gimple_assign_rhs1 (stmt);
 	      else
 		{
@@ -1047,7 +1047,7 @@ builtin_access::generic_overlap ()
 	 structure.  Give up to avoid excessive false positives.  */
       tree basetype = TREE_TYPE (dstref->base);
 
-      if (POINTER_TYPE_P (basetype))
+      if (INDIRECT_TYPE_P (basetype))
 	basetype = TREE_TYPE (basetype);
       else
 	while (TREE_CODE (basetype) == ARRAY_TYPE)
@@ -1849,7 +1849,7 @@ maybe_diag_access_bounds (gimple *call, tree func, int strict,
     {
       tree refop = TREE_OPERAND (ref.ref, 0);
       tree type = TREE_TYPE (refop);
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	type = TREE_TYPE (type);
       type = TYPE_MAIN_VARIANT (type);
 
diff --git a/gcc/gimple.cc b/gcc/gimple.cc
index 1c1ff796465..d428d973d83 100644
--- a/gcc/gimple.cc
+++ b/gcc/gimple.cc
@@ -411,7 +411,7 @@ gimple_build_call_from_tree (tree t, tree fnptrtype)
 	 to the gimple CALL insn.  */
       if (!fndecl)
 	{
-	  gcc_assert (POINTER_TYPE_P (fnptrtype));
+	  gcc_assert (INDIRECT_TYPE_P (fnptrtype));
 	  tree fntype = TREE_TYPE (fnptrtype);
 
 	  if (lookup_attribute ("nocf_check", TYPE_ATTRIBUTES (fntype)))
@@ -3048,7 +3048,7 @@ infer_nonnull_range_by_dereference (gimple *stmt, tree op)
   /* We can only assume that a pointer dereference will yield
      non-NULL if -fdelete-null-pointer-checks is enabled.  */
   if (!flag_delete_null_pointer_checks
-      || !POINTER_TYPE_P (TREE_TYPE (op))
+      || !INDIRECT_TYPE_P (TREE_TYPE (op))
       || gimple_code (stmt) == GIMPLE_ASM
       || gimple_clobber_p (stmt))
     return false;
@@ -3068,7 +3068,7 @@ infer_nonnull_range_by_attribute (gimple *stmt, tree op)
   /* We can only assume that a pointer dereference will yield
      non-NULL if -fdelete-null-pointer-checks is enabled.  */
   if (!flag_delete_null_pointer_checks
-      || !POINTER_TYPE_P (TREE_TYPE (op))
+      || !INDIRECT_TYPE_P (TREE_TYPE (op))
       || gimple_code (stmt) == GIMPLE_ASM)
     return false;
 
@@ -3091,7 +3091,7 @@ infer_nonnull_range_by_attribute (gimple *stmt, tree op)
 	    {
 	      for (unsigned int i = 0; i < gimple_call_num_args (stmt); i++)
 		{
-		  if (POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (stmt, i)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (stmt, i)))
 		      && operand_equal_p (op, gimple_call_arg (stmt, i), 0))
 		    return true;
 		}
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index b3ff91b3bd2..79899d1c281 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -2952,7 +2952,7 @@ canonicalize_addr_expr (tree *expr_p)
   tree datype, ddatype, pddatype;
 
   /* We simplify only conversions from an ADDR_EXPR to a pointer type.  */
-  if (!POINTER_TYPE_P (TREE_TYPE (expr))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (expr))
       || TREE_CODE (addr_expr) != ADDR_EXPR)
     return;
 
@@ -3423,7 +3423,7 @@ gimplify_self_mod_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
     }
 
   /* For POINTERs increment, use POINTER_PLUS_EXPR.  */
-  if (POINTER_TYPE_P (TREE_TYPE (lhs)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (lhs)))
     {
       rhs = convert_to_ptrofftype_loc (loc, rhs);
       if (arith_code == MINUS_EXPR)
@@ -4786,7 +4786,7 @@ gimplify_init_ctor_preeval_1 (tree *tp, int *walk_subtrees, void *xdata)
       tree type, fntype = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (t)));
 
       for (type = TYPE_ARG_TYPES (fntype); type; type = TREE_CHAIN (type))
-	if (POINTER_TYPE_P (TREE_VALUE (type))
+	if (INDIRECT_TYPE_P (TREE_VALUE (type))
 	    && (!data->lhs_base_decl || TREE_ADDRESSABLE (data->lhs_base_decl))
 	    && alias_sets_conflict_p (data->lhs_alias_set,
 				      get_alias_set
@@ -6117,7 +6117,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
   /* Insert pointer conversions required by the middle-end that are not
      required by the frontend.  This fixes middle-end type checking for
      for example gcc.dg/redecl-6.c.  */
-  if (POINTER_TYPE_P (TREE_TYPE (*to_p)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (*to_p)))
     {
       STRIP_USELESS_TYPE_CONVERSION (*from_p);
       if (!useless_type_conversion_p (TREE_TYPE (*to_p), TREE_TYPE (*from_p)))
@@ -8439,7 +8439,7 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p)
 		       : (begin > end ? (end - begin + (step + 1)) / step : 0)
 		       and compute product of those for the entire depend
 		       clause.  */
-		    if (POINTER_TYPE_P (type))
+		    if (INDIRECT_TYPE_P (type))
 		      endmbegin = fold_build2_loc (loc, POINTER_DIFF_EXPR,
 						   stype, end, begin);
 		    else
@@ -8692,7 +8692,7 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p)
 		    TREE_SIDE_EFFECTS (bind) = 1;
 		    SET_EXPR_LOCATION (bind, loc);
 		    append_to_statement_list_force (bind, p);
-		    if (POINTER_TYPE_P (type))
+		    if (INDIRECT_TYPE_P (type))
 		      tem = build2_loc (loc, POINTER_PLUS_EXPR, type,
 					var, fold_convert_loc (loc, sizetype,
 							       step));
@@ -10397,7 +10397,7 @@ omp_accumulate_sibling_list (enum omp_region_type region_type,
 
       tree sdecl = omp_strip_components_and_deref (base);
 
-      if (POINTER_TYPE_P (TREE_TYPE (sdecl)) && (region_type & ORT_TARGET))
+      if (INDIRECT_TYPE_P (TREE_TYPE (sdecl)) && (region_type & ORT_TARGET))
 	{
 	  tree c2 = build_omp_clause (OMP_CLAUSE_LOCATION (grp_end),
 				      OMP_CLAUSE_MAP);
@@ -11374,7 +11374,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
 		  if (base
 		      && DECL_P (base)
 		      && GOMP_MAP_ALWAYS_P (OMP_CLAUSE_MAP_KIND (c))
-		      && POINTER_TYPE_P (TREE_TYPE (base)))
+		      && INDIRECT_TYPE_P (TREE_TYPE (base)))
 		    {
 		      splay_tree_node n
 			= splay_tree_lookup (ctx->variables,
@@ -14044,7 +14044,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
       decl = TREE_OPERAND (t, 0);
       gcc_assert (DECL_P (decl));
       gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (decl))
-		  || POINTER_TYPE_P (TREE_TYPE (decl)));
+		  || INDIRECT_TYPE_P (TREE_TYPE (decl)));
       if (is_doacross)
 	{
 	  if (TREE_CODE (for_stmt) == OMP_FOR && OMP_FOR_ORIG_DECLS (for_stmt))
@@ -14321,7 +14321,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
 	    tree decl = TREE_OPERAND (t, 0);
 	    /* c_omp_for_incr_canonicalize_ptr() should have been
 	       called to massage things appropriately.  */
-	    gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)));
+	    gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (decl)));
 
 	    if (orig_for_stmt != for_stmt)
 	      break;
@@ -14338,7 +14338,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
 	case POSTDECREMENT_EXPR:
 	  /* c_omp_for_incr_canonicalize_ptr() should have been
 	     called to massage things appropriately.  */
-	  gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)));
+	  gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (decl)));
 	  if (orig_for_stmt != for_stmt)
 	    break;
 	  t = build_int_cst (TREE_TYPE (decl), -1);
@@ -14382,7 +14382,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
 	    {
 	      tree step = TREE_OPERAND (t, 1);
 	      tree stept = TREE_TYPE (decl);
-	      if (POINTER_TYPE_P (stept))
+	      if (INDIRECT_TYPE_P (stept))
 		stept = sizetype;
 	      step = fold_convert (stept, step);
 	      if (TREE_CODE (t) == MINUS_EXPR)
@@ -18043,7 +18043,7 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p,
     return GS_ERROR;
   have_va_type = targetm.canonical_va_list_type (have_va_type);
   if (have_va_type == NULL_TREE
-      && POINTER_TYPE_P (TREE_TYPE (valist)))
+      && INDIRECT_TYPE_P (TREE_TYPE (valist)))
     /* Handle 'Case 1: Not an array type' from c-common.cc/build_va_arg.  */
     have_va_type
       = targetm.canonical_va_list_type (TREE_TYPE (TREE_TYPE (valist)));
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 41ae9f83731..b5c90e1890c 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -2718,7 +2718,7 @@ Gcc_backend::convert_tree(tree type_tree, tree expr_tree, Location location)
     return error_mark_node;
 
   gcc_assert(TREE_CODE(type_tree) == TREE_CODE(TREE_TYPE(expr_tree)));
-  if (POINTER_TYPE_P(type_tree)
+  if (INDIRECT_TYPE_P(type_tree)
       || INTEGRAL_TYPE_P(type_tree)
       || SCALAR_FLOAT_TYPE_P(type_tree)
       || COMPLEX_FLOAT_TYPE_P(type_tree))
diff --git a/gcc/godump.cc b/gcc/godump.cc
index 0893d5fbc97..1d3dba4807a 100644
--- a/gcc/godump.cc
+++ b/gcc/godump.cc
@@ -693,7 +693,7 @@ go_format_type (class godump_container *container, tree type,
   if (use_type_name
       && TYPE_NAME (type) != NULL_TREE
       && (AGGREGATE_TYPE_P (type)
-	  || POINTER_TYPE_P (type)
+	  || INDIRECT_TYPE_P (type)
 	  || TREE_CODE (type) == FUNCTION_TYPE))
     {
       tree name;
@@ -947,7 +947,7 @@ go_format_type (class godump_container *container, tree type,
 		   pointer.  */
 		if (TYPE_NAME (TREE_TYPE (field)) != NULL_TREE
 		    && (RECORD_OR_UNION_TYPE_P (TREE_TYPE (field))
-			|| (POINTER_TYPE_P (TREE_TYPE (field))
+			|| (INDIRECT_TYPE_P (TREE_TYPE (field))
 			    && (TREE_CODE (TREE_TYPE (TREE_TYPE (field)))
 				== FUNCTION_TYPE))))
 		  {
diff --git a/gcc/graphite-isl-ast-to-gimple.cc b/gcc/graphite-isl-ast-to-gimple.cc
index 6c0d6f9b498..a18ce72fbab 100644
--- a/gcc/graphite-isl-ast-to-gimple.cc
+++ b/gcc/graphite-isl-ast-to-gimple.cc
@@ -258,8 +258,8 @@ gcc_expression_from_isl_ast_expr_id (tree type,
   tree t = *tp;
   if (useless_type_conversion_p (type, TREE_TYPE (t)))
     return t;
-  if (POINTER_TYPE_P (TREE_TYPE (t))
-      && !POINTER_TYPE_P (type) && !ptrofftype_p (type))
+  if (INDIRECT_TYPE_P (TREE_TYPE (t))
+      && !INDIRECT_TYPE_P (type) && !ptrofftype_p (type))
     t = fold_convert (sizetype, t);
   return fold_convert (type, t);
 }
@@ -724,13 +724,13 @@ translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node,
     ;
   else
     {
-      tree one = build_one_cst (POINTER_TYPE_P (type) ? sizetype : type);
+      tree one = build_one_cst (INDIRECT_TYPE_P (type) ? sizetype : type);
       /* Adding +1 and using LT_EXPR helps with loop latches that have a
 	 loop iteration count of "PARAMETER - 1".  For PARAMETER == 0 this
 	 becomes 2^k-1 due to integer overflow, and the condition lb <= ub
 	 is true, even if we do not want this.  However lb < ub + 1 is false,
 	 as expected.  */
-      tree ub_one = fold_build2 (POINTER_TYPE_P (type)
+      tree ub_one = fold_build2 (INDIRECT_TYPE_P (type)
 				 ? POINTER_PLUS_EXPR : PLUS_EXPR,
 				 type, unshare_expr (ub), one);
       create_empty_if_region_on_edge (next_e,
diff --git a/gcc/graphite-sese-to-poly.cc b/gcc/graphite-sese-to-poly.cc
index fbe7667380a..94264bd4aaf 100644
--- a/gcc/graphite-sese-to-poly.cc
+++ b/gcc/graphite-sese-to-poly.cc
@@ -422,7 +422,7 @@ add_param_constraints (scop_p scop, graphite_dim_t p, tree parameter)
   value_range r;
   wide_int min, max;
 
-  gcc_assert (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type));
+  gcc_assert (INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type));
 
   if (INTEGRAL_TYPE_P (type)
       && get_range_query (cfun)->range_of_expr (r, parameter)
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 071c607fbe8..74c0e227913 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -2687,7 +2687,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
      transform for these cases.  Similarly, we can have bad type mismatches
      with LTO, avoid doing anything with those too.  */
   if (!parm_type
-      || (!INTEGRAL_TYPE_P (parm_type) && !POINTER_TYPE_P (parm_type)))
+      || (!INTEGRAL_TYPE_P (parm_type) && !INDIRECT_TYPE_P (parm_type)))
     {
       if (dump_file && (dump_flags & TDF_DETAILS))
 	fprintf (dump_file, "Setting dest_lattice to bottom, because type of "
@@ -2772,7 +2772,7 @@ propagate_vr_across_jump_function (cgraph_edge *cs, ipa_jump_func *jfunc,
 
   if (!param_type
       || (!INTEGRAL_TYPE_P (param_type)
-	  && !POINTER_TYPE_P (param_type)))
+	  && !INDIRECT_TYPE_P (param_type)))
     return dest_lat->set_to_bottom ();
 
   if (jfunc->type == IPA_JF_PASS_THROUGH)
diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc
index 87529be4515..66971434666 100644
--- a/gcc/ipa-devirt.cc
+++ b/gcc/ipa-devirt.cc
@@ -417,7 +417,7 @@ static tree
 compound_type_base (const_tree t)
 {
   if (TREE_CODE (t) == ARRAY_TYPE
-      || POINTER_TYPE_P (t)
+      || INDIRECT_TYPE_P (t)
       || TREE_CODE (t) == COMPLEX_TYPE
       || VECTOR_TYPE_P (t))
     return TREE_TYPE (t);
@@ -1123,7 +1123,7 @@ warn_types_mismatch (tree t1, tree t2, location_t loc1, location_t loc2)
 		  return;
 		}
 	    }
-	  if ((POINTER_TYPE_P (t1) || TREE_CODE (t1) == ARRAY_TYPE)
+	  if ((INDIRECT_TYPE_P (t1) || TREE_CODE (t1) == ARRAY_TYPE)
 	      && type_mismatch_p (TREE_TYPE (t1), TREE_TYPE (t2)))
 	    warn_types_mismatch (TREE_TYPE (t1), TREE_TYPE (t2), loc_t1, loc_t2);
 	  else if (TREE_CODE (t1) == METHOD_TYPE
@@ -1255,7 +1255,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
       || VECTOR_TYPE_P (t1)
       || TREE_CODE (t1) == COMPLEX_TYPE
       || TREE_CODE (t1) == OFFSET_TYPE
-      || POINTER_TYPE_P (t1))
+      || INDIRECT_TYPE_P (t1))
     {
       if (TYPE_PRECISION (t1) != TYPE_PRECISION (t2))
 	{
@@ -1286,7 +1286,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
 	 so we cannot compare pointed-to types.  But we can, for now,
 	 require the same pointed-to type kind and match what
 	 useless_type_conversion_p would do.  */
-      if (POINTER_TYPE_P (t1))
+      if (INDIRECT_TYPE_P (t1))
 	{
 	  if (TYPE_ADDR_SPACE (TREE_TYPE (t1))
 	      != TYPE_ADDR_SPACE (TREE_TYPE (t2)))
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 1a2417e8592..89ced41b09f 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -242,7 +242,7 @@ fld_incomplete_type_of (tree t, class free_lang_data_d *fld)
 {
   if (!t)
     return NULL;
-  if (POINTER_TYPE_P (t))
+  if (INDIRECT_TYPE_P (t))
     {
       tree t2 = fld_incomplete_type_of (TREE_TYPE (t), fld);
       if (t2 != TREE_TYPE (t))
@@ -340,7 +340,7 @@ fld_simplified_type (tree t, class free_lang_data_d *fld)
 {
   if (!t)
     return t;
-  if (POINTER_TYPE_P (t))
+  if (INDIRECT_TYPE_P (t))
     return fld_incomplete_type_of (t, fld);
   /* FIXME: This triggers verification error, see PR88140.  */
 #if 0
@@ -773,7 +773,7 @@ find_decls_types_r (tree *tp, int *ws, void *data)
 	fld_worklist_push (TYPE_NEXT_PTR_TO (t), fld);
       if (TYPE_REF_P (t))
 	fld_worklist_push (TYPE_NEXT_REF_TO (t), fld);
-      if (!POINTER_TYPE_P (t))
+      if (!INDIRECT_TYPE_P (t))
 	fld_worklist_push (TYPE_MIN_VALUE_RAW (t), fld);
       /* TYPE_MAX_VALUE_RAW is TYPE_BINFO for record types.  */
       if (!RECORD_OR_UNION_TYPE_P (t))
diff --git a/gcc/ipa-icf-gimple.cc b/gcc/ipa-icf-gimple.cc
index f4180c0fa81..f06f1dc234f 100644
--- a/gcc/ipa-icf-gimple.cc
+++ b/gcc/ipa-icf-gimple.cc
@@ -193,7 +193,7 @@ func_checker::compatible_polymorphic_types_p (tree t1, tree t2,
   gcc_assert (TREE_CODE (t1) != FUNCTION_TYPE && TREE_CODE (t1) != METHOD_TYPE);
 
   /* Pointer types generally give no information.  */
-  if (POINTER_TYPE_P (t1))
+  if (INDIRECT_TYPE_P (t1))
     {
       if (!compare_ptr)
 	return true;
diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
index 836d0914ded..97687c14945 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -515,12 +515,12 @@ sem_function::compatible_parm_types_p (tree parm1, tree parm2)
   if (!func_checker::compatible_types_p (parm1, parm2))
     return return_false_with_msg ("parameter type is not compatible");
 
-  if (POINTER_TYPE_P (parm1)
+  if (INDIRECT_TYPE_P (parm1)
       && (TYPE_RESTRICT (parm1) != TYPE_RESTRICT (parm2)))
     return return_false_with_msg ("argument restrict flag mismatch");
 
   /* nonnull_arg_p implies non-zero range to REFERENCE types.  */
-  if (POINTER_TYPE_P (parm1)
+  if (INDIRECT_TYPE_P (parm1)
       && TREE_CODE (parm1) != TREE_CODE (parm2)
       && opt_for_fn (decl, flag_delete_null_pointer_checks))
     return return_false_with_msg ("pointer wrt reference mismatch");
@@ -3501,7 +3501,7 @@ sem_item_optimizer::fixup_points_to_sets (void)
 	continue;
 
       FOR_EACH_SSA_NAME (i, name, fn)
-	if (POINTER_TYPE_P (TREE_TYPE (name))
+	if (INDIRECT_TYPE_P (TREE_TYPE (name))
 	    && SSA_NAME_PTR_INFO (name))
 	  fixup_pt_set (&SSA_NAME_PTR_INFO (name)->pt);
       fixup_pt_set (&fn->gimple_df->escaped);
diff --git a/gcc/ipa-modref-tree.cc b/gcc/ipa-modref-tree.cc
index de89d879bf4..047055c111d 100644
--- a/gcc/ipa-modref-tree.cc
+++ b/gcc/ipa-modref-tree.cc
@@ -695,7 +695,7 @@ modref_access_node::get_ao_ref (const gcall *stmt, ao_ref *ref) const
 
   if (!parm_offset_known
       || !(arg = get_call_arg (stmt))
-      || !POINTER_TYPE_P (TREE_TYPE (arg)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (arg)))
     return false;
   poly_offset_int off = (poly_offset_int)offset
 	+ ((poly_offset_int)parm_offset << LOG2_BITS_PER_UNIT);
diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 278b2dbd828..74a6ee06c94 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -1515,7 +1515,7 @@ modref_access_analysis::process_fnspec (gcall *call)
   else
     {
       for (unsigned int i = 0; i < gimple_call_num_args (call); i++)
-	if (!POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, i))))
+	if (!INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, i))))
 	  ;
 	else if (!fnspec.arg_specified_p (i)
 		 || fnspec.arg_maybe_read_p (i))
@@ -1552,7 +1552,7 @@ modref_access_analysis::process_fnspec (gcall *call)
   else
     {
       for (unsigned int i = 0; i < gimple_call_num_args (call); i++)
-	if (!POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, i))))
+	if (!INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, i))))
 	  ;
 	else if (!fnspec.arg_specified_p (i)
 		 || fnspec.arg_maybe_written_p (i))
@@ -4551,7 +4551,7 @@ propagate_unknown_call (cgraph_node *node,
 	  tree t = TYPE_ARG_TYPES (TREE_TYPE (e->callee->decl));
 	  for (unsigned i = 0; i < parm_map.length () && t;
 	       i++, t = TREE_CHAIN (t))
-	    if (!POINTER_TYPE_P (TREE_VALUE (t)))
+	    if (!INDIRECT_TYPE_P (TREE_VALUE (t)))
 	      ;
 	  else if (!fnspec.arg_specified_p (i)
 		   || fnspec.arg_maybe_read_p (i))
@@ -4583,7 +4583,7 @@ propagate_unknown_call (cgraph_node *node,
 	  tree t = TYPE_ARG_TYPES (TREE_TYPE (e->callee->decl));
 	  for (unsigned i = 0; i < parm_map.length () && t;
 	       i++, t = TREE_CHAIN (t))
-	    if (!POINTER_TYPE_P (TREE_VALUE (t)))
+	    if (!INDIRECT_TYPE_P (TREE_VALUE (t)))
 	      ;
 	  else if (!fnspec.arg_specified_p (i)
 		   || fnspec.arg_maybe_written_p (i))
diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index a286af7f5d9..6b0dc851e23 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -719,7 +719,7 @@ ipa_param_adjustments::modify_call (cgraph_edge *cs,
 	{
 	  /* Detect type mismatches in calls in invalid programs and make a
 	     poor attempt to gracefully convert them so that we don't ICE.  */
-	  if (!POINTER_TYPE_P (TREE_TYPE (base)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (base)))
 	    base = force_value_to_type (ptr_type_node, base);
 
 	  off = build_int_cst (apm->alias_ptr_type, apm->unit_offset);
@@ -2131,7 +2131,7 @@ ipa_param_body_adjustments::modify_call_stmt (gcall **stmt_p,
 	{
 	  /* This must be a by_reference pass-through.  */
 	  recreate = true;
-	  gcc_assert (POINTER_TYPE_P (TREE_TYPE (t)));
+	  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (t)));
 	  pass_through_args.safe_push (i);
 	  pass_through_pbr_indices.safe_push (first_rep_index);
 	  pass_through_offsets.safe_push (agg_arg_offset);
diff --git a/gcc/ipa-polymorphic-call.cc b/gcc/ipa-polymorphic-call.cc
index a79d39c824b..74e82c913c8 100644
--- a/gcc/ipa-polymorphic-call.cc
+++ b/gcc/ipa-polymorphic-call.cc
@@ -279,7 +279,7 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree otr_type,
 
 	      /* Do not consider vptr itself.  Not even for placement new.  */
 	      if (!pos && DECL_ARTIFICIAL (fld)
-		  && POINTER_TYPE_P (TREE_TYPE (fld))
+		  && INDIRECT_TYPE_P (TREE_TYPE (fld))
 		  && TYPE_BINFO (type)
 		  && polymorphic_type_binfo_p (TYPE_BINFO (type)))
 		continue;
@@ -1112,7 +1112,7 @@ ipa_polymorphic_call_context::ipa_polymorphic_call_context (tree fndecl,
     base_type = TREE_TYPE (gimple_assign_rhs1
 			    (SSA_NAME_DEF_STMT (base_pointer)));
  
-  if (base_type && POINTER_TYPE_P (base_type))
+  if (base_type && INDIRECT_TYPE_P (base_type))
     combine_speculation_with (TYPE_MAIN_VARIANT (TREE_TYPE (base_type)),
 			      offset,
 			      true, NULL /* Do not change type here */);
@@ -1171,7 +1171,7 @@ noncall_stmt_may_be_vtbl_ptr_store (gimple *stmt)
       if (!AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
 	{
 	  if (flag_strict_aliasing
-	      && !POINTER_TYPE_P (TREE_TYPE (lhs)))
+	      && !INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	    return false;
 
 	  if (TREE_CODE (lhs) == COMPONENT_REF
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index 5d790ff1265..cf9ba5e6508 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -794,7 +794,7 @@ stmt_may_be_vtbl_ptr_store (gimple *stmt)
       if (!AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
 	{
 	  if (flag_strict_aliasing
-	      && !POINTER_TYPE_P (TREE_TYPE (lhs)))
+	      && !INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	    return false;
 
 	  if (TREE_CODE (lhs) == COMPONENT_REF
@@ -974,7 +974,7 @@ detect_type_change_ssa (ipa_func_body_info *fbi, tree arg, tree comp_type,
 {
   gcc_checking_assert (TREE_CODE (arg) == SSA_NAME);
   if (!flag_devirtualize
-      || !POINTER_TYPE_P (TREE_TYPE (arg)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (arg)))
     return false;
 
   if (!param_type_may_change_p (current_function_decl, arg, call))
@@ -1163,7 +1163,7 @@ parm_ref_data_pass_through_p (struct ipa_func_body_info *fbi, int index,
      function because it is not goin to use it.  But do not cache the result
      either.  Also, no such calculations for non-pointers.  */
   if (!gimple_vuse (call)
-      || !POINTER_TYPE_P (TREE_TYPE (parm)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (parm)))
     return false;
 
   struct ipa_param_aa_status *paa = parm_bb_aa_status_for_bb (fbi,
@@ -1553,7 +1553,7 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
 
   /* Dynamic types are changed in constructors and destructors.  */
   index = ipa_get_param_decl_index (info, SSA_NAME_VAR (ssa));
-  if (index >= 0 && param_type && POINTER_TYPE_P (param_type))
+  if (index >= 0 && param_type && INDIRECT_TYPE_P (param_type))
     ipa_set_ancestor_jf (jfunc, offset,  index,
 			 parm_ref_data_pass_through_p (fbi, index, call, ssa),
 			 false);
@@ -1648,7 +1648,7 @@ compute_complex_ancestor_jump_func (struct ipa_func_body_info *fbi,
     return;
   if (TREE_CODE (tmp) != SSA_NAME
       || SSA_NAME_IS_DEFAULT_DEF (tmp)
-      || !POINTER_TYPE_P (TREE_TYPE (tmp))
+      || !INDIRECT_TYPE_P (TREE_TYPE (tmp))
       || TREE_CODE (TREE_TYPE (TREE_TYPE (tmp))) != RECORD_TYPE)
     return;
 
@@ -1699,7 +1699,7 @@ type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
     return false;
 
   fld = TYPE_FIELDS (type);
-  if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld))
+  if (!fld || !INDIRECT_TYPE_P (TREE_TYPE (fld))
       || TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE
       || !tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
     return false;
@@ -2107,14 +2107,14 @@ determine_known_aggregate_parts (struct ipa_func_body_info *fbi,
      arg_base and arg_offset based on what is actually passed as an actual
      argument.  */
 
-  if (POINTER_TYPE_P (arg_type))
+  if (INDIRECT_TYPE_P (arg_type))
     {
       by_ref = true;
       if (TREE_CODE (arg) == SSA_NAME)
 	{
 	  tree type_size;
           if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type)))
-	      || !POINTER_TYPE_P (TREE_TYPE (arg)))
+	      || !INDIRECT_TYPE_P (TREE_TYPE (arg)))
             return;
 	  check_ref = true;
 	  arg_base = arg;
@@ -2365,7 +2365,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
       struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, n);
       tree arg = gimple_call_arg (call, n);
       tree param_type = ipa_get_callee_param_type (cs, n);
-      if (flag_devirtualize && POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (flag_devirtualize && INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	{
 	  tree instance;
 	  class ipa_polymorphic_call_context context (cs->caller->decl,
@@ -2379,7 +2379,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
 	}
 
       Value_Range vr (TREE_TYPE (arg));
-      if (POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	{
 	  bool addr_nonzero = false;
 	  bool strict_overflow = false;
@@ -2432,7 +2432,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
 	  else
 	    ipa_set_jfunc_bits (jfunc, wi::to_widest (arg), 0);
 	}
-      else if (POINTER_TYPE_P (TREE_TYPE (arg)))
+      else if (INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	{
 	  unsigned HOST_WIDE_INT bitpos;
 	  unsigned align;
@@ -2506,7 +2506,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
 	  && (jfunc->type != IPA_JF_ANCESTOR
 	      || !ipa_get_jf_ancestor_agg_preserved (jfunc))
 	  && (AGGREGATE_TYPE_P (TREE_TYPE (arg))
-	      || POINTER_TYPE_P (param_type)))
+	      || INDIRECT_TYPE_P (param_type)))
 	determine_known_aggregate_parts (fbi, call, arg, param_type, jfunc);
     }
   if (!useful_context)
@@ -2724,7 +2724,7 @@ ipa_analyze_indirect_call_uses (struct ipa_func_body_info *fbi, gcall *call,
      pointer. */
   if (gimple_code (def) != GIMPLE_PHI
       || gimple_phi_num_args (def) != 2
-      || !POINTER_TYPE_P (TREE_TYPE (target))
+      || !INDIRECT_TYPE_P (TREE_TYPE (target))
       || TREE_CODE (TREE_TYPE (TREE_TYPE (target))) != METHOD_TYPE)
     return;
 
@@ -5834,7 +5834,7 @@ ipcp_update_bits (struct cgraph_node *node, ipcp_transformation *ts)
 
       if (!bits[i]
 	  || !(INTEGRAL_TYPE_P (TREE_TYPE (parm))
-	       || POINTER_TYPE_P (TREE_TYPE (parm)))
+	       || INDIRECT_TYPE_P (TREE_TYPE (parm)))
 	  || !is_gimple_reg (parm))
 	continue;
 
diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index e203d8941ff..f11091c7d39 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -1203,7 +1203,7 @@ create_parameter_descriptors (cgraph_node *node,
 	  desc->call_uses = scalar_call_uses;
 	}
 
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	{
 	  desc->by_ref = true;
 	  if (TYPE_REF_P (type)
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index 8b7294e32cc..e1f375a7fde 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -233,7 +233,7 @@ handle_malloc_attribute (tree *node, tree ARG_UNUSED (name),
 			 bool * ARG_UNUSED (no_add_attrs))
 {
   if (TREE_CODE (*node) == FUNCTION_DECL
-      && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
+      && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
     DECL_IS_MALLOC (*node) = 1;
   else
     gcc_unreachable ();
diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc
index 5ffa8954022..f788f6af5fb 100644
--- a/gcc/lto-streamer-out.cc
+++ b/gcc/lto-streamer-out.cc
@@ -1081,7 +1081,7 @@ DFS::DFS_write_tree_body (struct output_block *ob,
       else if (FUNC_OR_METHOD_TYPE_P (expr))
 	DFS_follow_tree_edge (TYPE_ARG_TYPES (expr));
 
-      if (!POINTER_TYPE_P (expr))
+      if (!INDIRECT_TYPE_P (expr))
 	DFS_follow_tree_edge (TYPE_MIN_VALUE_RAW (expr));
       DFS_follow_tree_edge (TYPE_MAX_VALUE_RAW (expr));
     }
@@ -1494,7 +1494,7 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map<tree, hashval_t> *map,
       else if (code == FUNCTION_TYPE
 	       || code == METHOD_TYPE)
 	visit (TYPE_ARG_TYPES (t));
-      if (!POINTER_TYPE_P (t))
+      if (!INDIRECT_TYPE_P (t))
 	visit (TYPE_MIN_VALUE_RAW (t));
       visit (TYPE_MAX_VALUE_RAW (t));
     }
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc
index 207a5d4f926..4b748ced87f 100644
--- a/gcc/lto/lto-common.cc
+++ b/gcc/lto/lto-common.cc
@@ -261,7 +261,7 @@ hash_canonical_type (tree type)
       || SCALAR_FLOAT_TYPE_P (type)
       || FIXED_POINT_TYPE_P (type)
       || TREE_CODE (type) == OFFSET_TYPE
-      || POINTER_TYPE_P (type))
+      || INDIRECT_TYPE_P (type))
     {
       hstate.add_int (TYPE_PRECISION (type));
       if (!type_with_interoperable_signedness (type))
@@ -284,7 +284,7 @@ hash_canonical_type (tree type)
   /* Fortran standard define C_PTR type that is compatible with every
      C pointer.  For this reason we need to glob all pointers into one.
      Still pointers in different address spaces are not compatible.  */
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     hstate.add_int (TYPE_ADDR_SPACE (TREE_TYPE (type)));
 
   /* For array types hash the domain bounds and the string flag.  */
@@ -542,7 +542,7 @@ lto_register_canonical_types (tree node, bool first_p)
   if (first_p)
     TYPE_CANONICAL (node) = NULL_TREE;
 
-  if (POINTER_TYPE_P (node)
+  if (INDIRECT_TYPE_P (node)
       || TREE_CODE (node) == COMPLEX_TYPE
       || TREE_CODE (node) == ARRAY_TYPE)
     lto_register_canonical_types (TREE_TYPE (node), first_p);
@@ -1531,7 +1531,7 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map)
 	       || code == METHOD_TYPE)
 	compare_tree_edges (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2));
 
-      if (!POINTER_TYPE_P (t1))
+      if (!INDIRECT_TYPE_P (t1))
 	compare_tree_edges (TYPE_MIN_VALUE_RAW (t1), TYPE_MIN_VALUE_RAW (t2));
       compare_tree_edges (TYPE_MAX_VALUE_RAW (t1), TYPE_MAX_VALUE_RAW (t2));
     }
diff --git a/gcc/lto/lto-lang.cc b/gcc/lto/lto-lang.cc
index 14d419c2013..9a7e3509fe1 100644
--- a/gcc/lto/lto-lang.cc
+++ b/gcc/lto/lto-lang.cc
@@ -336,7 +336,7 @@ handle_malloc_attribute (tree *node, tree ARG_UNUSED (name),
 			 bool * ARG_UNUSED (no_add_attrs))
 {
   if (TREE_CODE (*node) == FUNCTION_DECL
-      && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
+      && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (*node))))
     DECL_IS_MALLOC (*node) = 1;
   else
     gcc_unreachable ();
diff --git a/gcc/lto/lto-symtab.cc b/gcc/lto/lto-symtab.cc
index 79ba8ddde20..24b591f89ef 100644
--- a/gcc/lto/lto-symtab.cc
+++ b/gcc/lto/lto-symtab.cc
@@ -291,7 +291,7 @@ warn_type_compatibility_p (tree prevailing_type, tree type,
 	      t1 = TREE_TYPE (t1);
 	      t2 = TREE_TYPE (t2);
 	    }
-	  if ((!POINTER_TYPE_P (t1) || !POINTER_TYPE_P (t2))
+	  if ((!INDIRECT_TYPE_P (t1) || !INDIRECT_TYPE_P (t2))
 	      || (set1 != TYPE_ALIAS_SET (ptr_type_node)
 		  && set2 != TYPE_ALIAS_SET (ptr_type_node)))
 	    lev |= 5;
diff --git a/gcc/m2/gm2-gcc/m2expr.cc b/gcc/m2/gm2-gcc/m2expr.cc
index 8021eb00671..5f054964f60 100644
--- a/gcc/m2/gm2-gcc/m2expr.cc
+++ b/gcc/m2/gm2-gcc/m2expr.cc
@@ -2550,13 +2550,13 @@ m2expr_build_binary_op_check (location_t location, enum tree_code code,
 
   if (code == PLUS_EXPR)
     {
-      if (POINTER_TYPE_P (type1))
+      if (INDIRECT_TYPE_P (type1))
         {
           op2 = fold_convert_loc (location, sizetype, unshare_expr (op2));
           return fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (op1),
                                   op1, op2);
         }
-      else if (POINTER_TYPE_P (type2))
+      else if (INDIRECT_TYPE_P (type2))
         {
           op1 = fold_convert_loc (location, sizetype, unshare_expr (op1));
           return fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (op2),
@@ -2565,14 +2565,14 @@ m2expr_build_binary_op_check (location_t location, enum tree_code code,
     }
   if (code == MINUS_EXPR)
     {
-      if (POINTER_TYPE_P (type1))
+      if (INDIRECT_TYPE_P (type1))
         {
           op2 = fold_convert_loc (location, sizetype, unshare_expr (op2));
           op2 = fold_build1_loc (location, NEGATE_EXPR, sizetype, op2);
           return fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (op1),
                                   op1, op2);
         }
-      else if (POINTER_TYPE_P (type2))
+      else if (INDIRECT_TYPE_P (type2))
         {
           op2 = fold_convert_loc (location, sizetype, unshare_expr (op2));
           op2 = fold_build1_loc (location, NEGATE_EXPR, sizetype, op2);
@@ -2625,8 +2625,8 @@ m2expr_BuildAddAddress (location_t location, tree op1, tree op2)
   type2 = m2tree_skip_type_decl (TREE_TYPE (op2));
 
   m2assert_AssertLocation (location);
-  ASSERT_CONDITION (POINTER_TYPE_P (type1));
-  ASSERT_CONDITION (!POINTER_TYPE_P (type2));
+  ASSERT_CONDITION (INDIRECT_TYPE_P (type1));
+  ASSERT_CONDITION (!INDIRECT_TYPE_P (type2));
 
   op2 = fold_convert_loc (location, sizetype, unshare_expr (op2));
   return fold_build2_loc (location, POINTER_PLUS_EXPR, TREE_TYPE (op1),
diff --git a/gcc/match.pd b/gcc/match.pd
index 5f7627c8d5e..ca71167e082 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1867,7 +1867,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	 && (int_fits_type_p (@1, TREE_TYPE (@0))
 	     || tree_nop_conversion_p (TREE_TYPE (@0), type)))
 	|| types_match (@0, @1))
-       && !POINTER_TYPE_P (TREE_TYPE (@0))
+       && !INDIRECT_TYPE_P (TREE_TYPE (@0))
        && !VECTOR_TYPE_P (TREE_TYPE (@0))
        && TREE_CODE (TREE_TYPE (@0)) != OFFSET_TYPE
        /* ???  This transform conflicts with fold-const.cc doing
@@ -1907,7 +1907,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        && TREE_CODE (@1) != INTEGER_CST
        && tree_nop_conversion_p (type, TREE_TYPE (@2))
        && types_match (type, @0)
-       && !POINTER_TYPE_P (TREE_TYPE (@0))
+       && !INDIRECT_TYPE_P (TREE_TYPE (@0))
        && TREE_CODE (TREE_TYPE (@0)) != OFFSET_TYPE)
    (bitop @0 (convert @1)))))
 
@@ -2493,7 +2493,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  INTEGER_CST@0)
 (match with_possible_nonzero_bits
  SSA_NAME@0
- (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0)))))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || INDIRECT_TYPE_P (TREE_TYPE (@0)))))
 /* Slightly extended version, do not make it recursive to keep it cheap.  */
 (match (with_possible_nonzero_bits2 @0)
  with_possible_nonzero_bits@0)
@@ -2660,7 +2660,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 /* Canonicalize (T *)(ptr - ptr-cst) to &MEM[ptr + -ptr-cst].  */
 (simplify
  (convert (pointer_diff @0 INTEGER_CST@1))
- (if (POINTER_TYPE_P (type))
+ (if (INDIRECT_TYPE_P (type))
   { build_fold_addr_expr_with_type
       (build2 (MEM_REF, char_type_node, @0,
 	       wide_int_to_tree (ptr_type_node, wi::neg (wi::to_wide (@1)))),
@@ -2671,7 +2671,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
    alignment.  */
 (simplify
  (bit_and (convert? @0) INTEGER_CST@1)
- (if (POINTER_TYPE_P (TREE_TYPE (@0))
+ (if (INDIRECT_TYPE_P (TREE_TYPE (@0))
       && tree_nop_conversion_p (type, TREE_TYPE (@0)))
   (with
    {
@@ -3204,7 +3204,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	   final type requires a sign- or zero-extension,
 	   then we have to punt - it is not defined which
 	   one is correct.  */
-	|| (POINTER_TYPE_P (TREE_TYPE (@0))
+	|| (INDIRECT_TYPE_P (TREE_TYPE (@0))
 	    && TREE_CODE (@1) == INTEGER_CST
 	    && tree_int_cst_sign_bit (@1) == 0))
     (convert @1)))
@@ -3260,7 +3260,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	    final type requires a sign- or zero-extension,
 	    then we have to punt - it is not defined which
 	    one is correct.  */
-	 || (POINTER_TYPE_P (TREE_TYPE (@0))
+	 || (INDIRECT_TYPE_P (TREE_TYPE (@0))
 	     && TREE_CODE (@1) == INTEGER_CST
 	     && tree_int_cst_sign_bit (@1) == 0))
      (negate (convert @1)))))
@@ -3312,7 +3312,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	    final type requires a sign- or zero-extension,
 	    then we have to punt - it is not defined which
 	    one is correct.  */
-	 || (POINTER_TYPE_P (TREE_TYPE (@0))
+	 || (INDIRECT_TYPE_P (TREE_TYPE (@0))
 	     && TREE_CODE (@1) == INTEGER_CST
 	     && tree_int_cst_sign_bit (@1) == 0
 	     && TREE_CODE (@2) == INTEGER_CST
@@ -4120,8 +4120,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
    conversions use a NOP_EXPR instead.  */
 (simplify
   (view_convert @0)
-  (if ((INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
-       && (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0)))
+  (if ((INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type))
+       && (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || INDIRECT_TYPE_P (TREE_TYPE (@0)))
        && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)))
    (convert @0)))
 
@@ -4129,8 +4129,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
    zero-extend while keeping the same size (for bool-to-char).  */
 (simplify
   (view_convert (convert@0 @1))
-  (if ((INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0)))
-       && (INTEGRAL_TYPE_P (TREE_TYPE (@1)) || POINTER_TYPE_P (TREE_TYPE (@1)))
+  (if ((INTEGRAL_TYPE_P (TREE_TYPE (@0)) || INDIRECT_TYPE_P (TREE_TYPE (@0)))
+       && (INTEGRAL_TYPE_P (TREE_TYPE (@1)) || INDIRECT_TYPE_P (TREE_TYPE (@1)))
        && TYPE_SIZE (TREE_TYPE (@0)) == TYPE_SIZE (TREE_TYPE (@1))
        && (TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (TREE_TYPE (@1))
 	   || (TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (TREE_TYPE (@1))
@@ -4172,19 +4172,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
       tree inside_type = TREE_TYPE (@0);
       tree inter_type = TREE_TYPE (@1);
       int inside_int = INTEGRAL_TYPE_P (inside_type);
-      int inside_ptr = POINTER_TYPE_P (inside_type);
+      int inside_ptr = INDIRECT_TYPE_P (inside_type);
       int inside_float = FLOAT_TYPE_P (inside_type);
       int inside_vec = VECTOR_TYPE_P (inside_type);
       unsigned int inside_prec = element_precision (inside_type);
       int inside_unsignedp = TYPE_UNSIGNED (inside_type);
       int inter_int = INTEGRAL_TYPE_P (inter_type);
-      int inter_ptr = POINTER_TYPE_P (inter_type);
+      int inter_ptr = INDIRECT_TYPE_P (inter_type);
       int inter_float = FLOAT_TYPE_P (inter_type);
       int inter_vec = VECTOR_TYPE_P (inter_type);
       unsigned int inter_prec = element_precision (inter_type);
       int inter_unsignedp = TYPE_UNSIGNED (inter_type);
       int final_int = INTEGRAL_TYPE_P (type);
-      int final_ptr = POINTER_TYPE_P (type);
+      int final_ptr = INDIRECT_TYPE_P (type);
       int final_float = FLOAT_TYPE_P (type);
       int final_vec = VECTOR_TYPE_P (type);
       unsigned int final_prec = element_precision (type);
@@ -5985,9 +5985,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        /* Disable this optimization if we're casting a function pointer
 	  type on targets that require function pointer canonicalization.  */
        && !(targetm.have_canonicalize_funcptr_for_compare ()
-	    && ((POINTER_TYPE_P (TREE_TYPE (@00))
+	    && ((INDIRECT_TYPE_P (TREE_TYPE (@00))
 		 && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@00))))
-		|| (POINTER_TYPE_P (TREE_TYPE (@10))
+		|| (INDIRECT_TYPE_P (TREE_TYPE (@10))
 		    && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@10))))))
        && single_use (@0))
    (if (TYPE_PRECISION (TREE_TYPE (@00)) == TYPE_PRECISION (TREE_TYPE (@0))
@@ -5996,7 +5996,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	&& (TYPE_UNSIGNED (TREE_TYPE (@00)) == TYPE_UNSIGNED (TREE_TYPE (@0))
 	    || cmp == NE_EXPR
 	    || cmp == EQ_EXPR)
-	&& !POINTER_TYPE_P (TREE_TYPE (@00))
+	&& !INDIRECT_TYPE_P (TREE_TYPE (@00))
 	/* (int)bool:32 != (int)uint is not the same as
 	   bool:32 != (bool:32)uint since boolean types only have two valid
 	   values independent of their precision.  */
@@ -6241,7 +6241,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (cond
   (ne (bit_and @0 integer_pow2p@1) integer_zerop)
   INTEGER_CST@2 integer_zerop)
- (if (!POINTER_TYPE_P (type) && integer_pow2p (@2))
+ (if (!INDIRECT_TYPE_P (type) && integer_pow2p (@2))
   (with {
      int shift = (wi::exact_log2 (wi::to_wide (@2))
 		  - wi::exact_log2 (wi::to_wide (@1)));
@@ -6324,7 +6324,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (for neeq (ne eq)
  (simplify
   (neeq @0 @1)
-  (if (POINTER_TYPE_P (TREE_TYPE (@0))
+  (if (INDIRECT_TYPE_P (TREE_TYPE (@0))
        && ptrs_compare_unequal (@0, @1))
    { constant_boolean_node (neeq != EQ_EXPR, type); })))
 
@@ -6337,7 +6337,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (for cmp (ne eq)
  (simplify
   (cmp (convert @0) INTEGER_CST@1)
-  (if (((POINTER_TYPE_P (TREE_TYPE (@0))
+  (if (((INDIRECT_TYPE_P (TREE_TYPE (@0))
 	 && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@0)))
 	 && INTEGRAL_TYPE_P (TREE_TYPE (@1))
 	 /* Don't perform this optimization in GENERIC if @0 has reference
@@ -6346,7 +6346,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 	      && TYPE_REF_P (TREE_TYPE (@0))
 	      && (flag_sanitize & (SANITIZE_NULL | SANITIZE_ALIGNMENT))))
 	|| (INTEGRAL_TYPE_P (TREE_TYPE (@0))
-	    && POINTER_TYPE_P (TREE_TYPE (@1))
+	    && INDIRECT_TYPE_P (TREE_TYPE (@1))
 	    && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@1)))))
        && TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (TREE_TYPE (@1)))
    (cmp @0 (convert @1)))))
@@ -6358,7 +6358,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (simplify
   (cmp (convert?@2 @0) uniform_integer_cst_p@1)
   (if ((INTEGRAL_TYPE_P (TREE_TYPE (@1))
-	|| POINTER_TYPE_P (TREE_TYPE (@1))
+	|| INDIRECT_TYPE_P (TREE_TYPE (@1))
 	|| VECTOR_INTEGER_TYPE_P (TREE_TYPE (@1)))
        && tree_nop_conversion_p (TREE_TYPE (@2), TREE_TYPE (@0)))
    (with
diff --git a/gcc/objc/objc-act.cc b/gcc/objc/objc-act.cc
index 528a4ae812a..6d01b442f8d 100644
--- a/gcc/objc/objc-act.cc
+++ b/gcc/objc/objc-act.cc
@@ -1316,12 +1316,12 @@ objc_add_property_declaration (location_t location, tree decl,
   /* FIXME: We seem to drop any existing DECL_ATTRIBUTES on the floor.  */
   if (property_nullability != OBJC_PROPERTY_NULL_UNSET)
     {
-      if (p_type && !POINTER_TYPE_P (p_type))
+      if (p_type && !INDIRECT_TYPE_P (p_type))
 	error_at (decl_loc, "nullability specifier %qE cannot be applied to"
 		  " non-pointer type %qT",
 		  attrs[OBJC_PROPATTR_GROUP_NULLABLE]->name, p_type);
-      else if (p_type && POINTER_TYPE_P (p_type) && TREE_TYPE (p_type)
-	       && POINTER_TYPE_P (TREE_TYPE (p_type)))
+      else if (p_type && INDIRECT_TYPE_P (p_type) && TREE_TYPE (p_type)
+	       && INDIRECT_TYPE_P (TREE_TYPE (p_type)))
 	error_at (decl_loc, "nullability specifier %qE cannot be applied to"
 		  " multi-level pointer type %qT",
 		  attrs[OBJC_PROPATTR_GROUP_NULLABLE]->name, p_type);
@@ -2485,7 +2485,7 @@ objc_common_type (tree type1, tree type2)
 {
   tree inner1 = TREE_TYPE (type1), inner2 = TREE_TYPE (type2);
 
-  while (POINTER_TYPE_P (inner1))
+  while (INDIRECT_TYPE_P (inner1))
     {
       inner1 = TREE_TYPE (inner1);
       inner2 = TREE_TYPE (inner2);
@@ -2533,7 +2533,7 @@ objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee)
   bool pointers_compatible;
 
   /* We must be dealing with pointer types */
-  if (!POINTER_TYPE_P (ltyp) || !POINTER_TYPE_P (rtyp))
+  if (!INDIRECT_TYPE_P (ltyp) || !INDIRECT_TYPE_P (rtyp))
     return false;
 
   tree ltyp_attr, rtyp_attr;
@@ -2546,7 +2546,7 @@ objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee)
       rtyp_attr = TYPE_ATTRIBUTES (rtyp);
       rtyp = TREE_TYPE (rtyp);
     }
-  while (POINTER_TYPE_P (ltyp) && POINTER_TYPE_P (rtyp));
+  while (INDIRECT_TYPE_P (ltyp) && INDIRECT_TYPE_P (rtyp));
 
   /* We must also handle function pointers, since ObjC is a bit more
      lenient than C or C++ on this.  */
@@ -2760,7 +2760,7 @@ objc_have_common_type (tree ltyp, tree rtyp, int argno, tree callee)
           ltyp = TREE_TYPE (ltyp);  /* Remove indirections.  */
           rtyp = TREE_TYPE (rtyp);
         }
-      while (POINTER_TYPE_P (ltyp) && POINTER_TYPE_P (rtyp));
+      while (INDIRECT_TYPE_P (ltyp) && INDIRECT_TYPE_P (rtyp));
       return !(TREE_CODE (ltyp) == FUNCTION_TYPE && TREE_CODE (rtyp) == FUNCTION_TYPE);
     }
   return false;
@@ -3649,7 +3649,7 @@ objc_is_object_ptr (tree type)
   tree ret;
 
   type = TYPE_MAIN_VARIANT (type);
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return 0;
 
   ret = objc_is_id (type);
@@ -3824,7 +3824,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
 
 	  /* Descend down the cast chain, and record the first objc_gc
 	     attribute found.  */
-	  if (POINTER_TYPE_P (lhstype))
+	  if (INDIRECT_TYPE_P (lhstype))
 	    {
 	      tree attr
 		= lookup_attribute ("objc_gc",
@@ -4375,7 +4375,7 @@ objc_begin_catch_clause (tree decl)
       error ("%<@catch%> parameter cannot be protocol-qualified");
       type = error_mark_node;
     }
-  else if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+  else if (INDIRECT_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
     /* @catch (id xyz) or @catch (...) but we note this for runtimes that
        identify 'id'.  */
     ;
@@ -8768,7 +8768,7 @@ comp_proto_with_proto (tree proto1, tree proto2, int strict)
 static bool
 objc_type_valid_for_messaging (tree type, bool accept_classes)
 {
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return false;
 
   /* We will check for an NSObject type attribute  on the pointer if other
@@ -9116,7 +9116,7 @@ gen_declaration (tree decl)
 
       if (DECL_NAME (decl))
 	{
-	  if (!POINTER_TYPE_P (TREE_TYPE (decl)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (decl)))
 	    strcat (errbuf, " ");
 
 	  strcat (errbuf, IDENTIFIER_POINTER (DECL_NAME (decl)));
@@ -9149,7 +9149,7 @@ gen_type_name_0 (tree type)
 
   if (TYPE_P (type) && TYPE_NAME (type))
     type = TYPE_NAME (type);
-  else if (POINTER_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
+  else if (INDIRECT_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
     {
       tree inner = TREE_TYPE (type);
 
@@ -9158,10 +9158,10 @@ gen_type_name_0 (tree type)
 
       gen_type_name_0 (inner);
 
-      if (!POINTER_TYPE_P (inner))
+      if (!INDIRECT_TYPE_P (inner))
 	strcat (errbuf, " ");
 
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	strcat (errbuf, "*");
       else
 	while (type != inner)
diff --git a/gcc/objc/objc-encoding.cc b/gcc/objc/objc-encoding.cc
index 9edd6246f36..6e00613b1dd 100644
--- a/gcc/objc/objc-encoding.cc
+++ b/gcc/objc/objc-encoding.cc
@@ -242,7 +242,7 @@ encode_type_qualifiers (tree declspecs)
 static bool
 pointee_is_readonly (tree pointee)
 {
-  while (POINTER_TYPE_P (pointee))
+  while (INDIRECT_TYPE_P (pointee))
     pointee = TREE_TYPE (pointee);
 
   return TYPE_READONLY (pointee);
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.cc b/gcc/objc/objc-gnu-runtime-abi-01.cc
index fbf8307297a..1dec525e5d0 100644
--- a/gcc/objc/objc-gnu-runtime-abi-01.cc
+++ b/gcc/objc/objc-gnu-runtime-abi-01.cc
@@ -2144,12 +2144,12 @@ objc_eh_runtime_type (tree type)
       goto make_err_class;
     }
 
-  if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+  if (INDIRECT_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
     /* We don't want to identify 'id' for GNU. Instead, build a 0
        entry in the exceptions table.  */
     return null_pointer_node;
 
-  if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+  if (!INDIRECT_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
     {
 #ifdef OBJCPLUS
       /* This routine is also called for c++ catch clauses; in which case,
diff --git a/gcc/objc/objc-next-runtime-abi-01.cc b/gcc/objc/objc-next-runtime-abi-01.cc
index 70ab5262e17..cf46d2ddc61 100644
--- a/gcc/objc/objc-next-runtime-abi-01.cc
+++ b/gcc/objc/objc-next-runtime-abi-01.cc
@@ -2803,13 +2803,13 @@ objc_eh_runtime_type (tree type)
       goto make_err_class;
     }
 
-  if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+  if (INDIRECT_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
     {
       ident = get_identifier ("id");
       goto make_err_class;
     }
 
-  if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+  if (!INDIRECT_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
     {
 #ifdef OBJCPLUS
       /* This routine is also called for c++'s catch clause; in which case,
diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc
index 6548c0078e0..517bab6f460 100644
--- a/gcc/objc/objc-next-runtime-abi-02.cc
+++ b/gcc/objc/objc-next-runtime-abi-02.cc
@@ -3797,7 +3797,7 @@ next_runtime_02_eh_type (tree type)
       /*|| errorcount || sorrycount*/)
     goto err_mark_in;
 
-  if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+  if (INDIRECT_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
     {
       if (!next_v2_EHTYPE_id_decl)
 	{
@@ -3812,7 +3812,7 @@ next_runtime_02_eh_type (tree type)
       return build_fold_addr_expr (next_v2_EHTYPE_id_decl);
     }
 
-  if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+  if (!INDIRECT_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
     {
 #ifdef OBJCPLUS
       /* This routine is also called for c++'s catch clause; in which
@@ -3906,7 +3906,7 @@ static tree begin_catch (struct objc_try_context **cur_try_context, tree type,
 
       /* We might want to build a catch object for this (if it's not
 	 id).  */
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  && !objc_is_object_id (TREE_TYPE (type))
 	  && TYPED_OBJECT (TREE_TYPE (type)))
 	objc_v2_add_to_ehtype_list (OBJC_TYPE_NAME (TREE_TYPE (type)));
diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc
index db58b3cb49b..69e2b5d0a21 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -353,7 +353,7 @@ determine_parallel_type (struct omp_region *region)
 	      || omp_find_clause (clauses, OMP_CLAUSE_ORDERED)
 	      || omp_find_clause (clauses, OMP_CLAUSE__REDUCTEMP_)
 	      || ((c = omp_find_clause (clauses, OMP_CLAUSE__CONDTEMP_))
-		  && POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c)))))
+		  && INDIRECT_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c)))))
 	    return;
 	}
       else if (region->inner->type == GIMPLE_OMP_SECTIONS
@@ -1573,7 +1573,7 @@ expand_oacc_collapse_init (const struct omp_for_data *fd,
 
       gcc_assert (loop->cond_code == LT_EXPR || loop->cond_code == GT_EXPR);
 
-      if (POINTER_TYPE_P (iter_type))
+      if (INDIRECT_TYPE_P (iter_type))
 	plus_type = sizetype;
 
       if (tiling)
@@ -1679,7 +1679,7 @@ expand_oacc_collapse_vars (const struct omp_for_data *fd, bool inner,
       enum tree_code plus_code = PLUS_EXPR;
       tree expr;
 
-      if (POINTER_TYPE_P (iter_type))
+      if (INDIRECT_TYPE_P (iter_type))
 	{
 	  plus_code = POINTER_PLUS_EXPR;
 	  plus_type = sizetype;
@@ -1928,7 +1928,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	  *gsi = gsi_last_nondebug_bb (entry_bb);
 	}
 
-      if (POINTER_TYPE_P (itype))
+      if (INDIRECT_TYPE_P (itype))
 	itype = signed_type_for (itype);
       t = build_int_cst (itype, (fd->loops[i].cond_code == LT_EXPR
 				 ? -1 : 1));
@@ -1989,7 +1989,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	  break;
       if (i == fd->last_nonrect
 	  && fd->loops[i].outer == fd->last_nonrect - fd->first_nonrect
-	  && !POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v))
+	  && !INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v))
 	  && !TYPE_UNSIGNED (TREE_TYPE (fd->loops[i].v)))
 	{
 	  int o = fd->first_nonrect;
@@ -2263,7 +2263,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      t = fold_convert (itype, unshare_expr (fd->loops[i].n1));
 	      if (fd->loops[i].m1 == NULL_TREE)
 		n1 = t;
-	      else if (POINTER_TYPE_P (itype))
+	      else if (INDIRECT_TYPE_P (itype))
 		{
 		  gcc_assert (integer_onep (fd->loops[i].m1));
 		  t = unshare_expr (fd->loops[i].n1);
@@ -2286,7 +2286,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      t = fold_convert (itype, unshare_expr (fd->loops[i].n2));
 	      if (fd->loops[i].m2 == NULL_TREE)
 		n2 = t;
-	      else if (POINTER_TYPE_P (itype))
+	      else if (INDIRECT_TYPE_P (itype))
 		{
 		  gcc_assert (integer_onep (fd->loops[i].m2));
 		  t = unshare_expr (fd->loops[i].n2);
@@ -2301,7 +2301,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 		}
 	      n2 = force_gimple_operand_gsi (&gsi2, n2, true, NULL_TREE,
 					     true, GSI_SAME_STMT);
-	      if (POINTER_TYPE_P (itype))
+	      if (INDIRECT_TYPE_P (itype))
 		itype = signed_type_for (itype);
 	      if (i == fd->last_nonrect)
 		{
@@ -2349,7 +2349,7 @@ expand_omp_for_init_counts (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      gsi2 = gsi_after_labels (e->dest);
 	      tree step = fold_convert (itype,
 					unshare_expr (fd->loops[i].step));
-	      if (POINTER_TYPE_P (TREE_TYPE (vs[i])))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (vs[i])))
 		t = fold_build_pointer_plus (vs[i], step);
 	      else
 		t = fold_build2 (PLUS_EXPR, itype, vs[i], step);
@@ -2534,7 +2534,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
     {
       tree vtype = TREE_TYPE (fd->loops[i].v), itype, t;
       itype = vtype;
-      if (POINTER_TYPE_P (vtype))
+      if (INDIRECT_TYPE_P (vtype))
 	itype = signed_type_for (vtype);
       if (i != 0 && (i != fd->last_nonrect || fd->first_nonrect))
 	t = fold_build2 (TRUNC_MOD_EXPR, type, tem, counts[i]);
@@ -2787,7 +2787,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      t = fold_convert (itype, unshare_expr (fd->loops[j].n1));
 	      if (fd->loops[j].m1 == NULL_TREE)
 		n1 = rect_p ? build_zero_cst (type) : t;
-	      else if (POINTER_TYPE_P (itype))
+	      else if (INDIRECT_TYPE_P (itype))
 		{
 		  gcc_assert (integer_onep (fd->loops[j].m1));
 		  t = unshare_expr (fd->loops[j].n1);
@@ -2810,7 +2810,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	      t = fold_convert (itype, unshare_expr (fd->loops[j].n2));
 	      if (fd->loops[j].m2 == NULL_TREE)
 		n2 = rect_p ? counts[j] : t;
-	      else if (POINTER_TYPE_P (itype))
+	      else if (INDIRECT_TYPE_P (itype))
 		{
 		  gcc_assert (integer_onep (fd->loops[j].m2));
 		  t = unshare_expr (fd->loops[j].n2);
@@ -2825,7 +2825,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 		}
 	      n2 = force_gimple_operand_gsi (&gsi2, n2, true, NULL_TREE,
 					     true, GSI_SAME_STMT);
-	      if (POINTER_TYPE_P (itype))
+	      if (INDIRECT_TYPE_P (itype))
 		itype = signed_type_for (itype);
 	      if (j == fd->last_nonrect)
 		{
@@ -2888,7 +2888,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 		{
 		  tree step
 		    = fold_convert (itype, unshare_expr (fd->loops[j].step));
-		  if (POINTER_TYPE_P (vtype))
+		  if (INDIRECT_TYPE_P (vtype))
 		    t = fold_build_pointer_plus (vs[j], step);
 		  else
 		    t = fold_build2 (PLUS_EXPR, itype, vs[j], step);
@@ -2939,7 +2939,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	    {
 	      tree vtype = TREE_TYPE (fd->loops[j].v);
 	      tree itype = vtype;
-	      if (POINTER_TYPE_P (itype))
+	      if (INDIRECT_TYPE_P (itype))
 		itype = signed_type_for (itype);
 	      bool rect_p = (fd->loops[j].m1 == NULL_TREE
 			     && fd->loops[j].m2 == NULL_TREE
@@ -2951,7 +2951,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 		  tree t2
 		    = fold_convert (itype, unshare_expr (fd->loops[j].step));
 		  t = fold_build2 (MULT_EXPR, itype, t, t2);
-		  if (POINTER_TYPE_P (vtype))
+		  if (INDIRECT_TYPE_P (vtype))
 		    t = fold_build_pointer_plus (n1, t);
 		  else
 		    t = fold_build2 (PLUS_EXPR, itype, n1, t);
@@ -2961,7 +2961,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 		  t = fold_convert (itype, vs[j]);
 		  t = fold_build2 (MULT_EXPR, itype, t,
 				   fold_convert (itype, fd->loops[j].step));
-		  if (POINTER_TYPE_P (vtype))
+		  if (INDIRECT_TYPE_P (vtype))
 		    t = fold_build_pointer_plus (fd->loops[j].n1, t);
 		  else
 		    t = fold_build2 (PLUS_EXPR, itype, fd->loops[j].n1, t);
@@ -2993,7 +2993,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	  t = fold_convert (itype, t);
 	  t = fold_build2 (MULT_EXPR, itype, t,
 			   fold_convert (itype, fd->loops[i].step));
-	  if (POINTER_TYPE_P (vtype))
+	  if (INDIRECT_TYPE_P (vtype))
 	    t = fold_build_pointer_plus (fd->loops[i].n1, t);
 	  else
 	    t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
@@ -3023,7 +3023,7 @@ expand_omp_for_init_vars (struct omp_for_data *fd, gimple_stmt_iterator *gsi,
 	  tree itype = TREE_TYPE (fd->loops[i].v);
 
 	  tree t;
-	  if (POINTER_TYPE_P (itype))
+	  if (INDIRECT_TYPE_P (itype))
 	    {
 	      gcc_assert (integer_onep (fd->loops[i].m2));
 	      t = fold_build_pointer_plus (fd->loops[i - fd->loops[i].outer].v,
@@ -3118,7 +3118,7 @@ extract_omp_for_update_vars (struct omp_for_data *fd, tree *nonrect_bounds,
 	      t = l->n1;
 	      if (l->m1)
 		{
-		  if (POINTER_TYPE_P (TREE_TYPE (l->v)))
+		  if (INDIRECT_TYPE_P (TREE_TYPE (l->v)))
 		    t = fold_build_pointer_plus (fd->loops[i + 1 - l->outer].v,
 						 t);
 		  else
@@ -3143,7 +3143,7 @@ extract_omp_for_update_vars (struct omp_for_data *fd, tree *nonrect_bounds,
 
       set_immediate_dominator (CDI_DOMINATORS, bb, last_bb);
 
-      if (POINTER_TYPE_P (vtype))
+      if (INDIRECT_TYPE_P (vtype))
 	t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
       else
 	t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v, fd->loops[i].step);
@@ -3175,7 +3175,7 @@ extract_omp_for_update_vars (struct omp_for_data *fd, tree *nonrect_bounds,
 		  }
 		if (l->m1)
 		  {
-		    if (POINTER_TYPE_P (TREE_TYPE (l->v)))
+		    if (INDIRECT_TYPE_P (TREE_TYPE (l->v)))
 		      t = fold_build_pointer_plus (fd->loops[i].v, l->n1);
 		    else
 		      {
@@ -3197,7 +3197,7 @@ extract_omp_for_update_vars (struct omp_for_data *fd, tree *nonrect_bounds,
 						 GSI_CONTINUE_LINKING);
 		if (l->m2)
 		  {
-		    if (POINTER_TYPE_P (TREE_TYPE (l->v)))
+		    if (INDIRECT_TYPE_P (TREE_TYPE (l->v)))
 		      t = fold_build_pointer_plus (fd->loops[i].v, l->n2);
 		    else
 		      {
@@ -3443,7 +3443,7 @@ expand_omp_ordered_sink (gimple_stmt_iterator *gsi, struct omp_for_data *fd,
       tree itype = TREE_TYPE (fd->loops[i].v);
       tree step = NULL_TREE;
       tree orig_off = NULL_TREE;
-      if (POINTER_TYPE_P (itype))
+      if (INDIRECT_TYPE_P (itype))
 	itype = sizetype;
       if (i)
 	deps = TREE_CHAIN (deps);
@@ -3454,7 +3454,7 @@ expand_omp_ordered_sink (gimple_stmt_iterator *gsi, struct omp_for_data *fd,
 	  off = TREE_OPERAND (off, 0);
 	  gcc_assert (fd->loops[i].cond_code == LT_EXPR
 		      && integer_onep (fd->loops[i].step)
-		      && !POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v)));
+		      && !INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v)));
 	}
       tree s = fold_convert_loc (loc, itype, step ? step : fd->loops[i].step);
       if (step)
@@ -3470,7 +3470,7 @@ expand_omp_ordered_sink (gimple_stmt_iterator *gsi, struct omp_for_data *fd,
 	{
 	  tree a;
 	  tree co = fold_convert_loc (loc, itype, off);
-	  if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v)))
 	    {
 	      if (OMP_CLAUSE_DOACROSS_SINK_NEGATIVE (deps))
 		co = fold_build1_loc (loc, NEGATE_EXPR, itype, co);
@@ -3637,7 +3637,7 @@ expand_omp_ordered_source_sink (struct omp_region *region,
       counts[i] = NULL_TREE;
     else if (i >= fd->collapse && !cont_bb)
       counts[i] = build_zero_cst (fd->iter_type);
-    else if (!POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v))
+    else if (!INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v))
 	     && integer_onep (fd->loops[i].step))
       counts[i] = NULL_TREE;
     else
@@ -3725,7 +3725,7 @@ expand_omp_for_ordered_loops (struct omp_for_data *fd, tree *counts,
       if (EDGE_COUNT (cont_bb->preds) > 0)
 	{
 	  gsi = gsi_last_bb (cont_bb);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, fd->loops[i].v,
@@ -4168,7 +4168,7 @@ expand_omp_for_generic (struct omp_region *region,
 	      gcc_assert (innerc);
 	      t1 = OMP_CLAUSE_DECL (innerc);
 	    }
-	  if (POINTER_TYPE_P (TREE_TYPE (t0))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (t0))
 	      && TYPE_PRECISION (TREE_TYPE (t0))
 		 != TYPE_PRECISION (fd->iter_type))
 	    {
@@ -4310,7 +4310,7 @@ expand_omp_for_generic (struct omp_region *region,
     t = fold_build2 (MINUS_EXPR, fd->iter_type, t, bias);
   if (fd->ordered && fd->collapse == 1)
     {
-      if (POINTER_TYPE_P (TREE_TYPE (startvar)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (startvar)))
 	t = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (startvar),
 			 fd->loop.n1, fold_convert (sizetype, t));
       else
@@ -4322,7 +4322,7 @@ expand_omp_for_generic (struct omp_region *region,
     }
   else
     {
-      if (POINTER_TYPE_P (TREE_TYPE (startvar)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (startvar)))
 	t = fold_convert (signed_type_for (TREE_TYPE (startvar)), t);
       t = fold_convert (TREE_TYPE (startvar), t);
     }
@@ -4343,7 +4343,7 @@ expand_omp_for_generic (struct omp_region *region,
 	 incremented by 1.  */
       if ((fd->ordered && fd->collapse == 1)
 	  || bias
-	  || POINTER_TYPE_P (type)
+	  || INDIRECT_TYPE_P (type)
 	  || TREE_CODE (fd->loop.n1) != INTEGER_CST
 	  || fd->loop.cond_code != LT_EXPR)
 	t = fold_build2 (PLUS_EXPR, itype, fold_convert (itype, istart0),
@@ -4370,7 +4370,7 @@ expand_omp_for_generic (struct omp_region *region,
     t = fold_build2 (MINUS_EXPR, fd->iter_type, t, bias);
   if (fd->ordered && fd->collapse == 1)
     {
-      if (POINTER_TYPE_P (TREE_TYPE (startvar)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (startvar)))
 	t = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (startvar),
 			 fd->loop.n1, fold_convert (sizetype, t));
       else
@@ -4382,7 +4382,7 @@ expand_omp_for_generic (struct omp_region *region,
     }
   else
     {
-      if (POINTER_TYPE_P (TREE_TYPE (startvar)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (startvar)))
 	t = fold_convert (signed_type_for (TREE_TYPE (startvar)), t);
       t = fold_convert (TREE_TYPE (startvar), t);
     }
@@ -4411,7 +4411,7 @@ expand_omp_for_generic (struct omp_region *region,
 	  if (omp_privatize_by_reference (t))
 	    t = build_simple_mem_ref_loc (OMP_CLAUSE_LOCATION (c), t);
 	  tree type = TREE_TYPE (t);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    type = sizetype;
 	  dest = unshare_expr (t);
 	  tree v = create_tmp_var (TREE_TYPE (t), NULL);
@@ -4420,7 +4420,7 @@ expand_omp_for_generic (struct omp_region *region,
 	    {
 	      itercnt = startvar;
 	      tree n1 = fd->loop.n1;
-	      if (POINTER_TYPE_P (TREE_TYPE (itercnt)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (itercnt)))
 		{
 		  itercnt
 		    = fold_convert (signed_type_for (TREE_TYPE (itercnt)),
@@ -4555,7 +4555,7 @@ expand_omp_for_generic (struct omp_region *region,
 	  tree t2;
 	  if ((fd->ordered && fd->collapse == 1)
 	       || bias
-	       || POINTER_TYPE_P (type)
+	       || INDIRECT_TYPE_P (type)
 	       || TREE_CODE (fd->loop.n1) != INTEGER_CST
 	       || fd->loop.cond_code != LT_EXPR)
 	    t2 = build_int_cst (itype, 1);
@@ -4570,7 +4570,7 @@ expand_omp_for_generic (struct omp_region *region,
 
       if (!gimple_omp_for_combined_p (fd->for_stmt))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (vmain, fd->loop.step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
@@ -4963,7 +4963,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
   tree cond_var = NULL_TREE, condtemp = NULL_TREE;
 
   itype = type = TREE_TYPE (fd->loop.v);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     itype = signed_type_for (type);
 
   entry_bb = region->entry;
@@ -5337,10 +5337,10 @@ expand_omp_for_static_nochunk (struct omp_region *region,
     }
   t = fold_convert (itype, s0);
   t = fold_build2 (MULT_EXPR, itype, t, step);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       t = fold_build_pointer_plus (n1, t);
-      if (!POINTER_TYPE_P (TREE_TYPE (startvar))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (startvar))
 	  && TYPE_PRECISION (TREE_TYPE (startvar)) > TYPE_PRECISION (type))
 	t = fold_convert (signed_type_for (type), t);
     }
@@ -5362,7 +5362,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
 	 itself, use that, or startvar + constant (those would be
 	 incremented with step), and as last resort use the s0 + 1
 	 incremented by 1.  */
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  || TREE_CODE (n1) != INTEGER_CST
 	  || fd->loop.cond_code != LT_EXPR)
 	t = fold_build2 (PLUS_EXPR, itype, fold_convert (itype, s0),
@@ -5383,10 +5383,10 @@ expand_omp_for_static_nochunk (struct omp_region *region,
 
   t = fold_convert (itype, e0);
   t = fold_build2 (MULT_EXPR, itype, t, step);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       t = fold_build_pointer_plus (n1, t);
-      if (!POINTER_TYPE_P (TREE_TYPE (startvar))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (startvar))
 	  && TYPE_PRECISION (TREE_TYPE (startvar)) > TYPE_PRECISION (type))
 	t = fold_convert (signed_type_for (type), t);
     }
@@ -5435,7 +5435,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
 		itercnt = s0;
 	    }
 	  tree type = TREE_TYPE (t);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    type = sizetype;
 	  a = fold_build2 (MULT_EXPR, type,
 			   fold_convert (type, itercnt),
@@ -5472,7 +5472,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
 	{
 	  tree itype = TREE_TYPE (cond_var);
 	  tree t2;
-	  if (POINTER_TYPE_P (type)
+	  if (INDIRECT_TYPE_P (type)
 	      || TREE_CODE (n1) != INTEGER_CST
 	      || fd->loop.cond_code != LT_EXPR)
 	    t2 = build_int_cst (itype, 1);
@@ -5487,7 +5487,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
 
       if (!gimple_omp_for_combined_p (fd->for_stmt))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (vmain, step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, vmain, step);
@@ -5750,7 +5750,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
   tree cond_var = NULL_TREE, condtemp = NULL_TREE;
 
   itype = type = TREE_TYPE (fd->loop.v);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     itype = signed_type_for (type);
 
   entry_bb = region->entry;
@@ -5973,7 +5973,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
 
   t = fold_build2 (MULT_EXPR, itype, threadid, chunk_size);
   t = fold_build2 (MULT_EXPR, itype, t, step);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     t = fold_build_pointer_plus (n1, t);
   else
     t = fold_build2 (PLUS_EXPR, type, t, n1);
@@ -6040,10 +6040,10 @@ expand_omp_for_static_chunk (struct omp_region *region,
 
   t = fold_convert (itype, s0);
   t = fold_build2 (MULT_EXPR, itype, t, step);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       t = fold_build_pointer_plus (n1, t);
-      if (!POINTER_TYPE_P (TREE_TYPE (startvar))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (startvar))
 	  && TYPE_PRECISION (TREE_TYPE (startvar)) > TYPE_PRECISION (type))
 	t = fold_convert (signed_type_for (type), t);
     }
@@ -6065,7 +6065,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
 	 itself, use that, or startvar + constant (those would be
 	 incremented with step), and as last resort use the s0 + 1
 	 incremented by 1.  */
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  || TREE_CODE (n1) != INTEGER_CST
 	  || fd->loop.cond_code != LT_EXPR)
 	t = fold_build2 (PLUS_EXPR, itype, fold_convert (itype, s0),
@@ -6086,10 +6086,10 @@ expand_omp_for_static_chunk (struct omp_region *region,
 
   t = fold_convert (itype, e0);
   t = fold_build2 (MULT_EXPR, itype, t, step);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       t = fold_build_pointer_plus (n1, t);
-      if (!POINTER_TYPE_P (TREE_TYPE (startvar))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (startvar))
 	  && TYPE_PRECISION (TREE_TYPE (startvar)) > TYPE_PRECISION (type))
 	t = fold_convert (signed_type_for (type), t);
     }
@@ -6121,7 +6121,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
 	  if (omp_privatize_by_reference (t))
 	    t = build_simple_mem_ref_loc (OMP_CLAUSE_LOCATION (c), t);
 	  tree type = TREE_TYPE (t);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    type = sizetype;
 	  dest = unshare_expr (t);
 	  tree v = create_tmp_var (TREE_TYPE (t), NULL);
@@ -6172,7 +6172,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
 	{
 	  tree itype = TREE_TYPE (cond_var);
 	  tree t2;
-	  if (POINTER_TYPE_P (type)
+	  if (INDIRECT_TYPE_P (type)
 	      || TREE_CODE (n1) != INTEGER_CST
 	      || fd->loop.cond_code != LT_EXPR)
 	    t2 = build_int_cst (itype, 1);
@@ -6187,7 +6187,7 @@ expand_omp_for_static_chunk (struct omp_region *region,
 
       if (!gimple_omp_for_combined_p (fd->for_stmt))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (vmain, step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, vmain, step);
@@ -6549,7 +6549,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
       tree offset = fold_build2 (MULT_EXPR, TREE_TYPE (step), step,
 				 fold_convert (TREE_TYPE (step), simt_lane));
       n1 = fold_convert (type, n1);
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	n1 = fold_build_pointer_plus (n1, offset);
       else
 	n1 = fold_build2 (PLUS_EXPR, type, n1, fold_convert (type, offset));
@@ -6602,7 +6602,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	  n2var = create_tmp_var (type);
 	  i = fd->collapse - 1;
 	  tree itype = TREE_TYPE (fd->loops[i].v);
-	  if (POINTER_TYPE_P (itype))
+	  if (INDIRECT_TYPE_P (itype))
 	    itype = signed_type_for (itype);
 	  t = build_int_cst (itype, (fd->loops[i].cond_code == LT_EXPR
 				     ? -1 : 1));
@@ -6693,7 +6693,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
       altv = create_tmp_var (unsigned_type_for (TREE_TYPE (fd->loops[0].v)));
       expand_omp_build_assign (&gsi, altv, build_zero_cst (TREE_TYPE (altv)));
       tree itype = TREE_TYPE (fd->loop.v);
-      if (POINTER_TYPE_P (itype))
+      if (INDIRECT_TYPE_P (itype))
 	itype = signed_type_for (itype);
       t = build_int_cst (itype, (fd->loop.cond_code == LT_EXPR ? -1 : 1));
       t = fold_build2 (PLUS_EXPR, itype,
@@ -6730,7 +6730,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
     }
   if (cond_var)
     {
-      if (POINTER_TYPE_P (type)
+      if (INDIRECT_TYPE_P (type)
 	  || TREE_CODE (n1) != INTEGER_CST
 	  || fd->loop.cond_code != LT_EXPR
 	  || tree_int_cst_sgn (n1) != 1)
@@ -6754,7 +6754,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
       if (fd->collapse == 1
 	  || gimple_omp_for_combined_into_p (fd->for_stmt))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (fd->loop.v, step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, fd->loop.v, step);
@@ -6772,7 +6772,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
       if (fd->collapse > 1)
 	{
 	  i = fd->collapse - 1;
-	  if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v)))
 	    t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
 	  else
 	    {
@@ -6785,7 +6785,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	}
       if (cond_var)
 	{
-	  if (POINTER_TYPE_P (type)
+	  if (INDIRECT_TYPE_P (type)
 	      || TREE_CODE (n1) != INTEGER_CST
 	      || fd->loop.cond_code != LT_EXPR
 	      || tree_int_cst_sgn (n1) != 1)
@@ -6854,7 +6854,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
     {
       gsi = gsi_start_bb (l2_bb);
       step = fold_build2 (MINUS_EXPR, TREE_TYPE (step), orig_step, step);
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	t = fold_build_pointer_plus (fd->loop.v, step);
       else
 	t = fold_build2 (PLUS_EXPR, type, fd->loop.v, step);
@@ -6920,7 +6920,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	  else
 	    e = EDGE_SUCC (last_bb, 1);
 	  basic_block bb = split_edge (e);
-	  if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i].v)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (fd->loops[i].v)))
 	    t = fold_build_pointer_plus (fd->loops[i].v, fd->loops[i].step);
 	  else
 	    {
@@ -6973,7 +6973,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	      tree t2 = fold_convert (TREE_TYPE (fd->loops[i + 1].v),
 				      fd->loops[i + 1
 						- fd->loops[i + 1].outer].v);
-	      if (POINTER_TYPE_P (TREE_TYPE (t2)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (t2)))
 		t = fold_build_pointer_plus (t2, fd->loops[i + 1].n1);
 	      else
 		{
@@ -6998,7 +6998,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	      tree t2 = fold_convert (TREE_TYPE (fd->loops[i + 1].v),
 				      fd->loops[i + 1
 						- fd->loops[i + 1].outer].v);
-	      if (POINTER_TYPE_P (TREE_TYPE (t2)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (t2)))
 		t = fold_build_pointer_plus (t2, fd->loops[i + 1].n2);
 	      else
 		{
@@ -7024,7 +7024,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	      if (fd->loops[i + 1].m1 || fd->loops[i + 1].m2)
 		{
 		  tree itype = TREE_TYPE (fd->loops[i].v);
-		  if (POINTER_TYPE_P (itype))
+		  if (INDIRECT_TYPE_P (itype))
 		    itype = signed_type_for (itype);
 		  t = build_int_cst (itype, (fd->loops[i + 1].cond_code
 					     == LT_EXPR ? -1 : 1));
@@ -7035,7 +7035,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 		    t = fold_build2 (PLUS_EXPR, itype, t,
 				     fold_convert (itype,
 						   fd->loops[i + 1].n2));
-		  else if (POINTER_TYPE_P (TREE_TYPE (n2v)))
+		  else if (INDIRECT_TYPE_P (TREE_TYPE (n2v)))
 		    {
 		      t = fold_build_pointer_plus (n2v, t);
 		      t = fold_convert (itype, t);
@@ -7079,7 +7079,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
 	      expand_omp_build_assign (&gsi, altv,
 				       build_zero_cst (TREE_TYPE (altv)));
 	      tree itype = TREE_TYPE (fd->loops[i + 1].v);
-	      if (POINTER_TYPE_P (itype))
+	      if (INDIRECT_TYPE_P (itype))
 		itype = signed_type_for (itype);
 	      t = build_int_cst (itype, (fd->loops[i + 1].cond_code == LT_EXPR
 					 ? -1 : 1));
@@ -7251,7 +7251,7 @@ expand_omp_taskloop_for_outer (struct omp_region *region,
   tree t0, t1;
   t1 = fd->loop.n2;
   t0 = fd->loop.n1;
-  if (POINTER_TYPE_P (TREE_TYPE (t0))
+  if (INDIRECT_TYPE_P (TREE_TYPE (t0))
       && TYPE_PRECISION (TREE_TYPE (t0))
 	 != TYPE_PRECISION (fd->iter_type))
     {
@@ -7345,7 +7345,7 @@ expand_omp_taskloop_for_inner (struct omp_region *region,
   tree n1, n2, step;
 
   itype = type = TREE_TYPE (fd->loop.v);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     itype = signed_type_for (type);
 
   /* See if we need to bias by LLONG_MIN.  */
@@ -7485,7 +7485,7 @@ expand_omp_taskloop_for_inner (struct omp_region *region,
 
       if (!gimple_omp_for_combined_p (fd->for_stmt))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    t = fold_build_pointer_plus (vmain, step);
 	  else
 	    t = fold_build2 (PLUS_EXPR, type, vmain, step);
@@ -7641,7 +7641,7 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
   gcc_assert (!gimple_omp_for_combined_into_p (fd->for_stmt));
   gcc_assert (cond_code == LT_EXPR || cond_code == GT_EXPR);
 
-  if (POINTER_TYPE_P (iter_type))
+  if (INDIRECT_TYPE_P (iter_type))
     {
       plus_code = POINTER_PLUS_EXPR;
       plus_type = sizetype;
@@ -7652,7 +7652,7 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
       if (TYPE_PRECISION (diff_type) < TYPE_PRECISION (diff_type2))
 	diff_type = diff_type2;
     }
-  if (POINTER_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type))
+  if (INDIRECT_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type))
     diff_type = signed_type_for (diff_type);
   if (TYPE_PRECISION (diff_type) < TYPE_PRECISION (integer_type_node))
     diff_type = integer_type_node;
@@ -9328,7 +9328,7 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
   /* For floating-point values, we'll need to view-convert them to integers
      so that we can perform the atomic compare and swap.  Simplify the
      following code by always setting up the "i"ntegral variables.  */
-  if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+  if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
     {
       tree iaddr_val;
 
@@ -9601,7 +9601,7 @@ expand_omp_atomic (struct omp_region *region)
 	    return;
 
 	  /* When possible, use specialized atomic update functions.  */
-	  if ((INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
+	  if ((INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type))
 	      && store_bb == single_succ (load_bb)
 	      && expand_omp_atomic_fetch_op (load_bb, addr,
 					     loaded_val, stored_val, index))
diff --git a/gcc/omp-general.cc b/gcc/omp-general.cc
index eefdcb54590..c3e3f03ebb2 100644
--- a/gcc/omp-general.cc
+++ b/gcc/omp-general.cc
@@ -142,7 +142,7 @@ omp_adjust_for_condition (location_t loc, enum tree_code *cond_code, tree *n2,
       break;
 
     case LE_EXPR:
-      if (POINTER_TYPE_P (TREE_TYPE (*n2)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (*n2)))
 	*n2 = fold_build_pointer_plus_hwi_loc (loc, *n2, 1);
       else
 	*n2 = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (*n2), *n2,
@@ -150,7 +150,7 @@ omp_adjust_for_condition (location_t loc, enum tree_code *cond_code, tree *n2,
       *cond_code = LT_EXPR;
       break;
     case GE_EXPR:
-      if (POINTER_TYPE_P (TREE_TYPE (*n2)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (*n2)))
 	*n2 = fold_build_pointer_plus_hwi_loc (loc, *n2, -1);
       else
 	*n2 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (*n2), *n2,
@@ -286,7 +286,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
 	  fd->lastprivate_conditional++;
 	break;
       case OMP_CLAUSE__CONDTEMP_:
-	if (POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (t))))
+	if (INDIRECT_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (t))))
 	  fd->have_pointer_condtemp = true;
 	break;
       case OMP_CLAUSE__SCANTEMP_:
@@ -485,7 +485,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
 	}
       else if (iter_type != long_long_unsigned_type_node)
 	{
-	  if (POINTER_TYPE_P (TREE_TYPE (loop->v)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (loop->v)))
 	    iter_type = long_long_unsigned_type_node;
 	  else if (TYPE_UNSIGNED (TREE_TYPE (loop->v))
 		   && TYPE_PRECISION (TREE_TYPE (loop->v))
@@ -754,7 +754,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
 	    {
 	      tree itype = TREE_TYPE (loop->v);
 
-	      if (POINTER_TYPE_P (itype))
+	      if (INDIRECT_TYPE_P (itype))
 		itype = signed_type_for (itype);
 	      t = build_int_cst (itype, (loop->cond_code == LT_EXPR ? -1 : 1));
 	      t = fold_build2 (PLUS_EXPR, itype,
diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc
index 5dd9b77c873..a0760579315 100644
--- a/gcc/omp-low.cc
+++ b/gcc/omp-low.cc
@@ -809,7 +809,7 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx)
   /* Prevent redeclaring the var in the split-off function with a restrict
      pointer type.  Note that we only clear type itself, restrict qualifiers in
      the pointed-to type will be ignored by points-to analysis.  */
-  if (POINTER_TYPE_P (type)
+  if (INDIRECT_TYPE_P (type)
       && TYPE_RESTRICT (type))
     type = build_qualified_type (type, TYPE_QUALS (type) & ~TYPE_QUAL_RESTRICT);
 
@@ -1591,7 +1591,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
 	      /* Ignore GOMP_MAP_POINTER kind for arrays in regions that are
 		 not offloaded; there is nothing to map for those.  */
 	      if (!is_gimple_omp_offloaded (ctx->stmt)
-		  && !POINTER_TYPE_P (TREE_TYPE (decl))
+		  && !INDIRECT_TYPE_P (TREE_TYPE (decl))
 		  && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c))
 		break;
 	    }
@@ -4547,7 +4547,7 @@ omp_reduction_init_op (location_t loc, enum tree_code op, tree type)
 	    real_maxval (&min, 1, TYPE_MODE (type));
 	  return build_real (type, min);
 	}
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	{
 	  wide_int min
 	    = wi::min_value (TYPE_PRECISION (type), TYPE_SIGN (type));
@@ -4569,7 +4569,7 @@ omp_reduction_init_op (location_t loc, enum tree_code op, tree type)
 	    real_maxval (&max, 0, TYPE_MODE (type));
 	  return build_real (type, max);
 	}
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	{
 	  wide_int max
 	    = wi::max_value (TYPE_PRECISION (type), TYPE_SIGN (type));
@@ -6216,7 +6216,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 		      tree n1 = fd->loop.n1;
 		      tree step = fd->loop.step;
 		      tree itype = TREE_TYPE (l);
-		      if (POINTER_TYPE_P (itype))
+		      if (INDIRECT_TYPE_P (itype))
 			itype = signed_type_for (itype);
 		      l = fold_build2 (MINUS_EXPR, itype, l, n1);
 		      if (TYPE_UNSIGNED (itype)
@@ -6260,7 +6260,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 			  goto do_dtor;
 			}
 
-		      if (POINTER_TYPE_P (TREE_TYPE (x)))
+		      if (INDIRECT_TYPE_P (TREE_TYPE (x)))
 			x = fold_build_pointer_plus (x, t);
 		      else
 			x = fold_build2 (PLUS_EXPR, TREE_TYPE (x), x,
@@ -6295,7 +6295,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 							    GSI_SAME_STMT);
 			  tree t = OMP_CLAUSE_LINEAR_STEP (c);
 			  enum tree_code code = PLUS_EXPR;
-			  if (POINTER_TYPE_P (TREE_TYPE (new_var)))
+			  if (INDIRECT_TYPE_P (TREE_TYPE (new_var)))
 			    code = POINTER_PLUS_EXPR;
 			  g = gimple_build_assign (iv, code, iv, t);
 			  gsi_insert_before_without_update (&gsi, g,
@@ -7304,7 +7304,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
 	  gimplify_assign (v, build_zero_cst (type), body_p);
 	  this_stmt_list = cstmt_list;
 	  tree mem;
-	  if (POINTER_TYPE_P (TREE_TYPE (cond_ptr)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (cond_ptr)))
 	    {
 	      mem = build2 (MEM_REF, type, cond_ptr,
 			    build_int_cst (TREE_TYPE (cond_ptr),
@@ -7580,7 +7580,7 @@ lower_oacc_reductions (location_t loc, tree clauses, tree level, bool inner,
 		  ref_to_res = build_simple_mem_ref (ref_to_res);
 
 		tree type = TREE_TYPE (var);
-		if (POINTER_TYPE_P (type))
+		if (INDIRECT_TYPE_P (type))
 		  type = TREE_TYPE (type);
 
 		outgoing = var;
@@ -9872,7 +9872,7 @@ lower_omp_ordered_clauses (gimple_stmt_iterator *gsi_p, gomp_ordered *ord_stmt,
 	    goto lower_omp_ordered_ret;
 
 	  tree itype = TREE_TYPE (TREE_VALUE (vec));
-	  if (POINTER_TYPE_P (itype))
+	  if (INDIRECT_TYPE_P (itype))
 	    itype = sizetype;
 	  wide_int offset = wide_int::from (wi::to_wide (TREE_PURPOSE (vec)),
 					    TYPE_PRECISION (itype),
@@ -9963,7 +9963,7 @@ lower_omp_ordered_clauses (gimple_stmt_iterator *gsi_p, gomp_ordered *ord_stmt,
 	folded_deps[0] = -folded_deps[0];
 
       tree itype = TREE_TYPE (TREE_VALUE (OMP_CLAUSE_DECL (folded_dep)));
-      if (POINTER_TYPE_P (itype))
+      if (INDIRECT_TYPE_P (itype))
 	itype = sizetype;
 
       TREE_PURPOSE (OMP_CLAUSE_DECL (folded_dep))
@@ -13521,7 +13521,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		var1 = lang_hooks.decls.omp_array_data (var, false);
 		size1 = lang_hooks.decls.omp_array_size (var, &ilist);
 		var2 = build_fold_addr_expr (x);
-		if (!POINTER_TYPE_P (TREE_TYPE (var)))
+		if (!INDIRECT_TYPE_P (TREE_TYPE (var)))
 		  var = build_fold_addr_expr (var);
 		size2 = fold_build2 (POINTER_DIFF_EXPR, ssizetype,
 				   build_fold_addr_expr (var1), var);
@@ -13631,7 +13631,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		    || omp_is_allocatable_or_ptr (ovar))
 		  {
 		    type = TREE_TYPE (type);
-		    if (POINTER_TYPE_P (type)
+		    if (INDIRECT_TYPE_P (type)
 			&& TREE_CODE (type) != ARRAY_TYPE
 			&& ((OMP_CLAUSE_CODE (c) != OMP_CLAUSE_USE_DEVICE_ADDR
 			    && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_HAS_DEVICE_ADDR
@@ -13929,7 +13929,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		if (omp_privatize_by_reference (var))
 		  {
 		    type = TREE_TYPE (type);
-		    if (POINTER_TYPE_P (type)
+		    if (INDIRECT_TYPE_P (type)
 			&& TREE_CODE (type) != ARRAY_TYPE
 			&& ((OMP_CLAUSE_CODE (c) != OMP_CLAUSE_USE_DEVICE_ADDR
 			    && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_HAS_DEVICE_ADDR)
diff --git a/gcc/omp-oacc-neuter-broadcast.cc b/gcc/omp-oacc-neuter-broadcast.cc
index 779dc6b1afb..5d93a6bb190 100644
--- a/gcc/omp-oacc-neuter-broadcast.cc
+++ b/gcc/omp-oacc-neuter-broadcast.cc
@@ -571,7 +571,7 @@ install_var_field (tree var, tree record_type, field_map_t *fields)
 
   tree type = TREE_TYPE (var);
 
-  if (POINTER_TYPE_P (type)
+  if (INDIRECT_TYPE_P (type)
       && TYPE_RESTRICT (type))
     type = build_qualified_type (type, TYPE_QUALS (type) & ~TYPE_QUAL_RESTRICT);
 
@@ -950,7 +950,7 @@ build_receiver_ref (tree var, tree receiver_decl, field_map_t *fields)
 static tree
 build_sender_ref (tree var, tree sender_decl, field_map_t *fields)
 {
-  if (POINTER_TYPE_P (TREE_TYPE (sender_decl)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (sender_decl)))
     sender_decl = build_simple_mem_ref (sender_decl);
   tree field = *fields->get (var);
   return omp_build_component_ref (sender_decl, field);
@@ -1023,7 +1023,7 @@ worker_single_copy (basic_block from, basic_block to,
 
   gimple *call
     = gimple_build_call (decl, 1,
-			 POINTER_TYPE_P (TREE_TYPE (sender_decl))
+			 INDIRECT_TYPE_P (TREE_TYPE (sender_decl))
 			 ? sender_decl : build_fold_addr_expr (sender_decl));
   gimple_call_set_lhs (call, lhs);
   gsi_insert_before (&start, call, GSI_NEW_STMT);
@@ -1226,7 +1226,7 @@ worker_single_copy (basic_block from, basic_block to,
 
   decl = builtin_decl_explicit (BUILT_IN_GOACC_SINGLE_COPY_END);
   call = gimple_build_call (decl, 1,
-			    POINTER_TYPE_P (TREE_TYPE (sender_decl))
+			    INDIRECT_TYPE_P (TREE_TYPE (sender_decl))
 			    ? sender_decl
 			    : build_fold_addr_expr (sender_decl));
   gimple_seq_add_stmt (&sender_seq, call);
diff --git a/gcc/omp-offload.cc b/gcc/omp-offload.cc
index 0d3c8794d54..681d8014933 100644
--- a/gcc/omp-offload.cc
+++ b/gcc/omp-offload.cc
@@ -2846,7 +2846,7 @@ pass_omp_target_link::execute (function *fun)
 	    {
 	      tree dev = gimple_call_arg (gsi_stmt (gsi), 0);
 	      tree fn = gimple_call_arg (gsi_stmt (gsi), 1);
-	      if (POINTER_TYPE_P (TREE_TYPE (fn)))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (fn)))
 		fn = TREE_OPERAND (fn, 0);
 	      if (TREE_CODE (dev) == INTEGER_CST
 		  && wi::to_wide (dev) == GOMP_DEVICE_HOST_FALLBACK
diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc
index a3046ed44d2..7b1df46ec3c 100644
--- a/gcc/omp-simd-clone.cc
+++ b/gcc/omp-simd-clone.cc
@@ -393,7 +393,7 @@ simd_clone_clauses_extract (struct cgraph_node *node, tree clauses,
 	      }
 	    else
 	      {
-		if (POINTER_TYPE_P (args[argno]))
+		if (INDIRECT_TYPE_P (args[argno]))
 		  step = fold_convert (ssizetype, step);
 		if (!tree_fits_shwi_p (step))
 		  {
@@ -726,7 +726,7 @@ simd_clone_adjust_return_type (struct cgraph_node *node)
   if (orig_rettype == void_type_node)
     return NULL_TREE;
   t = TREE_TYPE (TREE_TYPE (fndecl));
-  if (INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t))
+  if (INTEGRAL_TYPE_P (t) || INDIRECT_TYPE_P (t))
     veclen = node->simdclone->vecsize_int;
   else
     veclen = node->simdclone->vecsize_float;
@@ -736,7 +736,7 @@ simd_clone_adjust_return_type (struct cgraph_node *node)
     veclen = exact_div (veclen, GET_MODE_BITSIZE (SCALAR_TYPE_MODE (t)));
   if (multiple_p (veclen, node->simdclone->simdlen))
     veclen = node->simdclone->simdlen;
-  if (POINTER_TYPE_P (t))
+  if (INDIRECT_TYPE_P (t))
     t = pointer_sized_int_node;
   if (known_eq (veclen, node->simdclone->simdlen))
     t = build_vector_type (t, node->simdclone->simdlen);
@@ -843,7 +843,7 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
 	case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP:
 	case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP:
 	case SIMD_CLONE_ARG_TYPE_VECTOR:
-	  if (INTEGRAL_TYPE_P (parm_type) || POINTER_TYPE_P (parm_type))
+	  if (INTEGRAL_TYPE_P (parm_type) || INDIRECT_TYPE_P (parm_type))
 	    veclen = sc->vecsize_int;
 	  else
 	    veclen = sc->vecsize_float;
@@ -857,7 +857,7 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
 	    veclen = sc->simdlen;
 	  adj.op = IPA_PARAM_OP_NEW;
 	  adj.param_prefix_index = IPA_PARAM_PREFIX_SIMD;
-	  if (POINTER_TYPE_P (parm_type))
+	  if (INDIRECT_TYPE_P (parm_type))
 	    adj.type = build_vector_type (pointer_sized_int_node, veclen);
 	  else
 	    adj.type = build_vector_type (parm_type, veclen);
@@ -898,7 +898,7 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
 
       adj.base_index = i;
       adj.prev_clone_index = i;
-      if (INTEGRAL_TYPE_P (base_type) || POINTER_TYPE_P (base_type))
+      if (INTEGRAL_TYPE_P (base_type) || INDIRECT_TYPE_P (base_type))
 	veclen = sc->vecsize_int;
       else
 	veclen = sc->vecsize_float;
@@ -912,7 +912,7 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
       if (sc->mask_mode != VOIDmode)
 	adj.type
 	  = lang_hooks.types.type_for_mode (sc->mask_mode, 1);
-      else if (POINTER_TYPE_P (base_type))
+      else if (INDIRECT_TYPE_P (base_type))
 	adj.type = build_vector_type (pointer_sized_int_node, veclen);
       else
 	adj.type = build_vector_type (base_type, veclen);
@@ -1001,7 +1001,7 @@ simd_clone_init_simd_arrays (struct cgraph_node *node,
        arg = DECL_CHAIN (arg), i++, j++)
     {
       if ((*adjustments->m_adj_params)[j].op == IPA_PARAM_OP_COPY
-	  || POINTER_TYPE_P (TREE_TYPE (arg)))
+	  || INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	continue;
 
       node->simdclone->args[i].vector_arg = arg;
@@ -1405,7 +1405,7 @@ simd_clone_linear_addend (struct cgraph_node *node, unsigned int i,
       gsi_insert_before (&gsi, g, GSI_SAME_STMT);
       ret = gimple_assign_lhs (g);
     }
-  if (POINTER_TYPE_P (ptype))
+  if (INDIRECT_TYPE_P (ptype))
     {
       tree size = TYPE_SIZE_UNIT (TREE_TYPE (ptype));
       if (size && TREE_CODE (size) == INTEGER_CST)
@@ -1755,7 +1755,7 @@ simd_clone_adjust (struct cgraph_node *node)
       {
 	tree orig_arg = node->simdclone->args[i].orig_arg;
 	gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (orig_arg))
-		    || POINTER_TYPE_P (TREE_TYPE (orig_arg)));
+		    || INDIRECT_TYPE_P (TREE_TYPE (orig_arg)));
 	tree def = NULL_TREE;
 	if (TREE_ADDRESSABLE (orig_arg))
 	  {
diff --git a/gcc/pointer-query.cc b/gcc/pointer-query.cc
index 9723358f965..5557161b0a5 100644
--- a/gcc/pointer-query.cc
+++ b/gcc/pointer-query.cc
@@ -74,7 +74,7 @@ get_offset_range (tree x, gimple *stmt, offset_int r[2], range_query *rvals)
     x = TREE_OPERAND (x, 0);
 
   tree type = TREE_TYPE (x);
-  if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
+  if (!INTEGRAL_TYPE_P (type) && !INDIRECT_TYPE_P (type))
     return false;
 
    if (TREE_CODE (x) != INTEGER_CST
@@ -556,7 +556,7 @@ gimple_parm_array_size (tree ptr, wide_int rng[2],
      from the current function declaratation (e.g., attribute access or
      related).  */
   tree var = SSA_NAME_VAR (ptr);
-  if (TREE_CODE (var) != PARM_DECL || !POINTER_TYPE_P (TREE_TYPE (var)))
+  if (TREE_CODE (var) != PARM_DECL || !INDIRECT_TYPE_P (TREE_TYPE (var)))
     return NULL_TREE;
 
   const unsigned prec = TYPE_PRECISION (sizetype);
@@ -1750,7 +1750,7 @@ handle_decl (tree decl, bool addr, access_ref *pref)
      the identity of the object has been determined.  */
   pref->offrng[0] = pref->offrng[1] = 0;
 
-  if (!addr && POINTER_TYPE_P (decl_type))
+  if (!addr && INDIRECT_TYPE_P (decl_type))
     {
       /* Set the maximum size if the reference is to the pointer
 	 itself (as opposed to what it points to), and clear
@@ -1942,7 +1942,7 @@ handle_component_ref (tree cref, gimple *stmt, bool addr, int ostype,
 
   pref->ref = field;
 
-  if (!addr && POINTER_TYPE_P (TREE_TYPE (field)))
+  if (!addr && INDIRECT_TYPE_P (TREE_TYPE (field)))
     {
       /* Set maximum size if the reference is to the pointer member
 	 itself (as opposed to what it points to).  */
@@ -2181,7 +2181,7 @@ handle_ssa_name (tree ptr, bool addr, int ostype,
       return true;
     }
 
-  if (ostype > 1 && POINTER_TYPE_P (TREE_TYPE (rhs)))
+  if (ostype > 1 && INDIRECT_TYPE_P (TREE_TYPE (rhs)))
     {
       /* When determining the qualifiers follow the pointer but
 	 avoid caching the result.  As the pointer is added to
@@ -2283,7 +2283,7 @@ compute_objsize_r (tree ptr, gimple *stmt, bool addr, int ostype,
       if (integer_zerop (ptr)
 	  || wi::to_widest (ptr) >= param_min_pagesize)
 	pref->set_max_size_range ();
-      else if (POINTER_TYPE_P (TREE_TYPE (ptr)))
+      else if (INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	{
 	  tree deref_type = TREE_TYPE (TREE_TYPE (ptr));
 	  addr_space_t as = TYPE_ADDR_SPACE (deref_type);
diff --git a/gcc/predict.cc b/gcc/predict.cc
index 26f9f3f6a88..3b106e77bc8 100644
--- a/gcc/predict.cc
+++ b/gcc/predict.cc
@@ -2755,7 +2755,7 @@ tree_predict_by_opcode (basic_block bb)
   /* Try "pointer heuristic."
      A comparison ptr == 0 is predicted as false.
      Similarly, a comparison ptr1 == ptr2 is predicted as false.  */
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       if (cmp == EQ_EXPR)
 	predict_edge_def (then_edge, PRED_TREE_POINTER, NOT_TAKEN);
@@ -2860,7 +2860,7 @@ return_prediction (tree val, enum prediction *prediction)
   if (!val)
     return PRED_NO_PREDICTION;
   /* Different heuristics for pointers and scalars.  */
-  if (POINTER_TYPE_P (TREE_TYPE (val)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (val)))
     {
       /* NULL is usually not returned.  */
       if (integer_zerop (val))
diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 6b5d4f2accd..aa0ec5ab4a7 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -2897,11 +2897,11 @@ operator_cast::op1_range (irange &r, tree type,
   gcc_checking_assert (types_compatible_p (op2.type(), type));
 
   // If we are calculating a pointer, shortcut to what we really care about.
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       // Conversion from other pointers or a constant (including 0/NULL)
       // are straightforward.
-      if (POINTER_TYPE_P (lhs.type ())
+      if (INDIRECT_TYPE_P (lhs.type ())
 	  || (lhs.singleton_p ()
 	      && TYPE_PRECISION (lhs.type ()) >= TYPE_PRECISION (type)))
 	{
diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index 66e859cd70c..e585c76fdb5 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -3648,7 +3648,7 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx)
       gcc_unreachable ();
     }
 
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     return size_binop (PLUS_EXPR, base, convert (type, off));
   return fold_build_pointer_plus (base, off);
 }
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index cf20b5b98e0..fa2a8109c80 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -2327,7 +2327,7 @@ Gcc_backend::convert_tree (tree type_tree, tree expr_tree, Location location)
       || TREE_TYPE (expr_tree) == error_mark_node)
     return error_mark_node;
 
-  if (POINTER_TYPE_P (type_tree) || INTEGRAL_TYPE_P (type_tree)
+  if (INDIRECT_TYPE_P (type_tree) || INTEGRAL_TYPE_P (type_tree)
       || SCALAR_FLOAT_TYPE_P (type_tree) || COMPLEX_FLOAT_TYPE_P (type_tree))
     return fold_convert_loc (location.gcc_location (), type_tree, expr_tree);
   else if (TREE_CODE (type_tree) == RECORD_TYPE
diff --git a/gcc/sese.cc b/gcc/sese.cc
index 0cf7f648021..caffbf0a430 100644
--- a/gcc/sese.cc
+++ b/gcc/sese.cc
@@ -417,7 +417,7 @@ scev_analyzable_p (tree def, sese_l &region)
      following test returns false for non integer types to avoid such
      problems.  */
   if (!INTEGRAL_TYPE_P (type)
-      && !POINTER_TYPE_P (type))
+      && !INDIRECT_TYPE_P (type))
     return false;
 
   loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
diff --git a/gcc/tree-affine.cc b/gcc/tree-affine.cc
index ee327e63a23..145ae2f954c 100644
--- a/gcc/tree-affine.cc
+++ b/gcc/tree-affine.cc
@@ -119,7 +119,7 @@ aff_combination_scale (aff_tree *comb, const widest_int &scale_in)
   if (comb->rest)
     {
       tree type = comb->type;
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	type = sizetype;
       if (comb->n < MAX_AFF_ELTS)
 	{
@@ -179,7 +179,7 @@ aff_combination_add_elt (aff_tree *comb, tree elt, const widest_int &scale_in)
     }
 
   type = comb->type;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = sizetype;
 
   if (scale == 1)
@@ -234,7 +234,7 @@ aff_combination_convert (aff_tree *comb, tree type)
     }
 
   comb->type = type;
-  if (comb->rest && !POINTER_TYPE_P (type))
+  if (comb->rest && !INDIRECT_TYPE_P (type))
     comb->rest = fold_convert (type, comb->rest);
 
   if (TYPE_PRECISION (type) == TYPE_PRECISION (comb_type))
@@ -534,11 +534,11 @@ aff_combination_to_tree (aff_tree *comb)
   gcc_assert (comb->n == MAX_AFF_ELTS || comb->rest == NULL_TREE);
 
   i = 0;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       type = sizetype;
       if (comb->n > 0 && comb->elts[0].coef == 1
-	  && POINTER_TYPE_P (TREE_TYPE (comb->elts[0].val)))
+	  && INDIRECT_TYPE_P (TREE_TYPE (comb->elts[0].val)))
 	{
 	  base = comb->elts[0].val;
 	  ++i;
@@ -962,7 +962,7 @@ print_aff (FILE *file, aff_tree *val)
 {
   unsigned i;
   signop sgn = TYPE_SIGN (val->type);
-  if (POINTER_TYPE_P (val->type))
+  if (INDIRECT_TYPE_P (val->type))
     sgn = SIGNED;
   fprintf (file, "{\n  type = ");
   print_generic_expr (file, val->type, TDF_VOPS|TDF_MEMSYMS);
diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index 7ccc2a5a5a7..591a73116c2 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -3288,7 +3288,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
 	  return true;
 	}
       if (!poly_int_tree_p (TREE_OPERAND (expr, 1))
-	  || !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1))))
+	  || !INDIRECT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1))))
 	{
 	  error ("invalid offset operand in %qs", code_name);
 	  debug_generic_stmt (expr);
@@ -3314,7 +3314,7 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
 	}
       if (!TMR_OFFSET (expr)
 	  || !poly_int_tree_p (TMR_OFFSET (expr))
-	  || !POINTER_TYPE_P (TREE_TYPE (TMR_OFFSET (expr))))
+	  || !INDIRECT_TYPE_P (TREE_TYPE (TMR_OFFSET (expr))))
 	{
 	  error ("invalid offset operand in %qs", code_name);
 	  debug_generic_stmt (expr);
@@ -3429,7 +3429,7 @@ verify_gimple_call (gcall *stmt)
     }
 
   if (fn
-      && (!POINTER_TYPE_P (TREE_TYPE (fn))
+      && (!INDIRECT_TYPE_P (TREE_TYPE (fn))
 	  || (TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != FUNCTION_TYPE
 	      && TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != METHOD_TYPE)))
     {
@@ -3475,8 +3475,8 @@ verify_gimple_call (gcall *stmt)
       /* ???  At least C++ misses conversions at assignments from
 	 void * call results.
 	 For now simply allow arbitrary pointer type conversions.  */
-      && !(POINTER_TYPE_P (TREE_TYPE (lhs))
-	   && POINTER_TYPE_P (TREE_TYPE (fntype))))
+      && !(INDIRECT_TYPE_P (TREE_TYPE (lhs))
+	   && INDIRECT_TYPE_P (TREE_TYPE (fntype))))
     {
       error ("invalid conversion in gimple call");
       debug_generic_stmt (TREE_TYPE (lhs));
@@ -3714,9 +3714,9 @@ verify_gimple_assign_unary (gassign *stmt)
 	   For targets were the precision of ptrofftype doesn't match that
 	   of pointers we allow conversions to types where
 	   POINTERS_EXTEND_UNSIGNED specifies how that works.  */
-	if ((POINTER_TYPE_P (lhs_type)
+	if ((INDIRECT_TYPE_P (lhs_type)
 	     && INTEGRAL_TYPE_P (rhs1_type))
-	    || (POINTER_TYPE_P (rhs1_type)
+	    || (INDIRECT_TYPE_P (rhs1_type)
 		&& INTEGRAL_TYPE_P (lhs_type)
 		&& (TYPE_PRECISION (rhs1_type) >= TYPE_PRECISION (lhs_type)
 #if defined(POINTERS_EXTEND_UNSIGNED)
@@ -3751,7 +3751,7 @@ verify_gimple_assign_unary (gassign *stmt)
 
     case ADDR_SPACE_CONVERT_EXPR:
       {
-	if (!POINTER_TYPE_P (rhs1_type) || !POINTER_TYPE_P (lhs_type)
+	if (!INDIRECT_TYPE_P (rhs1_type) || !INDIRECT_TYPE_P (lhs_type)
 	    || (TYPE_ADDR_SPACE (TREE_TYPE (rhs1_type))
 		== TYPE_ADDR_SPACE (TREE_TYPE (lhs_type))))
 	  {
@@ -3853,7 +3853,7 @@ verify_gimple_assign_unary (gassign *stmt)
     case PAREN_EXPR:
     case CONJ_EXPR:
       /* Disallow pointer and offset types for many of the unary gimple. */
-      if (POINTER_TYPE_P (lhs_type)
+      if (INDIRECT_TYPE_P (lhs_type)
 	  || TREE_CODE (lhs_type) == OFFSET_TYPE)
 	{
 	  error ("invalid types for %qs", code_name);
@@ -4039,9 +4039,9 @@ verify_gimple_assign_binary (gassign *stmt)
 	    rhs1_etype = TREE_TYPE (rhs1_type);
 	    rhs2_etype = TREE_TYPE (rhs2_type);
 	  }
-	if (POINTER_TYPE_P (lhs_etype)
-	    || POINTER_TYPE_P (rhs1_etype)
-	    || POINTER_TYPE_P (rhs2_etype))
+	if (INDIRECT_TYPE_P (lhs_etype)
+	    || INDIRECT_TYPE_P (rhs1_etype)
+	    || INDIRECT_TYPE_P (rhs2_etype))
 	  {
 	    error ("invalid (pointer) operands %qs", code_name);
 	    return true;
@@ -4053,7 +4053,7 @@ verify_gimple_assign_binary (gassign *stmt)
 
     case POINTER_PLUS_EXPR:
       {
-	if (!POINTER_TYPE_P (rhs1_type)
+	if (!INDIRECT_TYPE_P (rhs1_type)
 	    || !useless_type_conversion_p (lhs_type, rhs1_type)
 	    || !ptrofftype_p (rhs2_type))
 	  {
@@ -4069,8 +4069,8 @@ verify_gimple_assign_binary (gassign *stmt)
 
     case POINTER_DIFF_EXPR:
       {
-	if (!POINTER_TYPE_P (rhs1_type)
-	    || !POINTER_TYPE_P (rhs2_type)
+	if (!INDIRECT_TYPE_P (rhs1_type)
+	    || !INDIRECT_TYPE_P (rhs2_type)
 	    /* Because we special-case pointers to void we allow difference
 	       of arbitrary pointers with the same mode.  */
 	    || TYPE_MODE (rhs1_type) != TYPE_MODE (rhs2_type)
@@ -4233,7 +4233,7 @@ verify_gimple_assign_binary (gassign *stmt)
     case BIT_IOR_EXPR:
     case BIT_XOR_EXPR:
       /* Disallow pointer and offset types for many of the binary gimple. */
-      if (POINTER_TYPE_P (lhs_type)
+      if (INDIRECT_TYPE_P (lhs_type)
 	  || TREE_CODE (lhs_type) == OFFSET_TYPE)
 	{
 	  error ("invalid types for %qs", code_name);
@@ -4251,11 +4251,11 @@ verify_gimple_assign_binary (gassign *stmt)
       break;
 
     case BIT_AND_EXPR:
-      if (POINTER_TYPE_P (lhs_type)
+      if (INDIRECT_TYPE_P (lhs_type)
 	  && TREE_CODE (rhs2) == INTEGER_CST)
 	break;
       /* Disallow pointer and offset types for many of the binary gimple. */
-      if (POINTER_TYPE_P (lhs_type)
+      if (INDIRECT_TYPE_P (lhs_type)
 	  || TREE_CODE (lhs_type) == OFFSET_TYPE)
 	{
 	  error ("invalid types for %qs", code_name);
@@ -4889,7 +4889,7 @@ verify_gimple_goto (ggoto *stmt)
      bare LABEL_DECL and an ADDR_EXPR of a LABEL_DECL.  */
   if (TREE_CODE (dest) != LABEL_DECL
       && (!is_gimple_val (dest)
-	  || !POINTER_TYPE_P (TREE_TYPE (dest))))
+	  || !INDIRECT_TYPE_P (TREE_TYPE (dest))))
     {
       error ("goto destination is neither a label nor a pointer");
       return true;
diff --git a/gcc/tree-chrec.cc b/gcc/tree-chrec.cc
index 2f67581591a..69ea4d09ca6 100644
--- a/gcc/tree-chrec.cc
+++ b/gcc/tree-chrec.cc
@@ -59,7 +59,7 @@ chrec_fold_plus_poly_poly (enum tree_code code,
   gcc_assert (poly1);
   gcc_assert (TREE_CODE (poly0) == POLYNOMIAL_CHREC);
   gcc_assert (TREE_CODE (poly1) == POLYNOMIAL_CHREC);
-  if (POINTER_TYPE_P (chrec_type (poly0)))
+  if (INDIRECT_TYPE_P (chrec_type (poly0)))
     gcc_checking_assert (ptrofftype_p (chrec_type (poly1))
 			 && useless_type_conversion_p (type, chrec_type (poly0)));
   else
@@ -368,7 +368,7 @@ chrec_fold_plus (tree type,
   if (integer_zerop (op1))
     return chrec_convert (type, op0, NULL);
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     code = POINTER_PLUS_EXPR;
   else
     code = PLUS_EXPR;
@@ -623,7 +623,7 @@ chrec_apply (unsigned var,
 	  else if (operand_equal_p (CHREC_LEFT (chrec), chrecr)
 		   && TREE_CODE (x) == PLUS_EXPR
 		   && integer_all_onesp (TREE_OPERAND (x, 1))
-		   && !POINTER_TYPE_P (type)
+		   && !INDIRECT_TYPE_P (type)
 		   && TYPE_PRECISION (TREE_TYPE (x))
 		      >= TYPE_PRECISION (type))
 	    {
@@ -862,7 +862,7 @@ reset_evolution_in_loop (unsigned loop_num,
 {
   class loop *loop = get_loop (cfun, loop_num);
 
-  if (POINTER_TYPE_P (chrec_type (chrec)))
+  if (INDIRECT_TYPE_P (chrec_type (chrec)))
     gcc_assert (ptrofftype_p (chrec_type (new_evol)));
   else
     gcc_assert (chrec_type (chrec) == chrec_type (new_evol));
@@ -1319,7 +1319,7 @@ convert_affine_scev (class loop *loop, tree type,
   bool enforce_overflow_semantics;
   bool must_check_src_overflow, must_check_rslt_overflow;
   tree new_base, new_step;
-  tree step_type = POINTER_TYPE_P (type) ? sizetype : type;
+  tree step_type = INDIRECT_TYPE_P (type) ? sizetype : type;
 
   /* In general,
      (TYPE) (BASE + STEP * i) = (TYPE) BASE + (TYPE -- sign extend) STEP * i,
@@ -1416,7 +1416,7 @@ convert_affine_scev (class loop *loop, tree type,
 tree
 chrec_convert_rhs (tree type, tree chrec, gimple *at_stmt)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type = sizetype;
 
   return chrec_convert (type, chrec, at_stmt);
@@ -1586,7 +1586,7 @@ chrec_convert_aggressive (tree type, tree chrec, bool *fold_conversions)
       if (convert_affine_scev (loop, type, &base, &step, NULL, true))
 	return build_polynomial_chrec (loop->num, base, step);
     }
-  rtype = POINTER_TYPE_P (type) ? sizetype : type;
+  rtype = INDIRECT_TYPE_P (type) ? sizetype : type;
 
   left = CHREC_LEFT (chrec);
   right = CHREC_RIGHT (chrec);
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index 9c412dc879a..de2e2a7d227 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -146,13 +146,13 @@ build_polynomial_chrec (unsigned loop_num,
 
   /* Types of left and right sides of a chrec should be compatible, but
      pointer CHRECs are special in that the evolution is of ptroff type.  */
-  if (POINTER_TYPE_P (TREE_TYPE (left)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (left)))
     gcc_checking_assert (ptrofftype_p (TREE_TYPE (right)));
   else
     {
       /* Pointer types should occur only on the left hand side, i.e. in
 	 the base of the chrec, and not in the step.  */
-      gcc_checking_assert (!POINTER_TYPE_P (TREE_TYPE (right))
+      gcc_checking_assert (!INDIRECT_TYPE_P (TREE_TYPE (right))
 			   && types_compatible_p (TREE_TYPE (left),
 						  TREE_TYPE (right)));
     }
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index 668808a29d0..4f26345a4b5 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -1610,7 +1610,7 @@ struct GTY(()) tree_ssa_name {
     /* Range info for everything else.  */
     struct GTY ((tag ("1"))) vrange_storage * range_info;
   } GTY ((desc ("%1.typed.type ?" \
-		"!POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info;
+		"!INDIRECT_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info;
   /* Immediate uses list for this SSA_NAME.  */
   struct ssa_use_operand_t imm_uses;
 };
diff --git a/gcc/tree-data-ref.cc b/gcc/tree-data-ref.cc
index 6d3b7c2290e..023387c2747 100644
--- a/gcc/tree-data-ref.cc
+++ b/gcc/tree-data-ref.cc
@@ -846,7 +846,7 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
 	       // element size from corresponding op embedded ARRAY_REF,
 	       // if unsuccessful, just punt.
 	     }  */
-	while (POINTER_TYPE_P (type))
+	while (INDIRECT_TYPE_P (type))
 	  type = TREE_TYPE (type);
 	if (int_size_in_bytes (type) < 0)
 	  return false;
@@ -946,20 +946,20 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
 
 	       (sizetype) (TYPE) OP0 == (sizetype) *VAR + (sizetype) *OFF.  */
 	tree itype = TREE_TYPE (op0);
-	if ((POINTER_TYPE_P (itype)
+	if ((INDIRECT_TYPE_P (itype)
 	     || (INTEGRAL_TYPE_P (itype) && !TYPE_OVERFLOW_TRAPS (itype)))
-	    && (POINTER_TYPE_P (type)
+	    && (INDIRECT_TYPE_P (type)
 		|| (INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_TRAPS (type)))
-	    && (POINTER_TYPE_P (type) == POINTER_TYPE_P (itype)
+	    && (INDIRECT_TYPE_P (type) == INDIRECT_TYPE_P (itype)
 		|| (TYPE_PRECISION (type) == TYPE_PRECISION (sizetype)
 		    && TYPE_PRECISION (itype) == TYPE_PRECISION (sizetype))))
 	  {
-	    if (POINTER_TYPE_P (type))
+	    if (INDIRECT_TYPE_P (type))
 	      {
 		split_constant_offset (op0, var, off, nullptr, cache, limit);
 		*var = fold_convert (type, *var);
 	      }
-	    else if (POINTER_TYPE_P (itype))
+	    else if (INDIRECT_TYPE_P (itype))
 	      {
 		split_constant_offset (op0, var, off, nullptr, cache, limit);
 		*var = fold_convert (sizetype, *var);
@@ -1094,7 +1094,7 @@ canonicalize_base_object_address (tree addr)
 
   /* The base address may be obtained by casting from integer, in that case
      keep the cast.  */
-  if (!POINTER_TYPE_P (TREE_TYPE (addr)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (addr)))
     return orig;
 
   if (TREE_CODE (addr) != ADDR_EXPR)
@@ -6087,7 +6087,7 @@ dr_alignment (innermost_loop_behavior *drb)
 static tree
 get_base_for_alignment_1 (tree base, unsigned int *alignment_out)
 {
-  if (TREE_CODE (base) != SSA_NAME || !POINTER_TYPE_P (TREE_TYPE (base)))
+  if (TREE_CODE (base) != SSA_NAME || !INDIRECT_TYPE_P (TREE_TYPE (base)))
     return NULL_TREE;
 
   gimple *def = SSA_NAME_DEF_STMT (base);
@@ -6104,7 +6104,7 @@ get_base_for_alignment_1 (tree base, unsigned int *alignment_out)
     }
 
   /* Punt if the expression is too complicated to handle.  */
-  if (tree_contains_chrecs (base, NULL) || !POINTER_TYPE_P (TREE_TYPE (base)))
+  if (tree_contains_chrecs (base, NULL) || !INDIRECT_TYPE_P (TREE_TYPE (base)))
     return NULL_TREE;
 
   /* The only useful cases are those for which a dereference folds to something
diff --git a/gcc/tree-dfa.cc b/gcc/tree-dfa.cc
index ad8cfedec8c..1ec5890de20 100644
--- a/gcc/tree-dfa.cc
+++ b/gcc/tree-dfa.cc
@@ -116,7 +116,7 @@ dump_variable (FILE *file, tree var)
 {
   if (TREE_CODE (var) == SSA_NAME)
     {
-      if (POINTER_TYPE_P (TREE_TYPE (var)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (var)))
 	dump_points_to_info_for (file, var);
       var = SSA_NAME_VAR (var);
     }
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index 799f071965e..3ae7cec4e78 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -1069,7 +1069,7 @@ if_convertible_gimple_assign_stmt_p (gimple *stmt,
       return false;
     }
   else if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-	    || POINTER_TYPE_P (TREE_TYPE (lhs)))
+	    || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	   && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (lhs))
 	   && arith_code_with_undefined_signed_overflow
 				(gimple_assign_rhs_code (stmt)))
@@ -2719,7 +2719,7 @@ predicate_statements (loop_p loop)
 	    }
 	  else if (((lhs = gimple_assign_lhs (stmt)), true)
 		   && (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-		       || POINTER_TYPE_P (TREE_TYPE (lhs)))
+		       || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 		   && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (lhs))
 		   && arith_code_with_undefined_signed_overflow
 						(gimple_assign_rhs_code (stmt)))
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 95c7c360529..7eee29380a9 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -243,7 +243,7 @@ remap_ssa_name (tree name, copy_body_data *id)
       /* At least IPA points-to info can be directly transferred.  */
       if (id->src_cfun->gimple_df
 	  && id->src_cfun->gimple_df->ipa_pta
-	  && POINTER_TYPE_P (TREE_TYPE (name))
+	  && INDIRECT_TYPE_P (TREE_TYPE (name))
 	  && (pi = SSA_NAME_PTR_INFO (name))
 	  && !pi->pt.anything)
 	{
@@ -251,7 +251,7 @@ remap_ssa_name (tree name, copy_body_data *id)
 	  new_pi->pt = pi->pt;
 	}
       /* So can range-info.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (name))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (name))
 	  && SSA_NAME_RANGE_INFO (name))
 	duplicate_ssa_name_range_info (new_tree, name);
       return new_tree;
@@ -280,7 +280,7 @@ remap_ssa_name (tree name, copy_body_data *id)
       /* At least IPA points-to info can be directly transferred.  */
       if (id->src_cfun->gimple_df
 	  && id->src_cfun->gimple_df->ipa_pta
-	  && POINTER_TYPE_P (TREE_TYPE (name))
+	  && INDIRECT_TYPE_P (TREE_TYPE (name))
 	  && (pi = SSA_NAME_PTR_INFO (name))
 	  && !pi->pt.anything)
 	{
@@ -288,7 +288,7 @@ remap_ssa_name (tree name, copy_body_data *id)
 	  new_pi->pt = pi->pt;
 	}
       /* So can range-info.  */
-      if (!POINTER_TYPE_P (TREE_TYPE (name))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (name))
 	  && SSA_NAME_RANGE_INFO (name))
 	duplicate_ssa_name_range_info (new_tree, name);
       if (SSA_NAME_IS_DEFAULT_DEF (name))
diff --git a/gcc/tree-nested.cc b/gcc/tree-nested.cc
index ae7d1f1f6a8..ff68498375b 100644
--- a/gcc/tree-nested.cc
+++ b/gcc/tree-nested.cc
@@ -1605,7 +1605,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 static void
 note_nonlocal_vla_type (struct nesting_info *info, tree type)
 {
-  while (POINTER_TYPE_P (type) && !TYPE_NAME (type))
+  while (INDIRECT_TYPE_P (type) && !TYPE_NAME (type))
     type = TREE_TYPE (type);
 
   if (TYPE_NAME (type)
@@ -1613,7 +1613,7 @@ note_nonlocal_vla_type (struct nesting_info *info, tree type)
       && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
     type = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
 
-  while (POINTER_TYPE_P (type)
+  while (INDIRECT_TYPE_P (type)
 	 || VECTOR_TYPE_P (type)
 	 || TREE_CODE (type) == FUNCTION_TYPE
 	 || TREE_CODE (type) == METHOD_TYPE)
@@ -3292,7 +3292,7 @@ remap_vla_decls (tree block, struct nesting_info *root)
 	id.cb.src_cfun = DECL_STRUCT_FUNCTION (root->context);
 
 	TREE_TYPE (var) = newt = remap_type (type, &id.cb);
-	while (POINTER_TYPE_P (newt) && !TYPE_NAME (newt))
+	while (INDIRECT_TYPE_P (newt) && !TYPE_NAME (newt))
 	  {
 	    newt = TREE_TYPE (newt);
 	    type = TREE_TYPE (type);
@@ -3605,7 +3605,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
 		id.cb.src_cfun = DECL_STRUCT_FUNCTION (root->context);
 
 		TREE_TYPE (debug_var) = newt = remap_type (type, &id.cb);
-		while (POINTER_TYPE_P (newt) && !TYPE_NAME (newt))
+		while (INDIRECT_TYPE_P (newt) && !TYPE_NAME (newt))
 		  {
 		    newt = TREE_TYPE (newt);
 		    t = TREE_TYPE (t);
diff --git a/gcc/tree-object-size.cc b/gcc/tree-object-size.cc
index a62af050056..4b36484535c 100644
--- a/gcc/tree-object-size.cc
+++ b/gcc/tree-object-size.cc
@@ -1121,7 +1121,7 @@ compute_builtin_object_size (tree ptr, int object_size_type,
     return addr_object_size (NULL, ptr, object_size_type, psize);
 
   if (TREE_CODE (ptr) != SSA_NAME
-      || !POINTER_TYPE_P (TREE_TYPE (ptr)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (ptr)))
       return false;
 
   if (computed[object_size_type] == NULL)
@@ -1306,7 +1306,7 @@ expr_object_size (struct object_size_info *osi, tree ptr, tree value)
 
   /* Pointer variables should have been handled by merge_object_sizes.  */
   gcc_assert (TREE_CODE (value) != SSA_NAME
-	      || !POINTER_TYPE_P (TREE_TYPE (value)));
+	      || !INDIRECT_TYPE_P (TREE_TYPE (value)));
 
   if (TREE_CODE (value) == ADDR_EXPR)
     addr_object_size (osi, value, object_size_type, &bytes, &wholesize);
@@ -1561,7 +1561,7 @@ parm_object_size (struct object_size_info *osi, tree var)
   int object_size_type = osi->object_size_type;
   tree parm = SSA_NAME_VAR (var);
 
-  if (!(object_size_type & OST_DYNAMIC) || !POINTER_TYPE_P (TREE_TYPE (parm)))
+  if (!(object_size_type & OST_DYNAMIC) || !INDIRECT_TYPE_P (TREE_TYPE (parm)))
     {
       expr_object_size (osi, var, parm);
       return;
@@ -1749,7 +1749,7 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
                  || gimple_assign_unary_nop_p (stmt))
           {
             if (TREE_CODE (rhs) == SSA_NAME
-                && POINTER_TYPE_P (TREE_TYPE (rhs)))
+                && INDIRECT_TYPE_P (TREE_TYPE (rhs)))
 	      reexamine = merge_object_sizes (osi, var, rhs);
             else
               expr_object_size (osi, var, rhs);
@@ -1766,7 +1766,7 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
         if (arg)
           {
             if (TREE_CODE (arg) == SSA_NAME
-                && POINTER_TYPE_P (TREE_TYPE (arg)))
+                && INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	      reexamine = merge_object_sizes (osi, var, arg);
             else
               expr_object_size (osi, var, arg);
diff --git a/gcc/tree-outof-ssa.cc b/gcc/tree-outof-ssa.cc
index 0bf57a4bbc5..37ca0977259 100644
--- a/gcc/tree-outof-ssa.cc
+++ b/gcc/tree-outof-ssa.cc
@@ -690,7 +690,7 @@ get_temp_reg (tree name)
   if (reg_mode == BLKmode)
     return assign_temp (type, 0, 0);
   rtx x = gen_reg_rtx (reg_mode);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type)));
   return x;
 }
diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc
index 25d191b10fd..bb9cecd034c 100644
--- a/gcc/tree-pretty-print.cc
+++ b/gcc/tree-pretty-print.cc
@@ -1725,12 +1725,12 @@ dump_mem_ref (pretty_printer *pp, tree node, int spc, dump_flags_t flags)
 	  /* Enclose pointers to arrays in parentheses.  */
 	  tree op0 = TREE_OPERAND (node, 0);
 	  tree op0type = TREE_TYPE (op0);
-	  if (POINTER_TYPE_P (op0type)
+	  if (INDIRECT_TYPE_P (op0type)
 	      && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
 	    pp_left_paren (pp);
 	  pp_star (pp);
 	  dump_generic_node (pp, op0, spc, flags, false);
-	  if (POINTER_TYPE_P (op0type)
+	  if (INDIRECT_TYPE_P (op0type)
 	      && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
 	    pp_right_paren (pp);
 	}
@@ -2185,7 +2185,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
 
     case INTEGER_CST:
       if (flags & TDF_GIMPLE
-	  && (POINTER_TYPE_P (TREE_TYPE (node))
+	  && (INDIRECT_TYPE_P (TREE_TYPE (node))
 	      || (TYPE_PRECISION (TREE_TYPE (node))
 		  < TYPE_PRECISION (integer_type_node))
 	      || exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1
@@ -2238,7 +2238,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
 	  pp_string (pp, pp_buffer (pp)->digit_buffer);
 	}
       if ((flags & TDF_GIMPLE)
-	  && ! (POINTER_TYPE_P (TREE_TYPE (node))
+	  && ! (INDIRECT_TYPE_P (TREE_TYPE (node))
 		|| (TYPE_PRECISION (TREE_TYPE (node))
 		    < TYPE_PRECISION (integer_type_node))
 		|| exact_log2 (TYPE_PRECISION (TREE_TYPE (node))) == -1))
diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc
index da300d5f9e8..9e6bf8aaa2e 100644
--- a/gcc/tree-profile.cc
+++ b/gcc/tree-profile.cc
@@ -283,7 +283,7 @@ static tree
 prepare_instrumented_value (gimple_stmt_iterator *gsi, histogram_value value)
 {
   tree val = value->hvalue.value;
-  if (POINTER_TYPE_P (TREE_TYPE (val)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (val)))
     val = fold_convert (build_nonstandard_integer_type
 			  (TYPE_PRECISION (TREE_TYPE (val)), 1), val);
   return force_gimple_operand_gsi (gsi, fold_convert (gcov_type_node, val),
diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc
index 2abe8fa0b90..5fb5473667b 100644
--- a/gcc/tree-scalar-evolution.cc
+++ b/gcc/tree-scalar-evolution.cc
@@ -1353,7 +1353,7 @@ simplify_peeled_chrec (class loop *loop, tree arg, tree init_cond)
     }
 
   /* The affine code only deals with pointer and integer types.  */
-  if (!POINTER_TYPE_P (type)
+  if (!INDIRECT_TYPE_P (type)
       && !INTEGRAL_TYPE_P (type))
     return chrec_dont_know;
 
@@ -3198,7 +3198,7 @@ simple_iv_with_niters (class loop *wrto_loop, class loop *use_loop,
   iv->no_overflow = false;
 
   type = TREE_TYPE (op);
-  if (!POINTER_TYPE_P (type)
+  if (!INDIRECT_TYPE_P (type)
       && !INTEGRAL_TYPE_P (type))
     return false;
 
@@ -3311,7 +3311,7 @@ simple_iv_with_niters (class loop *wrto_loop, class loop *use_loop,
   if (!integer_zerop (e))
     return true;
 
-  if (POINTER_TYPE_P (TREE_TYPE (base)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (base)))
     code = POINTER_PLUS_EXPR;
   else
     code = PLUS_EXPR;
@@ -3738,7 +3738,7 @@ final_value_replacement_loop (class loop *loop)
 	  continue;
 	}
 
-      if (!POINTER_TYPE_P (TREE_TYPE (def))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (def))
 	  && !INTEGRAL_TYPE_P (TREE_TYPE (def)))
 	{
 	  gsi_next (&psi);
diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc
index 56a8ba26135..4725e7d0909 100644
--- a/gcc/tree-sra.cc
+++ b/gcc/tree-sra.cc
@@ -2823,7 +2823,7 @@ propagate_subaccesses_from_rhs (struct access *lacc, struct access *racc)
 	     so we need to put the reverse flag onto the access, if any.  */
 	  const bool reverse
 	    = TYPE_REVERSE_STORAGE_ORDER (lacc->type)
-	      && !POINTER_TYPE_P (racc->type)
+	      && !INDIRECT_TYPE_P (racc->type)
 	      && !VECTOR_TYPE_P (racc->type);
 	  tree t = lacc->base;
 
diff --git a/gcc/tree-ssa-address.cc b/gcc/tree-ssa-address.cc
index 0aaddde8d02..2c9e71081ef 100644
--- a/gcc/tree-ssa-address.cc
+++ b/gcc/tree-ssa-address.cc
@@ -383,7 +383,7 @@ create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr,
       index2 = addr->base;
     }
   else if (addr->base
-	   && POINTER_TYPE_P (TREE_TYPE (addr->base)))
+	   && INDIRECT_TYPE_P (TREE_TYPE (addr->base)))
     {
       base = addr->base;
       index2 = NULL_TREE;
@@ -494,7 +494,7 @@ move_pointer_to_base (struct mem_address *parts, aff_tree *addr)
 	continue;
 
       val = addr->elts[i].val;
-      if (POINTER_TYPE_P (TREE_TYPE (val)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (val)))
 	break;
     }
 
@@ -551,7 +551,7 @@ add_to_parts (struct mem_address *parts, tree elt)
 
   /* Add ELT to base.  */
   type = TREE_TYPE (parts->base);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     parts->base = fold_build_pointer_plus (parts->base, elt);
   else
     parts->base = fold_build2 (PLUS_EXPR, type, parts->base, elt);
diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc
index f31fd042c2a..dca612dc2c6 100644
--- a/gcc/tree-ssa-alias.cc
+++ b/gcc/tree-ssa-alias.cc
@@ -254,7 +254,7 @@ ptr_deref_may_alias_decl_p (tree ptr, tree decl)
   if ((TREE_CODE (ptr) != SSA_NAME
        && TREE_CODE (ptr) != ADDR_EXPR
        && TREE_CODE (ptr) != POINTER_PLUS_EXPR)
-      || !POINTER_TYPE_P (TREE_TYPE (ptr))
+      || !INDIRECT_TYPE_P (TREE_TYPE (ptr))
       || (!VAR_P (decl)
 	  && TREE_CODE (decl) != PARM_DECL
 	  && TREE_CODE (decl) != RESULT_DECL))
@@ -371,8 +371,8 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2)
   /* From here we require SSA name pointers.  Anything else aliases.  */
   if (TREE_CODE (ptr1) != SSA_NAME
       || TREE_CODE (ptr2) != SSA_NAME
-      || !POINTER_TYPE_P (TREE_TYPE (ptr1))
-      || !POINTER_TYPE_P (TREE_TYPE (ptr2)))
+      || !INDIRECT_TYPE_P (TREE_TYPE (ptr1))
+      || !INDIRECT_TYPE_P (TREE_TYPE (ptr2)))
     return true;
 
   /* We may end up with two empty points-to solutions for two same pointers.
@@ -585,7 +585,7 @@ dump_alias_info (FILE *file)
     {
       struct ptr_info_def *pi;
 
-      if (!POINTER_TYPE_P (TREE_TYPE (ptr))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (ptr))
 	  || SSA_NAME_IN_FREE_LIST (ptr))
 	continue;
 
@@ -873,7 +873,7 @@ ao_ref_init_from_ptr_and_range (ao_ref *ref, tree ptr,
     }
   else
     {
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (ptr)));
       ref->base = build2 (MEM_REF, char_type_node,
 			  ptr, null_pointer_node);
       ref->offset = 0;
@@ -998,8 +998,8 @@ same_type_for_tbaa (tree type1, tree type2)
 
   /* Pointers to void are considered compatible with all other pointers,
      so for two pointers see what the alias set resolution thinks.  */
-  if (POINTER_TYPE_P (type1)
-      && POINTER_TYPE_P (type2)
+  if (INDIRECT_TYPE_P (type1)
+      && INDIRECT_TYPE_P (type2)
       && alias_sets_conflict_p (set1, set2))
     return -1;
 
@@ -2660,7 +2660,7 @@ modref_may_conflict (const gcall *stmt,
 		continue;
 
 	      /* PTA oracle will be unhapy of arg is not an pointer.  */
-	      if (!POINTER_TYPE_P (TREE_TYPE (arg)))
+	      if (!INDIRECT_TYPE_P (TREE_TYPE (arg)))
 		return true;
 
 	      /* If we don't have base pointer, give up.  */
@@ -2703,7 +2703,7 @@ check_fnspec (gcall *call, ao_ref *ref, bool clobber)
 	  : !fnspec.global_memory_read_p ())
 	{
 	  for (unsigned int i = 0; i < gimple_call_num_args (call); i++)
-	    if (POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, i)))
+	    if (INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, i)))
 		&& (!fnspec.arg_specified_p (i)
 		    || (clobber ? fnspec.arg_maybe_written_p (i)
 			: fnspec.arg_maybe_read_p (i))))
diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc
index 64d5fa81334..945742f0321 100644
--- a/gcc/tree-ssa-ccp.cc
+++ b/gcc/tree-ssa-ccp.cc
@@ -608,7 +608,7 @@ get_value_from_alignment (tree expr)
 
   get_pointer_alignment_1 (expr, &align, &bitpos);
   val.mask = wi::bit_and_not
-    (POINTER_TYPE_P (type) || TYPE_UNSIGNED (type)
+    (INDIRECT_TYPE_P (type) || TYPE_UNSIGNED (type)
      ? wi::mask <widest_int> (TYPE_PRECISION (type), false)
      : -1,
      align / BITS_PER_UNIT - 1);
@@ -993,7 +993,7 @@ ccp_finalize (bool nonzero_p)
       ccp_prop_value_t *val;
       unsigned int tem, align;
 
-      if (!POINTER_TYPE_P (TREE_TYPE (name))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (name))
 	  && (!INTEGRAL_TYPE_P (TREE_TYPE (name))
 	      /* Don't record nonzero bits before IPA to avoid
 		 using too much memory.  */
@@ -1006,7 +1006,7 @@ ccp_finalize (bool nonzero_p)
 	  || val->mask == 0)
 	continue;
 
-      if (POINTER_TYPE_P (TREE_TYPE (name)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (name)))
 	{
 	  /* Trailing mask bits specify the alignment, trailing value
 	     bits the misalignment.  */
@@ -2304,9 +2304,9 @@ evaluate_stmt (gimple *stmt)
 	  tree rhs1 = gimple_assign_rhs1 (stmt);
 	  tree lhs = gimple_assign_lhs (stmt);
 	  if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-	       || POINTER_TYPE_P (TREE_TYPE (lhs)))
+	       || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	      && (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
-		  || POINTER_TYPE_P (TREE_TYPE (rhs1))))
+		  || INDIRECT_TYPE_P (TREE_TYPE (rhs1))))
 	    switch (get_gimple_rhs_class (subcode))
 	      {
 	      case GIMPLE_SINGLE_RHS:
@@ -2331,7 +2331,7 @@ evaluate_stmt (gimple *stmt)
 	  tree rhs1 = gimple_cond_lhs (stmt);
 	  tree rhs2 = gimple_cond_rhs (stmt);
 	  if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
-	      || POINTER_TYPE_P (TREE_TYPE (rhs1)))
+	      || INDIRECT_TYPE_P (TREE_TYPE (rhs1)))
 	    val = bit_value_binop (code, TREE_TYPE (rhs1), rhs1, rhs2);
 	}
       else if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
@@ -3053,7 +3053,7 @@ optimize_stack_restore (gimple_stmt_iterator i)
   if (gimple_code (call) != GIMPLE_CALL
       || gimple_call_num_args (call) != 1
       || TREE_CODE (gimple_call_arg (call, 0)) != SSA_NAME
-      || !POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
+      || !INDIRECT_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
     return NULL_TREE;
 
   for (gsi_next (&i); !gsi_end_p (i); gsi_next (&i))
@@ -3133,7 +3133,7 @@ optimize_stdarg_builtin (gimple *call)
   callee = gimple_call_fndecl (call);
 
   cfun_va_list = targetm.fn_abi_va_list (callee);
-  va_list_simple_ptr = POINTER_TYPE_P (cfun_va_list)
+  va_list_simple_ptr = INDIRECT_TYPE_P (cfun_va_list)
 		       && (TREE_TYPE (cfun_va_list) == void_type_node
 			   || TREE_TYPE (cfun_va_list) == char_type_node);
 
@@ -3149,7 +3149,7 @@ optimize_stdarg_builtin (gimple *call)
 	return NULL_TREE;
 
       lhs = gimple_call_arg (call, 0);
-      if (!POINTER_TYPE_P (TREE_TYPE (lhs))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (lhs))
 	  || TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (lhs)))
 	     != TYPE_MAIN_VARIANT (cfun_va_list))
 	return NULL_TREE;
@@ -3168,7 +3168,7 @@ optimize_stdarg_builtin (gimple *call)
 	return NULL_TREE;
 
       lhs = gimple_call_arg (call, 0);
-      if (!POINTER_TYPE_P (TREE_TYPE (lhs))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (lhs))
 	  || TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (lhs)))
 	     != TYPE_MAIN_VARIANT (cfun_va_list))
 	return NULL_TREE;
@@ -4001,7 +4001,7 @@ optimize_atomic_op_fetch_cmp_0 (gimple_stmt_iterator *gsip,
       use_lhs = gimple_assign_lhs (use_stmt);
       if (!tree_nop_conversion_p (TREE_TYPE (use_lhs), TREE_TYPE (lhs))
 	  || (!INTEGRAL_TYPE_P (TREE_TYPE (use_lhs))
-	      && !POINTER_TYPE_P (TREE_TYPE (use_lhs)))
+	      && !INDIRECT_TYPE_P (TREE_TYPE (use_lhs)))
 	  || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (use_lhs)
 	  || !single_imm_use (use_lhs, &use_p, &use_stmt))
 	return false;
diff --git a/gcc/tree-ssa-copy.cc b/gcc/tree-ssa-copy.cc
index 4cfa116326f..408066c2fb4 100644
--- a/gcc/tree-ssa-copy.cc
+++ b/gcc/tree-ssa-copy.cc
@@ -539,7 +539,7 @@ fini_copy_prop (void)
 	  basic_block copy_of_bb
 	    = gimple_bb (SSA_NAME_DEF_STMT (copy_of[i].value));
 	  basic_block var_bb = gimple_bb (SSA_NAME_DEF_STMT (var));
-	  if (POINTER_TYPE_P (TREE_TYPE (var))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (var))
 	      && SSA_NAME_PTR_INFO (var)
 	      && !SSA_NAME_PTR_INFO (copy_of[i].value))
 	    {
@@ -553,7 +553,7 @@ fini_copy_prop (void)
 	      if (var_bb != copy_of_bb)
 		reset_flow_sensitive_info (copy_of[i].value);
 	    }
-	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
+	  else if (!INDIRECT_TYPE_P (TREE_TYPE (var))
 		   && SSA_NAME_RANGE_INFO (var)
 		   && !SSA_NAME_RANGE_INFO (copy_of[i].value)
 		   && var_bb == copy_of_bb)
diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc
index f7f8b730877..0116ce92324 100644
--- a/gcc/tree-ssa-dom.cc
+++ b/gcc/tree-ssa-dom.cc
@@ -1385,7 +1385,7 @@ maybe_set_nonzero_bits (edge e, tree var)
 	return;
     }
   cst = gimple_assign_rhs2 (stmt);
-  if (POINTER_TYPE_P (TREE_TYPE (var)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (var)))
     {
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (var);
       if (pi && pi->misalign)
diff --git a/gcc/tree-ssa-dse.cc b/gcc/tree-ssa-dse.cc
index 9c6004cdce8..fe43792b326 100644
--- a/gcc/tree-ssa-dse.cc
+++ b/gcc/tree-ssa-dse.cc
@@ -1384,7 +1384,7 @@ dse_optimize_call (gimple_stmt_iterator *gsi, sbitmap live_bytes)
 	{
 	  tree arg = access_node.get_call_arg (stmt);
 
-	  if (!arg || !POINTER_TYPE_P (TREE_TYPE (arg)))
+	  if (!arg || !INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	    return false;
 
 	  if (integer_zerop (arg)
diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
index 047f9237dd4..1fa0590bc34 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -638,7 +638,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
 
       /* Else recurse if the conversion preserves the address value.  */
       if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-	   || POINTER_TYPE_P (TREE_TYPE (lhs)))
+	   || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	  && (TYPE_PRECISION (TREE_TYPE (lhs))
 	      >= TYPE_PRECISION (TREE_TYPE (def_rhs))))
 	return forward_propagate_addr_expr (lhs, def_rhs, single_use_p);
@@ -1108,7 +1108,7 @@ constant_pointer_difference (tree p1, tree p2)
       j = 0;
       do
 	{
-	  if (!POINTER_TYPE_P (TREE_TYPE (p)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (p)))
 	    break;
 	  if (TREE_CODE (p) == ADDR_EXPR)
 	    {
@@ -3613,7 +3613,7 @@ pass_forwprop::execute (function *fun)
 		  as well, as this is valid gimple.  */
 	       || (CONVERT_EXPR_CODE_P (code)
 		   && TREE_CODE (rhs) == ADDR_EXPR
-		   && POINTER_TYPE_P (TREE_TYPE (lhs))))
+		   && INDIRECT_TYPE_P (TREE_TYPE (lhs))))
 	      && TREE_CODE (TREE_OPERAND (rhs, 0)) != TARGET_MEM_REF)
 	    {
 	      tree base = get_base_address (TREE_OPERAND (rhs, 0));
diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc
index 58e19c1508e..f08a1beb85c 100644
--- a/gcc/tree-ssa-ifcombine.cc
+++ b/gcc/tree-ssa-ifcombine.cc
@@ -869,7 +869,7 @@ pass_tree_ifcombine::execute (function *fun)
 		  continue;
 		tree lhs = gimple_assign_lhs (ass);
 		if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-		     || POINTER_TYPE_P (TREE_TYPE (lhs)))
+		     || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 		    && arith_code_with_undefined_signed_overflow
 			 (gimple_assign_rhs_code (ass)))
 		  rewrite_to_defined_overflow (ass, true);
diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index 24e7fbc805a..c1110ed0307 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -188,7 +188,7 @@ should_duplicate_loop_header_p (basic_block header, class loop *loop,
 	gphi *phi = psi.phi ();
 	tree res = gimple_phi_result (phi);
 	if (INTEGRAL_TYPE_P (TREE_TYPE (res))
-	    || POINTER_TYPE_P (TREE_TYPE (res)))
+	    || INDIRECT_TYPE_P (TREE_TYPE (res)))
 	  gimple_set_uid (phi, 1 /* IV */);
 	else
 	  gimple_set_uid (phi, 0);
diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
index 243ce86dfc4..2f08d14bf45 100644
--- a/gcc/tree-ssa-loop-ivopts.cc
+++ b/gcc/tree-ssa-loop-ivopts.cc
@@ -1105,7 +1105,7 @@ determine_base_object_1 (tree *tp, int *walk_subtrees, void *wdata)
       else if (TREE_CODE (base) != MEM_REF)
 	obj = fold_convert (ptr_type_node, build_fold_addr_expr (base));
     }
-  else if (code == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (*tp)))
+  else if (code == SSA_NAME && INDIRECT_TYPE_P (TREE_TYPE (*tp)))
 	obj = fold_convert (ptr_type_node, *tp);
 
   if (!obj)
@@ -1241,7 +1241,7 @@ get_iv (struct ivopts_data *data, tree var)
   basic_block bb;
   tree type = TREE_TYPE (var);
 
-  if (!POINTER_TYPE_P (type)
+  if (!INDIRECT_TYPE_P (type)
       && !INTEGRAL_TYPE_P (type))
     return NULL;
 
@@ -1252,7 +1252,7 @@ get_iv (struct ivopts_data *data, tree var)
       if (!bb
 	  || !flow_bb_inside_loop_p (data->current_loop, bb))
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    type = sizetype;
 	  set_iv (data, var, var, build_int_cst (type, 0), true);
 	}
@@ -1333,7 +1333,7 @@ find_bivs (struct ivopts_data *data)
       base = fold_convert (type, base);
       if (step)
 	{
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    step = convert_to_ptrofftype (step);
 	  else
 	    step = fold_convert (type, step);
@@ -1606,7 +1606,7 @@ record_group_use (struct ivopts_data *data, tree *use_p,
     {
       unsigned int i;
 
-      gcc_assert (POINTER_TYPE_P (TREE_TYPE (iv->base)));
+      gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (iv->base)));
       tree addr_toffset;
       split_constant_offset (iv->base, &addr_base, &addr_toffset);
       addr_offset = int_cst_value (addr_toffset);
@@ -2969,7 +2969,7 @@ strip_offset (tree expr, poly_uint64_pod *offset)
 static tree
 generic_type_for (tree type)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     return unsigned_type_for (type);
 
   if (TYPE_UNSIGNED (type))
@@ -3011,7 +3011,7 @@ find_inv_vars_cb (tree *expr_p, int *ws ATTRIBUTE_UNUSED, void *data)
       if (!bb || !flow_bb_inside_loop_p (idata->current_loop, bb))
 	{
 	  tree steptype = TREE_TYPE (op);
-	  if (POINTER_TYPE_P (steptype))
+	  if (INDIRECT_TYPE_P (steptype))
 	    steptype = sizetype;
 	  set_iv (idata, op, op, build_int_cst (steptype, 0), true);
 	  record_invariant (idata, op, false);
@@ -3125,7 +3125,7 @@ add_candidate_1 (struct ivopts_data *data, tree base, tree step, bool important,
      better to actually force the pointer live and still use ivopts;
      for example, it would be enough to write the pointer into memory
      and keep it there until after the loop.  */
-  if (flag_keep_gc_roots_live && POINTER_TYPE_P (TREE_TYPE (base)))
+  if (flag_keep_gc_roots_live && INDIRECT_TYPE_P (TREE_TYPE (base)))
     return NULL;
 
   /* If BASE contains undefined SSA names make sure we only record
@@ -3287,7 +3287,7 @@ add_autoinc_candidates (struct ivopts_data *data, tree base, tree step,
       tree new_base;
       tree new_step = step;
 
-      if (POINTER_TYPE_P (TREE_TYPE (base)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (base)))
 	{
 	  new_step = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
 	  code = POINTER_PLUS_EXPR;
@@ -3380,7 +3380,7 @@ add_iv_candidate_for_biv (struct ivopts_data *data, struct iv *iv)
     add_candidate (data, iv->base, iv->step, true, NULL);
 
   /* The same, but with initial value zero.  */
-  if (POINTER_TYPE_P (TREE_TYPE (iv->base)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (iv->base)))
     add_candidate (data, size_int (0), iv->step, true, NULL);
   else
     add_candidate (data, build_int_cst (TREE_TYPE (iv->base), 0),
@@ -3531,7 +3531,7 @@ add_iv_candidate_for_use (struct ivopts_data *data, struct iv_use *use)
   /* Don't add candidate for iv_use with non integer, pointer or non-mode
      precision types, instead, add candidate for the corresponding scev in
      unsigned type with the same precision.  See PR93674 for more info.  */
-  if ((TREE_CODE (basetype) != INTEGER_TYPE && !POINTER_TYPE_P (basetype))
+  if ((TREE_CODE (basetype) != INTEGER_TYPE && !INDIRECT_TYPE_P (basetype))
       || !type_has_mode_precision_p (basetype))
     {
       basetype = lang_hooks.types.type_for_mode (TYPE_MODE (basetype),
@@ -3548,7 +3548,7 @@ add_iv_candidate_for_use (struct ivopts_data *data, struct iv_use *use)
 
   /* Record common candidate with initial value zero.  */
   basetype = TREE_TYPE (iv->base);
-  if (POINTER_TYPE_P (basetype))
+  if (INDIRECT_TYPE_P (basetype))
     basetype = sizetype;
   record_common_cand (data, build_int_cst (basetype, 0), iv->step, use);
 
@@ -4211,7 +4211,7 @@ get_debug_computation_at (class loop *loop, gimple *at,
 
   var = var_at_stmt (loop, cand, at);
 
-  if (POINTER_TYPE_P (ctype))
+  if (INDIRECT_TYPE_P (ctype))
     {
       ctype = unsigned_type_for (ctype);
       cbase = fold_convert (ctype, cbase);
@@ -4226,7 +4226,7 @@ get_debug_computation_at (class loop *loop, gimple *at,
   var = fold_build2 (MINUS_EXPR, TREE_TYPE (var), var, cbase);
   var = fold_build2 (EXACT_DIV_EXPR, TREE_TYPE (var), var,
 		     wide_int_to_tree (TREE_TYPE (var), rat));
-  if (POINTER_TYPE_P (utype))
+  if (INDIRECT_TYPE_P (utype))
     {
       var = fold_convert (sizetype, var);
       if (neg_p)
@@ -4898,8 +4898,8 @@ get_computation_cost (struct ivopts_data *data, struct iv_use *use,
   if (address_p
       || (use->iv->base_object
 	  && cand->iv->base_object
-	  && POINTER_TYPE_P (TREE_TYPE (use->iv->base_object))
-	  && POINTER_TYPE_P (TREE_TYPE (cand->iv->base_object))))
+	  && INDIRECT_TYPE_P (TREE_TYPE (use->iv->base_object))
+	  && INDIRECT_TYPE_P (TREE_TYPE (cand->iv->base_object))))
     {
       /* Do not try to express address of an object with computation based
 	 on address of a different object.  This may cause problems in rtl
@@ -5095,7 +5095,7 @@ cand_value_at (class loop *loop, struct iv_cand *cand, gimple *at,
   bool after_adjust = stmt_after_increment (loop, cand, at);
   tree steptype;
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     steptype = sizetype;
   else
     steptype = unsigned_type_for (type);
@@ -5135,7 +5135,7 @@ cand_value_at (class loop *loop, struct iv_cand *cand, gimple *at,
     aff_combination_add (&delta, &step);
 
   tree_to_aff_combination (iv->base, type, val);
-  if (!POINTER_TYPE_P (type))
+  if (!INDIRECT_TYPE_P (type))
     aff_combination_convert (val, steptype);
   aff_combination_add (val, &delta);
 }
@@ -6155,7 +6155,7 @@ determine_set_costs (struct ivopts_data *data)
       if (get_iv (data, op))
 	continue;
 
-      if (!POINTER_TYPE_P (TREE_TYPE (op))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (op))
 	  && !INTEGRAL_TYPE_P (TREE_TYPE (op)))
 	continue;
 
@@ -7414,10 +7414,10 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
   comp_op2 = force_gimple_operand (comp_op2, &seq, true, NULL);
   gimple_seq_add_seq (&stmt_list, seq);
 
-  if (POINTER_TYPE_P (TREE_TYPE (comp_op2)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (comp_op2)))
     std::swap (comp_op1, comp_op2);
 
-  if (POINTER_TYPE_P (TREE_TYPE (comp_op1)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (comp_op1)))
     {
       comp = fold_build_pointer_plus (comp_op1,
 				      fold_convert (sizetype, comp_op2));
@@ -7443,7 +7443,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
     {
       comp = force_gimple_operand (comp, &seq, true, NULL);
       gimple_seq_add_seq (&stmt_list, seq);
-      if (POINTER_TYPE_P (TREE_TYPE (tgt)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (tgt)))
 	{
 	  duplicate_ssa_name_ptr_info (comp, SSA_NAME_PTR_INFO (tgt));
 	  /* As this isn't a plain copy we have to reset alignment
diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc
index b2d3dcf406d..b291fb13f27 100644
--- a/gcc/tree-ssa-loop-manip.cc
+++ b/gcc/tree-ssa-loop-manip.cc
@@ -111,7 +111,7 @@ create_iv (tree base, tree_code incr_op, tree step, tree var, class loop *loop,
 	    }
 	}
     }
-  if (POINTER_TYPE_P (TREE_TYPE (base)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (base)))
     {
       if (TREE_CODE (base) == ADDR_EXPR)
 	mark_addressable (TREE_OPERAND (base, 0));
@@ -1482,10 +1482,10 @@ rewrite_phi_with_iv (loop_p loop,
   remove_phi_node (psi, false);
 
   atype = TREE_TYPE (res);
-  mtype = POINTER_TYPE_P (atype) ? sizetype : atype;
+  mtype = INDIRECT_TYPE_P (atype) ? sizetype : atype;
   val = fold_build2 (MULT_EXPR, mtype, unshare_expr (iv.step),
 		     fold_convert (mtype, main_iv));
-  val = fold_build2 (POINTER_TYPE_P (atype)
+  val = fold_build2 (INDIRECT_TYPE_P (atype)
 		     ? POINTER_PLUS_EXPR : PLUS_EXPR,
 		     atype, unshare_expr (iv.base), val);
   val = force_gimple_operand_gsi (gsi, val, false, NULL_TREE, true,
@@ -1551,11 +1551,11 @@ canonicalize_loop_ivs (class loop *loop, tree *nit, bool bump_in_latch)
       type = TREE_TYPE (res);
       if (virtual_operand_p (res)
 	  || (!INTEGRAL_TYPE_P (type)
-	      && !POINTER_TYPE_P (type))
+	      && !INDIRECT_TYPE_P (type))
 	  || TYPE_PRECISION (type) < precision)
 	continue;
 
-      uns = POINTER_TYPE_P (type) | TYPE_UNSIGNED (type);
+      uns = INDIRECT_TYPE_P (type) | TYPE_UNSIGNED (type);
 
       if (TYPE_PRECISION (type) > precision)
 	unsigned_p = uns;
diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc
index 5d398b67e68..fb2358e43a3 100644
--- a/gcc/tree-ssa-loop-niter.cc
+++ b/gcc/tree-ssa-loop-niter.cc
@@ -1038,7 +1038,7 @@ number_of_iterations_ne (class loop *loop, tree type, affine_iv *iv,
      will fit a signed type as well as an unsigned we can safely do
      this using the type of the IV if it is not pointer typed.  */
   tree mtype = type;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     mtype = niter_type;
   if (!niter->control.no_overflow
       && (integer_onep (s)
@@ -1155,7 +1155,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
   tree assumption = boolean_true_node, bound, noloop;
   bool fv_comp_no_overflow;
   tree type1 = type;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type1 = sizetype;
 
   if (TREE_CODE (mod) != INTEGER_CST)
@@ -1175,7 +1175,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
      as the code cannot rely on the object to that the pointer points being
      placed at the end of the address space (and more pragmatically,
      TYPE_{MIN,MAX}_VALUE is not defined for pointers).  */
-  if (integer_zerop (mod) || POINTER_TYPE_P (type))
+  if (integer_zerop (mod) || INDIRECT_TYPE_P (type))
     fv_comp_no_overflow = true;
   else if (!exit_must_be_taken)
     fv_comp_no_overflow = false;
@@ -1200,7 +1200,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
 	}
       if (mpz_cmp (mmod, bnds->below) < 0)
 	noloop = boolean_false_node;
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	noloop = fold_build2 (GT_EXPR, boolean_type_node,
 			      iv0->base,
 			      fold_build_pointer_plus (iv1->base, tmod));
@@ -1226,7 +1226,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
 	}
       if (mpz_cmp (mmod, bnds->below) < 0)
 	noloop = boolean_false_node;
-      else if (POINTER_TYPE_P (type))
+      else if (INDIRECT_TYPE_P (type))
 	noloop = fold_build2 (GT_EXPR, boolean_type_node,
 			      fold_build_pointer_plus (iv0->base,
 						       fold_build1 (NEGATE_EXPR,
@@ -1383,7 +1383,7 @@ assert_loop_rolls_lt (tree type, affine_iv *iv0, affine_iv *iv1,
 		      Gcc in general does not allow or handle objects larger
 		      than half of the address space, hence the upper bound
 		      is satisfied for pointers.  */
-		   || POINTER_TYPE_P (type));
+		   || INDIRECT_TYPE_P (type));
   mpz_clear (mstep);
   mpz_clear (max);
 
@@ -1391,7 +1391,7 @@ assert_loop_rolls_lt (tree type, affine_iv *iv0, affine_iv *iv1,
     return;
 
   type1 = type;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type1 = sizetype;
 
   /* Now the hard part; we must formulate the assumption(s) as expressions, and
@@ -1405,7 +1405,7 @@ assert_loop_rolls_lt (tree type, affine_iv *iv0, affine_iv *iv1,
       /* We need to know that iv0->base >= MIN + iv0->step - 1.  Since
 	 0 address never belongs to any object, we can assume this for
 	 pointers.  */
-      if (!POINTER_TYPE_P (type))
+      if (!INDIRECT_TYPE_P (type))
 	{
 	  bound = fold_build2 (PLUS_EXPR, type1,
 			       TYPE_MIN_VALUE (type), diff);
@@ -1424,7 +1424,7 @@ assert_loop_rolls_lt (tree type, affine_iv *iv0, affine_iv *iv1,
       diff = fold_build2 (PLUS_EXPR, type1,
 			  iv1->step, build_int_cst (type1, 1));
 
-      if (!POINTER_TYPE_P (type))
+      if (!INDIRECT_TYPE_P (type))
 	{
 	  bound = fold_build2 (PLUS_EXPR, type1,
 			       TYPE_MAX_VALUE (type), diff);
@@ -1556,7 +1556,7 @@ number_of_iterations_until_wrap (class loop *loop, tree type, affine_iv *iv0,
      Here, biasing IVbase by 1 step makes 'bound' be the value before wrap.
      */
   tree base_type = TREE_TYPE (niter->control.base);
-  if (POINTER_TYPE_P (base_type))
+  if (INDIRECT_TYPE_P (base_type))
     {
       tree utype = unsigned_type_for (base_type);
       niter->control.base
@@ -1711,7 +1711,7 @@ number_of_iterations_le (class loop *loop, tree type, affine_iv *iv0,
 {
   tree assumption;
   tree type1 = type;
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     type1 = sizetype;
 
   /* Say that IV0 is the control variable.  Then IV0 <= IV1 iff
@@ -1723,7 +1723,7 @@ number_of_iterations_le (class loop *loop, tree type, affine_iv *iv0,
      the address space (and more pragmatically, TYPE_{MIN,MAX}_VALUE is
      not defined for pointers).  */
 
-  if (!exit_must_be_taken && !POINTER_TYPE_P (type))
+  if (!exit_must_be_taken && !INDIRECT_TYPE_P (type))
     {
       if (integer_nonzerop (iv0->step))
 	assumption = fold_build2 (NE_EXPR, boolean_type_node,
@@ -1741,13 +1741,13 @@ number_of_iterations_le (class loop *loop, tree type, affine_iv *iv0,
 
   if (integer_nonzerop (iv0->step))
     {
-      if (POINTER_TYPE_P (type))
+      if (INDIRECT_TYPE_P (type))
 	iv1->base = fold_build_pointer_plus_hwi (iv1->base, 1);
       else
 	iv1->base = fold_build2 (PLUS_EXPR, type1, iv1->base,
 				 build_int_cst (type1, 1));
     }
-  else if (POINTER_TYPE_P (type))
+  else if (INDIRECT_TYPE_P (type))
     iv0->base = fold_build_pointer_plus_hwi (iv0->base, -1);
   else
     iv0->base = fold_build2 (MINUS_EXPR, type1,
@@ -1838,7 +1838,7 @@ number_of_iterations_cond (class loop *loop,
       code = swap_tree_comparison (code);
     }
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       /* Comparison of pointers is undefined unless both iv0 and iv1 point
 	 to the same object.  If they do, the control variable cannot wrap
@@ -1876,7 +1876,7 @@ number_of_iterations_cond (class loop *loop,
      This rarely occurs in practice, but it is simple enough to manage.  */
   if (!integer_zerop (iv0->step) && !integer_zerop (iv1->step))
     {
-      tree step_type = POINTER_TYPE_P (type) ? sizetype : type;
+      tree step_type = INDIRECT_TYPE_P (type) ? sizetype : type;
       tree step = fold_binary_to_constant (MINUS_EXPR, step_type,
 					   iv0->step, iv1->step);
 
@@ -1896,7 +1896,7 @@ number_of_iterations_cond (class loop *loop,
 	       || wi::gtu_p (wi::abs (wi::to_widest (step)),
 			     wi::abs (wi::to_widest (iv0->step))))
 	{
-	  if (POINTER_TYPE_P (type) && code != NE_EXPR)
+	  if (INDIRECT_TYPE_P (type) && code != NE_EXPR)
 	    /* For relational pointer compares we have further guarantees
 	       that the pointers always point to the same object (or one
 	       after it) and that objects do not cross the zero page.  So
@@ -3155,7 +3155,7 @@ number_of_iterations_exit_assumptions (class loop *loop, edge exit,
   type = TREE_TYPE (op0);
 
   if (TREE_CODE (type) != INTEGER_TYPE
-      && !POINTER_TYPE_P (type))
+      && !INDIRECT_TYPE_P (type))
     return false;
 
   tree iv0_niters = NULL_TREE;
@@ -5176,7 +5176,7 @@ nowrap_type_p (tree type)
       && TYPE_OVERFLOW_UNDEFINED (type))
     return true;
 
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     return true;
 
   return false;
@@ -5289,7 +5289,7 @@ loop_exits_before_overflow (tree base, tree step,
 
 	     by proving the reverse conditions are false using loop's initial
 	     condition.  */
-	  if (POINTER_TYPE_P (TREE_TYPE (base)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (base)))
 	    code = POINTER_PLUS_EXPR;
 	  else
 	    code = PLUS_EXPR;
diff --git a/gcc/tree-ssa-loop-split.cc b/gcc/tree-ssa-loop-split.cc
index b41b5e614c2..962a88823f5 100644
--- a/gcc/tree-ssa-loop-split.cc
+++ b/gcc/tree-ssa-loop-split.cc
@@ -399,7 +399,7 @@ compute_new_first_bound (gimple_seq *stmts, class tree_niter_desc *niter,
 					   stmts, true, NULL_TREE);
   tree controlstep = niter->control.step;
   tree enddiff;
-  if (POINTER_TYPE_P (TREE_TYPE (controlbase)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (controlbase)))
     {
       controlstep = gimple_build (stmts, NEGATE_EXPR,
 				  TREE_TYPE (controlstep), controlstep);
@@ -417,7 +417,7 @@ compute_new_first_bound (gimple_seq *stmts, class tree_niter_desc *niter,
   tree end = force_gimple_operand (niter->bound, &stmts2,
 					true, NULL_TREE);
   gimple_seq_add_seq_without_update (stmts, stmts2);
-  if (POINTER_TYPE_P (TREE_TYPE (enddiff)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (enddiff)))
     {
       tree tem = gimple_convert (stmts, sizetype, enddiff);
       tem = gimple_build (stmts, NEGATE_EXPR, sizetype, tem);
@@ -432,7 +432,7 @@ compute_new_first_bound (gimple_seq *stmts, class tree_niter_desc *niter,
   /* Compute guard_init + (end-beg).  */
   tree newbound;
   enddiff = gimple_convert (stmts, TREE_TYPE (guard_init), enddiff);
-  if (POINTER_TYPE_P (TREE_TYPE (guard_init)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (guard_init)))
     {
       enddiff = gimple_convert (stmts, sizetype, enddiff);
       newbound = gimple_build (stmts, POINTER_PLUS_EXPR,
@@ -467,10 +467,10 @@ compute_new_first_bound (gimple_seq *stmts, class tree_niter_desc *niter,
   if (addbound)
     {
       tree type2 = TREE_TYPE (newbound);
-      if (POINTER_TYPE_P (type2))
+      if (INDIRECT_TYPE_P (type2))
 	type2 = sizetype;
       newbound = gimple_build (stmts,
-			       POINTER_TYPE_P (TREE_TYPE (newbound))
+			       INDIRECT_TYPE_P (TREE_TYPE (newbound))
 			       ? POINTER_PLUS_EXPR : PLUS_EXPR,
 			       TREE_TYPE (newbound),
 			       newbound,
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 467c9fd108a..f78e8e36707 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -1322,7 +1322,7 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
   gimple *assign = gsi_stmt (gsi);
   if (!is_gimple_assign (assign)
       || (!INTEGRAL_TYPE_P (TREE_TYPE (arg0))
-	  && !POINTER_TYPE_P (TREE_TYPE (arg0))))
+	  && !INDIRECT_TYPE_P (TREE_TYPE (arg0))))
     return 0;
 
   if (gimple_assign_rhs_class (assign) != GIMPLE_BINARY_RHS)
diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc
index b01ef4495c2..2fca59ceeda 100644
--- a/gcc/tree-ssa-phiprop.cc
+++ b/gcc/tree-ssa-phiprop.cc
@@ -289,7 +289,7 @@ propagate_with_phi (basic_block bb, gphi *phi, struct phiprop_d *phivn,
   bool changed;
   tree type = NULL_TREE;
 
-  if (!POINTER_TYPE_P (TREE_TYPE (ptr))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (ptr))
       || (!is_gimple_reg_type (TREE_TYPE (TREE_TYPE (ptr)))
 	  && TYPE_MODE (TREE_TYPE (TREE_TYPE (ptr))) == BLKmode))
     return false;
diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc
index eda03bf98a6..e6083987629 100644
--- a/gcc/tree-ssa-reassoc.cc
+++ b/gcc/tree-ssa-reassoc.cc
@@ -2920,7 +2920,7 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
 	if (is_gimple_assign (stmt))
 	  if (tree lhs = gimple_assign_lhs (stmt))
 	    if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
-		 || POINTER_TYPE_P (TREE_TYPE (lhs)))
+		 || INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 		&& TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (lhs)))
 	      {
 		enum tree_code code = gimple_assign_rhs_code (stmt);
@@ -3629,13 +3629,13 @@ optimize_range_tests_cmp_bitwise (enum tree_code opcode, int first, int length,
 	tree type2 = NULL_TREE;
 	bool strict_overflow_p = false;
 	candidates.truncate (0);
-	if (POINTER_TYPE_P (type1) || TREE_CODE (type1) == OFFSET_TYPE)
+	if (INDIRECT_TYPE_P (type1) || TREE_CODE (type1) == OFFSET_TYPE)
 	  type1 = pointer_sized_int_node;
 	for (j = i; j; j = chains[j - 1])
 	  {
 	    tree type = TREE_TYPE (ranges[j - 1].exp);
 	    strict_overflow_p |= ranges[j - 1].strict_overflow_p;
-	    if (POINTER_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE)
+	    if (INDIRECT_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE)
 	      type = pointer_sized_int_node;
 	    if ((b % 4) == 3)
 	      {
@@ -3667,7 +3667,7 @@ optimize_range_tests_cmp_bitwise (enum tree_code opcode, int first, int length,
 	    tree type = TREE_TYPE (ranges[j - 1].exp);
 	    if (j == k)
 	      continue;
-	    if (POINTER_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE)
+	    if (INDIRECT_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE)
 	      type = pointer_sized_int_node;
 	    if ((b % 4) == 3)
 	      {
@@ -3699,7 +3699,7 @@ optimize_range_tests_cmp_bitwise (enum tree_code opcode, int first, int length,
 		continue;
 	      }
 	    if (id == l
-		|| POINTER_TYPE_P (TREE_TYPE (op))
+		|| INDIRECT_TYPE_P (TREE_TYPE (op))
 		|| TREE_CODE (TREE_TYPE (op)) == OFFSET_TYPE)
 	      {
 		code = (b % 4) == 3 ? BIT_NOT_EXPR : NOP_EXPR;
@@ -3718,7 +3718,7 @@ optimize_range_tests_cmp_bitwise (enum tree_code opcode, int first, int length,
 	      }
 	    tree type = TREE_TYPE (r->exp);
 	    tree exp = r->exp;
-	    if (POINTER_TYPE_P (type)
+	    if (INDIRECT_TYPE_P (type)
 		|| TREE_CODE (type) == OFFSET_TYPE
 		|| (id >= l && !useless_type_conversion_p (type1, type)))
 	      {
@@ -3737,7 +3737,7 @@ optimize_range_tests_cmp_bitwise (enum tree_code opcode, int first, int length,
 	    op = gimple_assign_lhs (g);
 	  }
 	type1 = TREE_TYPE (ranges[k - 1].exp);
-	if (POINTER_TYPE_P (type1) || TREE_CODE (type1) == OFFSET_TYPE)
+	if (INDIRECT_TYPE_P (type1) || TREE_CODE (type1) == OFFSET_TYPE)
 	  {
 	    gimple *g
 	      = gimple_build_assign (make_ssa_name (type1), NOP_EXPR, op);
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 11061a374a2..1499ca8c4fc 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -476,7 +476,7 @@ VN_INFO (tree name)
 	   if we know it is a non-NULL pointer.  */
 	newinfo->visited = true;
 	newinfo->valnum = name;
-	if (POINTER_TYPE_P (TREE_TYPE (name))
+	if (INDIRECT_TYPE_P (TREE_TYPE (name))
 	    && nonnull_arg_p (SSA_NAME_VAR (name)))
 	  {
 	    tree ops[2];
@@ -6752,7 +6752,7 @@ eliminate_dom_walker::eliminate_stmt (basic_block b, gimple_stmt_iterator *gsi)
 	  && TREE_CODE (sprime) == SSA_NAME)
 	{
 	  basic_block sprime_b = gimple_bb (SSA_NAME_DEF_STMT (sprime));
-	  if (POINTER_TYPE_P (TREE_TYPE (lhs))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (lhs))
 	      && SSA_NAME_PTR_INFO (lhs)
 	      && ! SSA_NAME_PTR_INFO (sprime))
 	    {
@@ -6883,7 +6883,7 @@ eliminate_dom_walker::eliminate_stmt (basic_block b, gimple_stmt_iterator *gsi)
 	      /* We preserve conversions to but not from function or method
 		 types.  This asymmetry makes it necessary to re-instantiate
 		 conversions here.  */
-	      if (POINTER_TYPE_P (TREE_TYPE (lhs))
+	      if (INDIRECT_TYPE_P (TREE_TYPE (lhs))
 		  && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (lhs))))
 		sprime = fold_convert (TREE_TYPE (lhs), sprime);
 	      else
diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc
index 4bf183072d9..339d6144b37 100644
--- a/gcc/tree-ssa-strlen.cc
+++ b/gcc/tree-ssa-strlen.cc
@@ -1358,7 +1358,7 @@ maybe_invalidate (gimple *stmt, bool zero_write = false)
 
   for (unsigned i = 1; vec_safe_iterate (stridx_to_strinfo, i, &si); ++i)
     {
-      if (si == NULL || !POINTER_TYPE_P (TREE_TYPE (si->ptr)))
+      if (si == NULL || !INDIRECT_TYPE_P (TREE_TYPE (si->ptr)))
 	continue;
 
       nonempty = true;
@@ -1673,7 +1673,7 @@ find_equal_ptrs (tree ptr, int idx)
 	case SSA_NAME:
 	  break;
 	CASE_CONVERT:
-	  if (!POINTER_TYPE_P (TREE_TYPE (ptr)))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	    return;
 	  if (TREE_CODE (ptr) == SSA_NAME)
 	    break;
@@ -5654,11 +5654,11 @@ strlen_pass::check_and_optimize_stmt (bool *cleanup_eh)
       tree lhs = gimple_assign_lhs (stmt);
       tree lhs_type = TREE_TYPE (lhs);
 
-      if (TREE_CODE (lhs) == SSA_NAME && POINTER_TYPE_P (lhs_type))
+      if (TREE_CODE (lhs) == SSA_NAME && INDIRECT_TYPE_P (lhs_type))
 	{
 	  if (gimple_assign_single_p (stmt)
 	      || (gimple_assign_cast_p (stmt)
-		  && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
+		  && INDIRECT_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
 	    {
 	      int idx = get_stridx (gimple_assign_rhs1 (stmt), stmt);
 	      ssa_ver_to_stridx[SSA_NAME_VERSION (lhs)] = idx;
@@ -5804,7 +5804,7 @@ strlen_pass::before_dom_children (basic_block bb)
     {
       gphi *phi = gsi.phi ();
       tree result = gimple_phi_result (phi);
-      if (!virtual_operand_p (result) && POINTER_TYPE_P (TREE_TYPE (result)))
+      if (!virtual_operand_p (result) && INDIRECT_TYPE_P (TREE_TYPE (result)))
 	{
 	  int idx = get_stridx (gimple_phi_arg_def (phi, 0), phi);
 	  if (idx != 0)
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index ee9313c59ca..9d2d55e4527 100644
--- a/gcc/tree-ssa-structalias.cc
+++ b/gcc/tree-ssa-structalias.cc
@@ -5813,7 +5813,7 @@ var_can_have_subvars (const_tree v)
 static bool
 type_must_have_pointers (tree type)
 {
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     return true;
 
   if (TREE_CODE (type) == ARRAY_TYPE)
@@ -5924,7 +5924,7 @@ push_fields_onto_fieldstack (tree type, vec<fieldoff_s> *fieldstack,
 		e.may_have_pointers = true;
 		e.only_restrict_pointers
 		  = (!has_unknown_size
-		     && POINTER_TYPE_P (field_type)
+		     && INDIRECT_TYPE_P (field_type)
 		     && TYPE_RESTRICT (field_type));
 		if (e.only_restrict_pointers)
 		  e.restrict_pointed_type = TREE_TYPE (field_type);
@@ -6284,7 +6284,7 @@ create_variable_info_for_1 (tree decl, const char *name, bool add_id,
       vi->fullsize = tree_to_uhwi (declsize);
       vi->size = vi->fullsize;
       vi->is_full_var = true;
-      if (POINTER_TYPE_P (decl_type)
+      if (INDIRECT_TYPE_P (decl_type)
 	  && (TYPE_RESTRICT (decl_type) || add_restrict))
 	vi->only_restrict_pointers = 1;
       if (vi->only_restrict_pointers
@@ -6420,7 +6420,7 @@ create_variable_info_for (tree decl, const char *name, bool add_id)
 	continue;
 
       /* Mark global restrict qualified pointers.  */
-      if ((POINTER_TYPE_P (TREE_TYPE (decl))
+      if ((INDIRECT_TYPE_P (TREE_TYPE (decl))
 	   && TYPE_RESTRICT (TREE_TYPE (decl)))
 	  || vi->only_restrict_pointers)
 	{
@@ -7640,7 +7640,7 @@ compute_points_to_sets (void)
 
   FOR_EACH_SSA_NAME (i, ptr, cfun)
     {
-      if (POINTER_TYPE_P (TREE_TYPE (ptr)))
+      if (INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	find_what_p_points_to (cfun->decl, ptr);
     }
 
@@ -7931,7 +7931,7 @@ compute_dependence_clique (void)
   for (unsigned i = 0; i < num_ssa_names; ++i)
     {
       tree ptr = ssa_name (i);
-      if (!ptr || !POINTER_TYPE_P (TREE_TYPE (ptr)))
+      if (!ptr || !INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	continue;
 
       /* Avoid all this when ptr is not dereferenced?  */
@@ -8560,7 +8560,7 @@ ipa_pta_execute (void)
       FOR_EACH_VEC_ELT (*fn->gimple_df->ssa_names, i, ptr)
 	{
 	  if (ptr
-	      && POINTER_TYPE_P (TREE_TYPE (ptr)))
+	      && INDIRECT_TYPE_P (TREE_TYPE (ptr)))
 	    find_what_p_points_to (node->decl, ptr);
 	}
 
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 72a7d4d14d8..4a1f8d0231b 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -400,7 +400,7 @@ jump_threader::simplify_control_stmt_condition (edge e, gimple *stmt)
 	  tree op1 = gimple_cond_rhs (stmt);
 
 	  if ((INTEGRAL_TYPE_P (TREE_TYPE (op0))
-	       || POINTER_TYPE_P (TREE_TYPE (op0)))
+	       || INDIRECT_TYPE_P (TREE_TYPE (op0)))
 	      && TREE_CODE (op0) == SSA_NAME
 	      && TREE_CODE (op1) == INTEGER_CST)
 	    return op0;
diff --git a/gcc/tree-ssa-uninit.cc b/gcc/tree-ssa-uninit.cc
index f42f76cd5c6..40625245ec9 100644
--- a/gcc/tree-ssa-uninit.cc
+++ b/gcc/tree-ssa-uninit.cc
@@ -360,7 +360,7 @@ builtin_call_nomodifying_p (gimple *stmt)
 
       ++argno;
 
-      if (!POINTER_TYPE_P (argtype))
+      if (!INDIRECT_TYPE_P (argtype))
 	continue;
 
       if (TYPE_READONLY (TREE_TYPE (argtype)))
@@ -382,7 +382,7 @@ builtin_call_nomodifying_p (gimple *stmt)
     {
       tree arg = gimple_call_arg (stmt, argno);
       argtype = TREE_TYPE (arg);
-      if (!POINTER_TYPE_P (argtype))
+      if (!INDIRECT_TYPE_P (argtype))
 	continue;
 
       if (TYPE_READONLY (TREE_TYPE (argtype)))
@@ -717,7 +717,7 @@ maybe_warn_operand (ao_ref &ref, gimple *stmt, tree lhs, tree rhs,
      The first_field() test is important for C++ where the predicate
      alone isn't always sufficient.  */
   tree rhstype = TREE_TYPE (rhs);
-  if (POINTER_TYPE_P (rhstype))
+  if (INDIRECT_TYPE_P (rhstype))
     rhstype = TREE_TYPE (rhstype);
   if (is_empty_type (rhstype))
     return NULL_TREE;
@@ -803,7 +803,7 @@ maybe_warn_pass_by_reference (gcall *stmt, wlimits &wlims)
       if (argno > nargs)
 	break;
 
-      if (!POINTER_TYPE_P (argtype))
+      if (!INDIRECT_TYPE_P (argtype))
 	continue;
 
       tree access_size = NULL_TREE;
@@ -846,7 +846,7 @@ maybe_warn_pass_by_reference (gcall *stmt, wlimits &wlims)
 	continue;
 
       tree arg = gimple_call_arg (stmt, argno - 1);
-      if (!POINTER_TYPE_P (TREE_TYPE (arg)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (arg)))
 	/* Avoid actual arguments with invalid types.  */
 	continue;
 
diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc
index ebba02b8449..fcdead898c4 100644
--- a/gcc/tree-ssa.cc
+++ b/gcc/tree-ssa.cc
@@ -1071,7 +1071,7 @@ verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
 	    }
 
 	  void *info = NULL;
-	  if (POINTER_TYPE_P (TREE_TYPE (name)))
+	  if (INDIRECT_TYPE_P (TREE_TYPE (name)))
 	    info = SSA_NAME_PTR_INFO (name);
 	  else if (INTEGRAL_TYPE_P (TREE_TYPE (name)))
 	    info = SSA_NAME_RANGE_INFO (name);
diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc
index f54394363a0..ea3d1651f57 100644
--- a/gcc/tree-ssanames.cc
+++ b/gcc/tree-ssanames.cc
@@ -397,7 +397,7 @@ make_ssa_name_fn (struct function *fn, tree var, gimple *stmt,
       SET_SSA_NAME_VAR_OR_IDENTIFIER (t, var);
     }
   SSA_NAME_DEF_STMT (t) = stmt;
-  if (POINTER_TYPE_P (TREE_TYPE (t)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (t)))
     SSA_NAME_PTR_INFO (t) = NULL;
   else
     SSA_NAME_RANGE_INFO (t) = NULL;
@@ -419,7 +419,7 @@ set_range_info (tree name, const vrange &r)
     return false;
 
   tree type = TREE_TYPE (name);
-  if (POINTER_TYPE_P (type))
+  if (INDIRECT_TYPE_P (type))
     {
       if (r.nonzero_p ())
 	{
@@ -448,7 +448,7 @@ set_range_info (tree name, const vrange &r)
 void
 set_ptr_nonnull (tree name)
 {
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (name)));
   struct ptr_info_def *pi = get_ptr_info (name);
   pi->pt.null = 0;
 }
@@ -458,7 +458,7 @@ set_ptr_nonnull (tree name)
 void
 set_nonzero_bits (tree name, const wide_int &mask)
 {
-  gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
+  gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (name)));
 
   int_range<2> r (TREE_TYPE (name));
   r.set_nonzero_bits (mask);
@@ -473,7 +473,7 @@ set_nonzero_bits (tree name, const wide_int &mask)
 void
 set_bitmask (tree name, const wide_int &value, const wide_int &mask)
 {
-  gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
+  gcc_assert (!INDIRECT_TYPE_P (TREE_TYPE (name)));
 
   int_range<2> r (TREE_TYPE (name));
   r.update_bitmask (irange_bitmask (value, mask));
@@ -492,7 +492,7 @@ get_nonzero_bits (const_tree name)
   /* Use element_precision instead of TYPE_PRECISION so complex and
      vector types get a non-zero precision.  */
   unsigned int precision = element_precision (TREE_TYPE (name));
-  if (POINTER_TYPE_P (TREE_TYPE (name)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (name)))
     {
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
       if (pi && pi->align)
@@ -691,7 +691,7 @@ get_ptr_info (tree t)
 {
   struct ptr_info_def *pi;
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (t)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (t)));
 
   pi = SSA_NAME_PTR_INFO (t);
   if (pi == NULL)
@@ -734,7 +734,7 @@ duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
 {
   struct ptr_info_def *new_ptr_info;
 
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (name)));
   gcc_assert (!SSA_NAME_PTR_INFO (name));
 
   if (!ptr_info)
@@ -749,7 +749,7 @@ duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
 void
 duplicate_ssa_name_range_info (tree name, tree src)
 {
-  gcc_checking_assert (!POINTER_TYPE_P (TREE_TYPE (src)));
+  gcc_checking_assert (!INDIRECT_TYPE_P (TREE_TYPE (src)));
   gcc_checking_assert (!range_info_p (name));
 
   if (range_info_p (src))
@@ -768,7 +768,7 @@ tree
 duplicate_ssa_name_fn (struct function *fn, tree name, gimple *stmt)
 {
   tree new_name = copy_ssa_name_fn (fn, name, stmt);
-  if (POINTER_TYPE_P (TREE_TYPE (name)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (name)))
     {
       struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name);
 
@@ -788,7 +788,7 @@ duplicate_ssa_name_fn (struct function *fn, tree name, gimple *stmt)
 void
 reset_flow_sensitive_info (tree name)
 {
-  if (POINTER_TYPE_P (TREE_TYPE (name)))
+  if (INDIRECT_TYPE_P (TREE_TYPE (name)))
     {
       /* points-to info is not flow-sensitive.  */
       if (SSA_NAME_PTR_INFO (name))
diff --git a/gcc/tree-stdarg.cc b/gcc/tree-stdarg.cc
index f522181248d..421a0023f46 100644
--- a/gcc/tree-stdarg.cc
+++ b/gcc/tree-stdarg.cc
@@ -458,7 +458,7 @@ va_list_ptr_write (struct stdarg_info *si, tree ap, tree tem2)
 static void
 check_va_list_escapes (struct stdarg_info *si, tree lhs, tree rhs)
 {
-  if (! POINTER_TYPE_P (TREE_TYPE (rhs)))
+  if (! INDIRECT_TYPE_P (TREE_TYPE (rhs)))
     return;
 
   if (TREE_CODE (rhs) == SSA_NAME)
@@ -675,7 +675,7 @@ optimize_va_list_gpr_fpr_size (function *fun)
     funcname = lang_hooks.decl_printable_name (current_function_decl, 2);
 
   cfun_va_list = targetm.fn_abi_va_list (fun->decl);
-  va_list_simple_ptr = POINTER_TYPE_P (cfun_va_list)
+  va_list_simple_ptr = INDIRECT_TYPE_P (cfun_va_list)
 		       && (TREE_TYPE (cfun_va_list) == void_type_node
 			   || TREE_TYPE (cfun_va_list) == char_type_node);
   gcc_assert (is_gimple_reg_type (cfun_va_list) == va_list_simple_ptr);
@@ -1014,7 +1014,7 @@ expand_ifn_va_arg_1 (function *fun)
 	type = TREE_TYPE (TREE_TYPE (gimple_call_arg (stmt, 1)));
 	ap = gimple_call_arg (stmt, 0);
 	aptype = TREE_TYPE (gimple_call_arg (stmt, 2));
-	gcc_assert (POINTER_TYPE_P (aptype));
+	gcc_assert (INDIRECT_TYPE_P (aptype));
 
 	/* Balanced out the &ap, usually added by build_va_arg.  */
 	ap = build2 (MEM_REF, TREE_TYPE (aptype), ap,
diff --git a/gcc/tree-streamer-in.cc b/gcc/tree-streamer-in.cc
index 5bead0c3c6a..699ce26ee08 100644
--- a/gcc/tree-streamer-in.cc
+++ b/gcc/tree-streamer-in.cc
@@ -854,7 +854,7 @@ lto_input_ts_type_non_common_tree_pointers (class lto_input_block *ib,
   else if (FUNC_OR_METHOD_TYPE_P (expr))
     TYPE_ARG_TYPES (expr) = stream_read_tree_ref (ib, data_in);
 
-  if (!POINTER_TYPE_P (expr))
+  if (!INDIRECT_TYPE_P (expr))
     TYPE_MIN_VALUE_RAW (expr) = stream_read_tree_ref (ib, data_in);
   TYPE_MAX_VALUE_RAW (expr) = stream_read_tree_ref (ib, data_in);
 }
diff --git a/gcc/tree-streamer-out.cc b/gcc/tree-streamer-out.cc
index ff9694e17dd..7a18e7af00d 100644
--- a/gcc/tree-streamer-out.cc
+++ b/gcc/tree-streamer-out.cc
@@ -745,7 +745,7 @@ write_ts_type_non_common_tree_pointers (struct output_block *ob, tree expr)
   else if (FUNC_OR_METHOD_TYPE_P (expr))
     stream_write_tree_ref (ob, TYPE_ARG_TYPES (expr));
 
-  if (!POINTER_TYPE_P (expr))
+  if (!INDIRECT_TYPE_P (expr))
     stream_write_tree_ref (ob, TYPE_MIN_VALUE_RAW (expr));
   stream_write_tree_ref (ob, TYPE_MAX_VALUE_RAW (expr));
 }
diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc
index 04355dfcf44..cd63297b7a1 100644
--- a/gcc/tree-tailcall.cc
+++ b/gcc/tree-tailcall.cc
@@ -720,7 +720,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
     return;
 
   /* For pointers only allow additions.  */
-  if (m && POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl))))
+  if (m && INDIRECT_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl))))
     return;
 
   /* Move queued defs.  */
@@ -788,7 +788,7 @@ adjust_return_value_with_ops (enum tree_code code, const char *label,
   tree result = make_temp_ssa_name (ret_type, NULL, label);
   gassign *stmt;
 
-  if (POINTER_TYPE_P (ret_type))
+  if (INDIRECT_TYPE_P (ret_type))
     {
       gcc_assert (code == PLUS_EXPR && TREE_TYPE (acc) == sizetype);
       code = POINTER_PLUS_EXPR;
@@ -1081,7 +1081,7 @@ static tree
 create_tailcall_accumulator (const char *label, basic_block bb, tree init)
 {
   tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-  if (POINTER_TYPE_P (ret_type))
+  if (INDIRECT_TYPE_P (ret_type))
     ret_type = sizetype;
 
   tree tmp = make_temp_ssa_name (ret_type, NULL, label);
@@ -1162,7 +1162,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
 	  phis_constructed = true;
 	}
       tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-      if (POINTER_TYPE_P (ret_type))
+      if (INDIRECT_TYPE_P (ret_type))
 	ret_type = sizetype;
 
       if (act->add && !a_acc)
diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index 9edc8989de9..64d839e61c2 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -4163,7 +4163,7 @@ vect_check_gather_scatter (stmt_vec_info stmt_info, loop_vec_info loop_vinfo,
 	  off = op0;
 	  continue;
 	CASE_CONVERT:
-	  if (!POINTER_TYPE_P (TREE_TYPE (op0))
+	  if (!INDIRECT_TYPE_P (TREE_TYPE (op0))
 	      && !INTEGRAL_TYPE_P (TREE_TYPE (op0)))
 	    break;
 
@@ -4171,7 +4171,7 @@ vect_check_gather_scatter (stmt_vec_info stmt_info, loop_vec_info loop_vinfo,
 	     the current offset type.  */
 	  if (use_ifn_p
 	      && TREE_CODE (off) == SSA_NAME
-	      && !POINTER_TYPE_P (TREE_TYPE (off))
+	      && !INDIRECT_TYPE_P (TREE_TYPE (off))
 	      && vect_gather_scatter_fn_p (loop_vinfo, DR_IS_READ (dr),
 					   masked_p, vectype, memory_type,
 					   TREE_TYPE (off), scale, &ifn,
diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc
index 30baac6db44..d8704bf90e4 100644
--- a/gcc/tree-vect-loop-manip.cc
+++ b/gcc/tree-vect-loop-manip.cc
@@ -2013,7 +2013,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo,
 	  tree stype = TREE_TYPE (step_expr);
 	  off = fold_build2 (MULT_EXPR, stype,
 			     fold_convert (stype, niters), step_expr);
-	  if (POINTER_TYPE_P (type))
+	  if (INDIRECT_TYPE_P (type))
 	    ni = fold_build_pointer_plus (init_expr, off);
 	  else
 	    ni = fold_convert (type,
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index b44fb9c7712..a6662a5e092 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -5302,7 +5302,7 @@ get_initial_def_for_reduction (loop_vec_info loop_vinfo,
 
   gcc_assert (vectype);
 
-  gcc_assert (POINTER_TYPE_P (scalar_type) || INTEGRAL_TYPE_P (scalar_type)
+  gcc_assert (INDIRECT_TYPE_P (scalar_type) || INTEGRAL_TYPE_P (scalar_type)
 	      || SCALAR_FLOAT_TYPE_P (scalar_type));
 
   gcc_assert (nested_in_vect_loop_p (loop, reduc_info)
@@ -7338,7 +7338,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
 			    || op.code == WIDEN_SUM_EXPR
 			    || op.code == SAD_EXPR);
 
-  if (!POINTER_TYPE_P (op.type) && !INTEGRAL_TYPE_P (op.type)
+  if (!INDIRECT_TYPE_P (op.type) && !INTEGRAL_TYPE_P (op.type)
       && !SCALAR_FLOAT_TYPE_P (op.type))
     return false;
 
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index cb86d544313..28aee3d4d35 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -4112,7 +4112,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
 	      bias = fold_convert (TREE_TYPE (step), bias);
 	      bias = fold_build2 (MULT_EXPR, TREE_TYPE (step), bias, step);
 	      thisarginfo.op
-		= fold_build2 (POINTER_TYPE_P (opt)
+		= fold_build2 (INDIRECT_TYPE_P (opt)
 			       ? POINTER_PLUS_EXPR : PLUS_EXPR, opt,
 			       thisarginfo.op, bias);
 	    }
@@ -4131,11 +4131,11 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
 	}
       else if ((thisarginfo.dt == vect_constant_def
 		|| thisarginfo.dt == vect_external_def)
-	       && POINTER_TYPE_P (TREE_TYPE (op)))
+	       && INDIRECT_TYPE_P (TREE_TYPE (op)))
 	thisarginfo.align = get_pointer_alignment (op) / BITS_PER_UNIT;
       /* Addresses of array elements indexed by GOMP_SIMD_LANE are
 	 linear too.  */
-      if (POINTER_TYPE_P (TREE_TYPE (op))
+      if (INDIRECT_TYPE_P (TREE_TYPE (op))
 	  && !thisarginfo.linear_step
 	  && !vec_stmt
 	  && thisarginfo.dt != vect_constant_def
@@ -4328,7 +4328,7 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
 									+ 1,
 								      true);
 	    STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (arginfo[i].op);
-	    tree lst = POINTER_TYPE_P (TREE_TYPE (arginfo[i].op))
+	    tree lst = INDIRECT_TYPE_P (TREE_TYPE (arginfo[i].op))
 		       ? size_type_node : TREE_TYPE (arginfo[i].op);
 	    tree ls = build_int_cst (lst, arginfo[i].linear_step);
 	    STMT_VINFO_SIMD_CLONE_INFO (stmt_info).safe_push (ls);
@@ -4566,9 +4566,9 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
 		  add_phi_arg (new_phi, arginfo[i].op,
 			       loop_preheader_edge (loop), UNKNOWN_LOCATION);
 		  enum tree_code code
-		    = POINTER_TYPE_P (TREE_TYPE (op))
+		    = INDIRECT_TYPE_P (TREE_TYPE (op))
 		      ? POINTER_PLUS_EXPR : PLUS_EXPR;
-		  tree type = POINTER_TYPE_P (TREE_TYPE (op))
+		  tree type = INDIRECT_TYPE_P (TREE_TYPE (op))
 			      ? sizetype : TREE_TYPE (op);
 		  poly_widest_int cst
 		    = wi::mul (bestn->simdclone->args[i].linear_step,
@@ -4587,9 +4587,9 @@ vectorizable_simd_clone_call (vec_info *vinfo, stmt_vec_info stmt_info,
 	      else
 		{
 		  enum tree_code code
-		    = POINTER_TYPE_P (TREE_TYPE (op))
+		    = INDIRECT_TYPE_P (TREE_TYPE (op))
 		      ? POINTER_PLUS_EXPR : PLUS_EXPR;
-		  tree type = POINTER_TYPE_P (TREE_TYPE (op))
+		  tree type = INDIRECT_TYPE_P (TREE_TYPE (op))
 			      ? sizetype : TREE_TYPE (op);
 		  poly_widest_int cst
 		    = wi::mul (bestn->simdclone->args[i].linear_step,
@@ -12398,7 +12398,7 @@ get_related_vectype_for_scalar_type (machine_mode prevailing_mode,
   tree vectype;
 
   if ((!INTEGRAL_TYPE_P (scalar_type)
-       && !POINTER_TYPE_P (scalar_type)
+       && !INDIRECT_TYPE_P (scalar_type)
        && !SCALAR_FLOAT_TYPE_P (scalar_type))
       || (!is_int_mode (TYPE_MODE (scalar_type), &inner_mode)
 	  && !is_float_mode (TYPE_MODE (scalar_type), &inner_mode)))
diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc
index d61b087b730..c85ac113b5d 100644
--- a/gcc/tree-vrp.cc
+++ b/gcc/tree-vrp.cc
@@ -390,8 +390,8 @@ compare_values_warnv (tree val1, tree val2, bool *strict_overflow_p)
 
   /* Below we rely on the fact that VAL1 and VAL2 are both pointers or
      both integers.  */
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (val1))
-	      == POINTER_TYPE_P (TREE_TYPE (val2)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (val1))
+	      == INDIRECT_TYPE_P (TREE_TYPE (val2)));
 
   /* Convert the two values into the same type.  This is needed because
      sizetype causes sign extension even for unsigned types.  */
@@ -477,7 +477,7 @@ compare_values_warnv (tree val1, tree val2, bool *strict_overflow_p)
   if (!cst1 || !cst2)
     return -2;
 
-  if (!POINTER_TYPE_P (TREE_TYPE (val1)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (val1)))
     {
       /* We cannot compare overflowed values.  */
       if (TREE_OVERFLOW (val1) || TREE_OVERFLOW (val2))
diff --git a/gcc/tree.cc b/gcc/tree.cc
index 634a1820613..120b454cb16 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -3048,7 +3048,7 @@ unsigned int
 tree_ctz (const_tree expr)
 {
   if (!INTEGRAL_TYPE_P (TREE_TYPE (expr))
-      && !POINTER_TYPE_P (TREE_TYPE (expr)))
+      && !INDIRECT_TYPE_P (TREE_TYPE (expr)))
     return 0;
 
   unsigned int ret1, ret2, prec = TYPE_PRECISION (TREE_TYPE (expr));
@@ -4188,7 +4188,7 @@ type_contains_placeholder_1 (const_tree type)
      the case of arrays) type involves a placeholder, this type does.  */
   if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type))
       || CONTAINS_PLACEHOLDER_P (TYPE_SIZE_UNIT (type))
-      || (!POINTER_TYPE_P (type)
+      || (!INDIRECT_TYPE_P (type)
 	  && TREE_TYPE (type)
 	  && type_contains_placeholder_p (TREE_TYPE (type))))
     return true;
@@ -4597,7 +4597,7 @@ substitute_placeholder_in_expr (tree exp, tree obj)
 		     || VL_EXP_CLASS_P (elt)
 		     || EXPRESSION_CLASS_P (elt))
 		  ? TREE_OPERAND (elt, 0) : 0))
-	if (POINTER_TYPE_P (TREE_TYPE (elt))
+	if (INDIRECT_TYPE_P (TREE_TYPE (elt))
 	    && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (elt)))
 		== need_type))
 	  return fold_build1 (INDIRECT_REF, need_type, elt);
@@ -5086,7 +5086,7 @@ build2 (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
   gcc_assert (TREE_CODE_LENGTH (code) == 2);
 
   if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR)
-      && arg0 && arg1 && tt && POINTER_TYPE_P (tt)
+      && arg0 && arg1 && tt && INDIRECT_TYPE_P (tt)
       /* When sizetype precision doesn't match that of pointers
          we need to be able to build explicit extensions or truncations
 	 of the offset argument.  */
@@ -5095,7 +5095,7 @@ build2 (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
 		&& TREE_CODE (arg1) == INTEGER_CST);
 
   if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt)
-    gcc_assert (POINTER_TYPE_P (tt) && POINTER_TYPE_P (TREE_TYPE (arg0))
+    gcc_assert (INDIRECT_TYPE_P (tt) && INDIRECT_TYPE_P (TREE_TYPE (arg0))
 		&& ptrofftype_p (TREE_TYPE (arg1)));
 
   t = make_node (code PASS_MEM_STAT);
@@ -8187,7 +8187,7 @@ retry:
 void
 get_type_static_bounds (const_tree type, mpz_t min, mpz_t max)
 {
-  if (!POINTER_TYPE_P (type) && TYPE_MIN_VALUE (type)
+  if (!INDIRECT_TYPE_P (type) && TYPE_MIN_VALUE (type)
       && TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
     wi::to_mpz (wi::to_wide (TYPE_MIN_VALUE (type)), min, TYPE_SIGN (type));
   else
@@ -8201,7 +8201,7 @@ get_type_static_bounds (const_tree type, mpz_t min, mpz_t max)
 	}
     }
 
-  if (!POINTER_TYPE_P (type) && TYPE_MAX_VALUE (type)
+  if (!INDIRECT_TYPE_P (type) && TYPE_MAX_VALUE (type)
       && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST)
     wi::to_mpz (wi::to_wide (TYPE_MAX_VALUE (type)), max, TYPE_SIGN (type));
   else
@@ -8553,8 +8553,8 @@ tree_builtin_call_types_compatible_p (const_tree call, tree fndecl)
 	     FILE * vs. fileptr_type_node, or say char * vs. const char *
 	     differences etc.  */
 	  if (!gimple_form
-	      && POINTER_TYPE_P (type)
-	      && POINTER_TYPE_P (TREE_TYPE (arg))
+	      && INDIRECT_TYPE_P (type)
+	      && INDIRECT_TYPE_P (TREE_TYPE (arg))
 	      && tree_nop_conversion_p (type, TREE_TYPE (arg)))
 	    continue;
 	  /* char/short integral arguments are promoted to int
@@ -11033,7 +11033,7 @@ signed_or_unsigned_type_for (int unsignedp, tree type)
 
   unsigned int bits;
   if (INTEGRAL_TYPE_P (type)
-      || POINTER_TYPE_P (type)
+      || INDIRECT_TYPE_P (type)
       || TREE_CODE (type) == OFFSET_TYPE)
     bits = TYPE_PRECISION (type);
   else if (TREE_CODE (type) == REAL_TYPE)
@@ -11250,9 +11250,9 @@ walk_type_fields (tree type, walk_tree_fn func, void *data,
 	 points to another pointer, that one does too, and we have no htab.
 	 If so, get a hash table.  We check three levels deep to avoid
 	 the cost of the hash table if we don't need one.  */
-      if (POINTER_TYPE_P (TREE_TYPE (type))
-	  && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (type)))
-	  && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (TREE_TYPE (type))))
+      if (INDIRECT_TYPE_P (TREE_TYPE (type))
+	  && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (type)))
+	  && INDIRECT_TYPE_P (TREE_TYPE (TREE_TYPE (TREE_TYPE (type))))
 	  && !pset)
 	{
 	  result = walk_tree_without_duplicates (&TREE_TYPE (type),
@@ -11290,7 +11290,7 @@ walk_type_fields (tree type, walk_tree_fn func, void *data,
 	 we'll have infinite recursion.  If we have a PSET, then we
 	 need not fear.  */
       if (pset
-	  || (!POINTER_TYPE_P (TREE_TYPE (type))
+	  || (!INDIRECT_TYPE_P (TREE_TYPE (type))
 	      && TREE_CODE (TREE_TYPE (type)) != OFFSET_TYPE))
 	WALK_SUBTREE (TREE_TYPE (type));
       WALK_SUBTREE (TYPE_DOMAIN (type));
@@ -11513,7 +11513,7 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
 
 	  /* But do not walk a pointed-to type since it may itself need to
 	     be walked in the declaration case if it isn't anonymous.  */
-	  if (!POINTER_TYPE_P (type))
+	  if (!INDIRECT_TYPE_P (type))
 	    {
 	      result = walk_type_fields (type, func, data, pset, lh);
 	      if (result)
@@ -11930,15 +11930,15 @@ bool
 tree_nop_conversion_p (const_tree outer_type, const_tree inner_type)
 {
   /* Do not strip casts into or out of differing address spaces.  */
-  if (POINTER_TYPE_P (outer_type)
+  if (INDIRECT_TYPE_P (outer_type)
       && TYPE_ADDR_SPACE (TREE_TYPE (outer_type)) != ADDR_SPACE_GENERIC)
     {
-      if (!POINTER_TYPE_P (inner_type)
+      if (!INDIRECT_TYPE_P (inner_type)
 	  || (TYPE_ADDR_SPACE (TREE_TYPE (outer_type))
 	      != TYPE_ADDR_SPACE (TREE_TYPE (inner_type))))
 	return false;
     }
-  else if (POINTER_TYPE_P (inner_type)
+  else if (INDIRECT_TYPE_P (inner_type)
 	   && TYPE_ADDR_SPACE (TREE_TYPE (inner_type)) != ADDR_SPACE_GENERIC)
     {
       /* We already know that outer_type is not a pointer with
@@ -11949,10 +11949,10 @@ tree_nop_conversion_p (const_tree outer_type, const_tree inner_type)
   /* Use precision rather then machine mode when we can, which gives
      the correct answer even for submode (bit-field) types.  */
   if ((INTEGRAL_TYPE_P (outer_type)
-       || POINTER_TYPE_P (outer_type)
+       || INDIRECT_TYPE_P (outer_type)
        || TREE_CODE (outer_type) == OFFSET_TYPE)
       && (INTEGRAL_TYPE_P (inner_type)
-	  || POINTER_TYPE_P (inner_type)
+	  || INDIRECT_TYPE_P (inner_type)
 	  || TREE_CODE (inner_type) == OFFSET_TYPE))
     return TYPE_PRECISION (outer_type) == TYPE_PRECISION (inner_type);
 
@@ -11999,7 +11999,7 @@ tree_sign_nop_conversion (const_tree exp)
   inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
 
   return (TYPE_UNSIGNED (outer_type) == TYPE_UNSIGNED (inner_type)
-	  && POINTER_TYPE_P (outer_type) == POINTER_TYPE_P (inner_type));
+	  && INDIRECT_TYPE_P (outer_type) == INDIRECT_TYPE_P (inner_type));
 }
 
 /* Strip conversions from EXP according to tree_nop_conversion and
@@ -13382,7 +13382,7 @@ verify_type_variant (const_tree t, tree tv)
   if (TYPE_ARTIFICIAL (tv))
     verify_variant_match (TYPE_ARTIFICIAL);
 #endif
-  if (POINTER_TYPE_P (tv))
+  if (INDIRECT_TYPE_P (tv))
     verify_variant_match (TYPE_REF_CAN_ALIAS_ALL);
   /* FIXME: TYPE_SIZES_GIMPLIFIED may differs for Ada build.  */
   verify_variant_match (TYPE_UNSIGNED);
@@ -13528,7 +13528,7 @@ verify_type_variant (const_tree t, tree tv)
 		   referring non-variant pointer.  We may change it to
 		   produce types as variants, too, like
 		   objc_get_protocol_qualified_type does.  */
-		&& !POINTER_TYPE_P (TREE_TYPE (f1)))
+		&& !INDIRECT_TYPE_P (TREE_TYPE (f1)))
 	    || DECL_FIELD_OFFSET (f1) != DECL_FIELD_OFFSET (f2)
 	    || DECL_FIELD_BIT_OFFSET (f1) != DECL_FIELD_BIT_OFFSET (f2))
 	  break;
@@ -13551,7 +13551,7 @@ verify_type_variant (const_tree t, tree tv)
      in objc_get_protocol_qualified_type.  */
   if (TREE_TYPE (t) != TREE_TYPE (tv)
       && ((TREE_CODE (t) != ARRAY_TYPE
-	   && !POINTER_TYPE_P (t))
+	   && !INDIRECT_TYPE_P (t))
 	  || TYPE_MAIN_VARIANT (TREE_TYPE (t))
 	     != TYPE_MAIN_VARIANT (TREE_TYPE (tv))))
     {
@@ -13699,7 +13699,7 @@ gimple_canonical_types_compatible_p (const_tree t1, const_tree t2,
       || VECTOR_TYPE_P (t1)
       || TREE_CODE (t1) == COMPLEX_TYPE
       || TREE_CODE (t1) == OFFSET_TYPE
-      || POINTER_TYPE_P (t1))
+      || INDIRECT_TYPE_P (t1))
     {
       /* Can't be the same type if they have different precision.  */
       if (TYPE_PRECISION_RAW (t1) != TYPE_PRECISION_RAW (t2))
@@ -13718,7 +13718,7 @@ gimple_canonical_types_compatible_p (const_tree t1, const_tree t2,
       /* Fortran standard define C_PTR type that is compatible with every
  	 C pointer.  For this reason we need to glob all pointers into one.
 	 Still pointers in different address spaces are not compatible.  */
-      if (POINTER_TYPE_P (t1))
+      if (INDIRECT_TYPE_P (t1))
 	{
 	  if (TYPE_ADDR_SPACE (TREE_TYPE (t1))
 	      != TYPE_ADDR_SPACE (TREE_TYPE (t2)))
@@ -14381,7 +14381,7 @@ nonnull_arg_p (const_tree arg)
   unsigned HOST_WIDE_INT arg_num;
 
   gcc_assert (TREE_CODE (arg) == PARM_DECL
-	      && (POINTER_TYPE_P (TREE_TYPE (arg))
+	      && (INDIRECT_TYPE_P (TREE_TYPE (arg))
 		  || TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE));
 
   /* The static chain decl is always non null.  */
diff --git a/gcc/tree.h b/gcc/tree.h
index c369b8470ab..d548dce63f7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -700,7 +700,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 
 /* Nonzero if TYPE represents a pointer to function.  */
 #define FUNCTION_POINTER_TYPE_P(TYPE) \
-  (POINTER_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
+  (INDIRECT_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
 
 /* Nonzero if this type is a complete type.  */
 #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
@@ -952,7 +952,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 /* True if overflow wraps around for the given integral or pointer type.  That
    is, TYPE_MAX + 1 == TYPE_MIN.  */
 #define TYPE_OVERFLOW_WRAPS(TYPE) \
-  (POINTER_TYPE_P (TYPE)					\
+  (INDIRECT_TYPE_P (TYPE)					\
    ? flag_wrapv_pointer						\
    : (ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag	\
       || flag_wrapv))
@@ -966,7 +966,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
    other cases it will be appropriate to simply set a flag and let the
    caller decide whether a warning is appropriate or not.  */
 #define TYPE_OVERFLOW_UNDEFINED(TYPE)				\
-  (POINTER_TYPE_P (TYPE)					\
+  (INDIRECT_TYPE_P (TYPE)					\
    ? !flag_wrapv_pointer					\
    : (!ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag	\
       && !flag_wrapv && !flag_trapv))
@@ -5272,7 +5272,7 @@ reverse_storage_order_for_component_p (tree t)
 {
   /* The storage order only applies to scalar components.  */
   if (AGGREGATE_TYPE_P (TREE_TYPE (t))
-      || POINTER_TYPE_P (TREE_TYPE (t))
+      || INDIRECT_TYPE_P (TREE_TYPE (t))
       || VECTOR_TYPE_P (TREE_TYPE (t)))
     return false;
 
@@ -5721,7 +5721,7 @@ tree_code_for_canonical_type_merging (enum tree_code code)
 inline bool
 canonical_type_used_p (const_tree t)
 {
-  return !(POINTER_TYPE_P (t)
+  return !(INDIRECT_TYPE_P (t)
 	   || TREE_CODE (t) == ARRAY_TYPE
 	   || TREE_CODE (t) == VECTOR_TYPE);
 }
diff --git a/gcc/ubsan.cc b/gcc/ubsan.cc
index cfae13d7cde..1a1e58d2d73 100644
--- a/gcc/ubsan.cc
+++ b/gcc/ubsan.cc
@@ -374,11 +374,11 @@ ubsan_type_descriptor (tree type, enum ubsan_print_style pstyle)
   /* Get the name of the type, or the name of the pointer type.  */
   if (pstyle == UBSAN_PRINT_POINTER)
     {
-      gcc_assert (POINTER_TYPE_P (type));
+      gcc_assert (INDIRECT_TYPE_P (type));
       type2 = TREE_TYPE (type);
 
       /* Remove any '*' operators from TYPE.  */
-      while (POINTER_TYPE_P (type2))
+      while (INDIRECT_TYPE_P (type2))
         deref_depth++, type2 = TREE_TYPE (type2);
 
       if (TREE_CODE (type2) == METHOD_TYPE)
@@ -390,7 +390,7 @@ ubsan_type_descriptor (tree type, enum ubsan_print_style pstyle)
 
   if (pstyle == UBSAN_PRINT_ARRAY)
     {
-      while (POINTER_TYPE_P (type2))
+      while (INDIRECT_TYPE_P (type2))
         deref_depth++, type2 = TREE_TYPE (type2);
     }
 
@@ -1394,7 +1394,7 @@ instrument_mem_ref (tree mem, tree base, gimple_stmt_iterator *iter,
   if (align == 0 && !sanitize_flags_p (SANITIZE_NULL))
     return;
   tree t = TREE_OPERAND (base, 0);
-  if (!POINTER_TYPE_P (TREE_TYPE (t)))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (t)))
     return;
   if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (base)) && mem != base)
     ikind = UBSAN_MEMBER_ACCESS;
@@ -1494,7 +1494,7 @@ maybe_instrument_pointer_overflow (gimple_stmt_iterator *gsi, tree t)
   else
     return;
 
-  if (!POINTER_TYPE_P (TREE_TYPE (base)) && !DECL_P (base))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (base)) && !DECL_P (base))
     return;
   bytepos = bits_to_bytes_round_down (bitpos);
   if (offset == NULL_TREE && known_eq (bytepos, 0) && moff == NULL_TREE)
@@ -1970,7 +1970,7 @@ instrument_nonnull_arg (gimple_stmt_iterator *gsi)
   for (unsigned int i = 0; i < gimple_call_num_args (stmt); i++)
     {
       tree arg = gimple_call_arg (stmt, i);
-      if (POINTER_TYPE_P (TREE_TYPE (arg))
+      if (INDIRECT_TYPE_P (TREE_TYPE (arg))
 	  && infer_nonnull_range_by_attribute (stmt, arg))
 	{
 	  gimple *g;
@@ -2034,7 +2034,7 @@ instrument_nonnull_return (gimple_stmt_iterator *gsi)
   loc[0] = gimple_location (stmt);
   loc[1] = UNKNOWN_LOCATION;
   if (arg
-      && POINTER_TYPE_P (TREE_TYPE (arg))
+      && INDIRECT_TYPE_P (TREE_TYPE (arg))
       && is_gimple_val (arg)
       && infer_nonnull_range_by_attribute (stmt, arg))
     {
@@ -2153,7 +2153,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, tree t, bool is_lhs)
       gimple *def_stmt = SSA_NAME_DEF_STMT (base);
       if (gimple_assign_ssa_name_copy_p (def_stmt)
 	  || (gimple_assign_cast_p (def_stmt)
-	      && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))
+	      && INDIRECT_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))
 	  || (is_gimple_assign (def_stmt)
 	      && gimple_assign_rhs_code (def_stmt) == POINTER_PLUS_EXPR))
 	{
@@ -2168,7 +2168,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, tree t, bool is_lhs)
 	break;
     }
 
-  if (!POINTER_TYPE_P (TREE_TYPE (base)) && !DECL_P (base))
+  if (!INDIRECT_TYPE_P (TREE_TYPE (base)) && !DECL_P (base))
     return;
 
   tree sizet;
diff --git a/gcc/value-pointer-equiv.cc b/gcc/value-pointer-equiv.cc
index 52365837ac7..e2ef9aa760a 100644
--- a/gcc/value-pointer-equiv.cc
+++ b/gcc/value-pointer-equiv.cc
@@ -185,7 +185,7 @@ pointer_equiv_analyzer::enter (basic_block bb)
     {
       gphi *phi = iter.phi ();
       tree lhs = gimple_phi_result (phi);
-      if (!POINTER_TYPE_P (TREE_TYPE (lhs)))
+      if (!INDIRECT_TYPE_P (TREE_TYPE (lhs)))
 	continue;
       tree arg0 = gimple_phi_arg_def (phi, 0);
       if (TREE_CODE (arg0) == SSA_NAME && !is_gimple_min_invariant (arg0))
@@ -308,7 +308,7 @@ pointer_equiv_analyzer::visit_edge (edge e)
   if (stmt
       && ((lhs = gimple_cond_lhs (stmt)), true)
       && TREE_CODE (lhs) == SSA_NAME
-      && POINTER_TYPE_P (TREE_TYPE (lhs))
+      && INDIRECT_TYPE_P (TREE_TYPE (lhs))
       && TREE_CODE (gimple_cond_rhs (stmt)) == ADDR_EXPR)
     {
       tree_code code = gimple_cond_code (stmt);
diff --git a/gcc/value-pointer-equiv.h b/gcc/value-pointer-equiv.h
index 37cd2b92260..aa49f0d4e9b 100644
--- a/gcc/value-pointer-equiv.h
+++ b/gcc/value-pointer-equiv.h
@@ -56,7 +56,7 @@ private:
 inline bool
 supported_pointer_equiv_p (tree expr)
 {
-  return TREE_CODE (expr) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (expr));
+  return TREE_CODE (expr) == SSA_NAME && INDIRECT_TYPE_P (TREE_TYPE (expr));
 }
 
 #endif // GCC_VALUE_POINTER_EQUIV_H
diff --git a/gcc/value-query.cc b/gcc/value-query.cc
index adef93415b7..022c089808e 100644
--- a/gcc/value-query.cc
+++ b/gcc/value-query.cc
@@ -269,7 +269,7 @@ static inline void
 get_ssa_name_range_info (vrange &r, const_tree name)
 {
   tree type = TREE_TYPE (name);
-  gcc_checking_assert (!POINTER_TYPE_P (type));
+  gcc_checking_assert (!INDIRECT_TYPE_P (type));
   gcc_checking_assert (TREE_CODE (name) == SSA_NAME);
 
   vrange_storage *ri = SSA_NAME_RANGE_INFO (name);
@@ -285,7 +285,7 @@ get_ssa_name_range_info (vrange &r, const_tree name)
 static inline bool
 get_ssa_name_ptr_info_nonnull (const_tree name)
 {
-  gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
+  gcc_assert (INDIRECT_TYPE_P (TREE_TYPE (name)));
   struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
   if (pi == NULL)
     return false;
@@ -319,11 +319,11 @@ get_range_global (vrange &r, tree name, struct function *fun = cfun)
 	  // Try to use the "nonnull" attribute to create ~[0, 0]
 	  // anti-ranges for pointers.  Note that this is only valid with
 	  // default definitions of PARM_DECLs.
-	  if (POINTER_TYPE_P (type)
+	  if (INDIRECT_TYPE_P (type)
 	      && ((cfun && fun == cfun && nonnull_arg_p (sym))
 		  || get_ssa_name_ptr_info_nonnull (name)))
 	    r.set_nonzero (type);
-	  else if (!POINTER_TYPE_P (type))
+	  else if (!INDIRECT_TYPE_P (type))
 	    {
 	      get_ssa_name_range_info (r, name);
 	      if (r.undefined_p ())
@@ -338,13 +338,13 @@ get_range_global (vrange &r, tree name, struct function *fun = cfun)
       else
 	r.set_varying (type);
    }
-  else if (!POINTER_TYPE_P (type) && SSA_NAME_RANGE_INFO (name))
+  else if (!INDIRECT_TYPE_P (type) && SSA_NAME_RANGE_INFO (name))
     {
       get_ssa_name_range_info (r, name);
       if (r.undefined_p ())
 	r.set_varying (type);
     }
-  else if (POINTER_TYPE_P (type) && SSA_NAME_PTR_INFO (name))
+  else if (INDIRECT_TYPE_P (type) && SSA_NAME_PTR_INFO (name))
     {
       if (get_ssa_name_ptr_info_nonnull (name))
 	r.set_nonzero (type);
diff --git a/gcc/value-range.h b/gcc/value-range.h
index d8af6fca7d7..e6e65847d26 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -882,7 +882,7 @@ irange::varying_compatible_p () const
 
   unsigned prec = TYPE_PRECISION (t);
   signop sign = TYPE_SIGN (t);
-  if (INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t))
+  if (INTEGRAL_TYPE_P (t) || INDIRECT_TYPE_P (t))
     return (l == wi::min_value (prec, sign)
 	    && u == wi::max_value (prec, sign)
 	    && m_bitmask.unknown_p ());
@@ -922,7 +922,7 @@ irange::nonzero_p () const
 inline bool
 irange::supports_p (const_tree type)
 {
-  return INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type);
+  return INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type);
 }
 
 inline bool
@@ -1054,7 +1054,7 @@ irange::set_varying (tree type)
   m_num_ranges = 1;
   m_bitmask.set_unknown (TYPE_PRECISION (type));
 
-  if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
+  if (INTEGRAL_TYPE_P (type) || INDIRECT_TYPE_P (type))
     {
       m_type = type;
       // Strict enum's require varying to be not TYPE_MIN/MAX, but rather
diff --git a/gcc/varasm.cc b/gcc/varasm.cc
index 53f0cc61922..e5d67d8f6e1 100644
--- a/gcc/varasm.cc
+++ b/gcc/varasm.cc
@@ -4883,7 +4883,7 @@ initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache)
 	tree dest_type = TREE_TYPE (value);
 
 	/* Allow conversions between pointer types and offset types.  */
-	if ((POINTER_TYPE_P (dest_type) && POINTER_TYPE_P (src_type))
+	if ((INDIRECT_TYPE_P (dest_type) && INDIRECT_TYPE_P (src_type))
 	    || (TREE_CODE (dest_type) == OFFSET_TYPE
 		&& TREE_CODE (src_type) == OFFSET_TYPE))
 	  return initializer_constant_valid_p_1 (src, endtype, cache);
@@ -4914,13 +4914,13 @@ initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache)
 	  }
 
 	/* Allow (int) &foo provided int is as wide as a pointer.  */
-	if (INTEGRAL_TYPE_P (dest_type) && POINTER_TYPE_P (src_type)
+	if (INTEGRAL_TYPE_P (dest_type) && INDIRECT_TYPE_P (src_type)
 	    && (TYPE_PRECISION (dest_type) >= TYPE_PRECISION (src_type)))
 	  return initializer_constant_valid_p_1 (src, endtype, cache);
 
 	/* Likewise conversions from int to pointers, but also allow
 	   conversions from 0.  */
-	if ((POINTER_TYPE_P (dest_type)
+	if ((INDIRECT_TYPE_P (dest_type)
 	     || TREE_CODE (dest_type) == OFFSET_TYPE)
 	    && INTEGRAL_TYPE_P (src_type))
 	  {
@@ -5172,7 +5172,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align,
      the mode is valid for pointers, assume the target has a way of
      resolving it.  */
   if (TREE_CODE (exp) == NOP_EXPR
-      && POINTER_TYPE_P (TREE_TYPE (exp))
+      && INDIRECT_TYPE_P (TREE_TYPE (exp))
       && targetm.addr_space.valid_pointer_mode
 	   (SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)),
 	    TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)))))
@@ -5182,7 +5182,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align,
       /* Peel off any intermediate conversions-to-pointer for valid
 	 pointer modes.  */
       while (TREE_CODE (exp) == NOP_EXPR
-	     && POINTER_TYPE_P (TREE_TYPE (exp))
+	     && INDIRECT_TYPE_P (TREE_TYPE (exp))
 	     && targetm.addr_space.valid_pointer_mode
 		  (SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)),
 		   TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)))))
diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index ac4a83c6097..4b522de7b87 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -340,7 +340,7 @@ simplify_using_ranges::legacy_fold_cond_overflow (gimple *stmt)
 
   /* We only deal with integral and pointer types.  */
   if (!INTEGRAL_TYPE_P (TREE_TYPE (op0))
-      && !POINTER_TYPE_P (TREE_TYPE (op0)))
+      && !INDIRECT_TYPE_P (TREE_TYPE (op0)))
     return NULL_TREE;
 
   /* If OP0 CODE OP1 is an overflow comparison, if it can be expressed
@@ -986,7 +986,7 @@ range_fits_type_p (const irange *vr,
   /* We can only handle integral and pointer types.  */
   src_type = vr->type ();
   if (!INTEGRAL_TYPE_P (src_type)
-      && !POINTER_TYPE_P (src_type))
+      && !INDIRECT_TYPE_P (src_type))
     return false;
 
   /* An extension is fine unless VR is SIGNED and dest_sgn is UNSIGNED,
@@ -1259,7 +1259,7 @@ simplify_using_ranges::simplify_casted_cond (gcond *stmt)
 	}
 
       if (TREE_CODE (innerop) == SSA_NAME
-	  && !POINTER_TYPE_P (TREE_TYPE (innerop))
+	  && !INDIRECT_TYPE_P (TREE_TYPE (innerop))
 	  && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (innerop)
 	  && desired_pro_or_demotion_p (TREE_TYPE (innerop), TREE_TYPE (op0)))
 	{
-- 
2.41.0


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

* [PATCH 6/8] tree: Remove POINTER_TYPE_P
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (4 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 5/8] gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE Ken Matsui
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

Since POINTER_TYPE_P was completely replaced by INDIRECT_TYPE_P, it can
be deleted.

gcc/ChangeLog:

	* tree.h (POINTER_TYPE_P): Remove.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/tree.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/gcc/tree.h b/gcc/tree.h
index d548dce63f7..347e676e737 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -691,13 +691,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define INDIRECT_TYPE_P(NODE)			\
   (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
 
-/* Nonzero if TYPE represents a pointer or reference type.
-   (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
-   ascending code order.  */
-
-#define POINTER_TYPE_P(TYPE) \
-  (TREE_CODE (TYPE) == POINTER_TYPE || TYPE_REF_P (TYPE))
-
 /* Nonzero if TYPE represents a pointer to function.  */
 #define FUNCTION_POINTER_TYPE_P(TYPE) \
   (INDIRECT_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
-- 
2.41.0


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

* [PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (5 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 6/8] tree: Remove POINTER_TYPE_P Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-18 23:12 ` [PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE Ken Matsui
  2023-07-19  7:07 ` [PATCH 0/8] Tweak predicate macros in tree Richard Biener
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

This patch defines TYPE_REF_IS_LVALUE to determine if a type is a C++
lvalue reference.

gcc/ChangeLog:

	* tree.h (TYPE_REF_IS_LVALUE): Define.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/tree.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/tree.h b/gcc/tree.h
index 347e676e737..0b2cb894241 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1054,6 +1054,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define TYPE_REF_IS_RVALUE(NODE) \
   (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
 
+/* True if reference type NODE is a C++ lvalue reference.  */
+#define TYPE_REF_IS_LVALUE(NODE) \
+  (TYPE_REF_P (NODE) && !TYPE_REF_IS_RVALUE (NODE))
+
 /* Nonzero in a _DECL if the use of the name is defined as a
    deprecated feature by __attribute__((deprecated)).  */
 #define TREE_DEPRECATED(NODE) \
-- 
2.41.0


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

* [PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (6 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE Ken Matsui
@ 2023-07-18 23:12 ` Ken Matsui
  2023-07-19  7:07 ` [PATCH 0/8] Tweak predicate macros in tree Richard Biener
  8 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-18 23:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ken Matsui

gcc/cp/ChangeLog:

	* decl.cc (copy_fn_p): Use TYPE_REF_IS_LVALUE.
	* init.cc (maybe_warn_list_ctor): Likewise.
	* method.cc (early_check_defaulted_comparison): Likewise.
	* pt.cc (maybe_adjust_types_for_deduction): Likewise.
	(invalid_nontype_parm_type_p): Likewise.
	* tree.cc (structural_type_p): Likewise.

gcc/lto/ChangeLog:

	* lto-common.cc (lto_fixup_prevailing_type): Use
	TYPE_REF_IS_LVALUE.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/cp/decl.cc        | 3 +--
 gcc/cp/init.cc        | 3 +--
 gcc/cp/method.cc      | 3 +--
 gcc/cp/pt.cc          | 6 ++----
 gcc/cp/tree.cc        | 2 +-
 gcc/lto/lto-common.cc | 2 +-
 6 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index c08056ca3d2..5e84f6a6f78 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -15250,8 +15250,7 @@ copy_fn_p (const_tree d)
       /* Pass by value copy assignment operator.  */
       result = -1;
     }
-  else if (TYPE_REF_P (arg_type)
-	   && !TYPE_REF_IS_RVALUE (arg_type)
+  else if (TYPE_REF_IS_LVALUE (arg_type)
 	   && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d))
     {
       if (CP_TYPE_CONST_P (TREE_TYPE (arg_type)))
diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc
index 01eb4b55889..8006576bfd6 100644
--- a/gcc/cp/init.cc
+++ b/gcc/cp/init.cc
@@ -778,8 +778,7 @@ maybe_warn_list_ctor (tree member, tree init)
   tree initlist = non_reference (parm);
 
   /* Do not warn if the parameter is an lvalue reference to non-const.  */
-  if (TYPE_REF_P (parm) && !TYPE_REF_IS_RVALUE (parm)
-      && !CP_TYPE_CONST_P (initlist))
+  if (TYPE_REF_IS_LVALUE (parm) && !CP_TYPE_CONST_P (initlist))
     return;
 
   tree targs = CLASSTYPE_TI_ARGS (initlist);
diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc
index 524efc4e260..59be43d12c6 100644
--- a/gcc/cp/method.cc
+++ b/gcc/cp/method.cc
@@ -1207,8 +1207,7 @@ early_check_defaulted_comparison (tree fn)
       tree parmtype = TREE_VALUE (parmnode);
       if (CLASS_TYPE_P (parmtype))
 	saw_byval = true;
-      else if (TYPE_REF_P (parmtype)
-	       && !TYPE_REF_IS_RVALUE (parmtype)
+      else if (TYPE_REF_IS_LVALUE (parmtype)
 	       && TYPE_QUALS (TREE_TYPE (parmtype)) == TYPE_QUAL_CONST)
 	{
 	  saw_byref = true;
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index cb82e1b268b..56207411a7d 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -22772,8 +22772,7 @@ maybe_adjust_types_for_deduction (tree tparms,
 	 too, but here handle it by stripping the reference from PARM
 	 rather than by adding it to ARG.  */
       if (forwarding_reference_p (*parm, TPARMS_PRIMARY_TEMPLATE (tparms))
-	  && TYPE_REF_P (*arg)
-	  && !TYPE_REF_IS_RVALUE (*arg))
+	  && TYPE_REF_IS_LVALUE (*arg))
 	*parm = TREE_TYPE (*parm);
       /* Nothing else to do in this case.  */
       return 0;
@@ -27595,8 +27594,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
     return false;
   else if (TYPE_PTR_P (type))
     return false;
-  else if (TYPE_REF_P (type)
-	   && !TYPE_REF_IS_RVALUE (type))
+  else if (TYPE_REF_IS_LVALUE (type))
     return false;
   else if (TYPE_PTRMEM_P (type))
     return false;
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index 799183dc646..1ba7539b497 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -4928,7 +4928,7 @@ structural_type_p (tree t, bool explain)
   if (SCALAR_TYPE_P (t))
     return true;
   /* an lvalue reference type, or */
-  if (TYPE_REF_P (t) && !TYPE_REF_IS_RVALUE (t))
+  if (TYPE_REF_IS_LVALUE (t))
     return true;
   /* a literal class type with the following properties:
      - all base classes and non-static data members are public and non-mutable
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc
index 4b748ced87f..6321a70d04a 100644
--- a/gcc/lto/lto-common.cc
+++ b/gcc/lto/lto-common.cc
@@ -998,7 +998,7 @@ lto_fixup_prevailing_type (tree t)
 	  TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (TREE_TYPE (t));
 	  TYPE_POINTER_TO (TREE_TYPE (t)) = t;
 	}
-      else if (TYPE_REF_P (t) && !TYPE_REF_IS_RVALUE (t))
+      else if (TYPE_REF_IS_LVALUE (t))
 	{
 	  TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (TREE_TYPE (t));
 	  TYPE_REFERENCE_TO (TREE_TYPE (t)) = t;
-- 
2.41.0


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

* Re: [PATCH 0/8] Tweak predicate macros in tree
  2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
                   ` (7 preceding siblings ...)
  2023-07-18 23:12 ` [PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE Ken Matsui
@ 2023-07-19  7:07 ` Richard Biener
  2023-07-19 17:27   ` Ken Matsui
  8 siblings, 1 reply; 11+ messages in thread
From: Richard Biener @ 2023-07-19  7:07 UTC (permalink / raw)
  To: Ken Matsui; +Cc: gcc-patches

On Wed, Jul 19, 2023 at 1:34 AM Ken Matsui via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This patch series tweaks predicate macros in tree.h to make the code more
> readable. TYPE_REF_P is moved to tree.h and used for INDIRECT_TYPE_P and
> TYPE_REF_IS_LVALUE. TYPE_PTR_P is also moved to tree.h and used for
> INDIRECT_TYPE_P. POINTER_TYPE_P in tree.h is replaced with INDIRECT_TYPE_P
> since it is ambiguous. TYPE_REF_IS_LVALUE is defined in tree.h through
> TYPE_REF_P and TYPE_REF_IS_RVALUE. The same behavior codes with those
> predicate macros are replaced for clarity.
>
> These works were all the way up to implementing __is_lvalue_reference
> built-in trait and optimizing the is_lvalue_reference trait. However, those
> changes were dropped since I did not observe any performance improvements.
> For those who are interested in the benchmark results, they can be found
> below:
>
> 1. is_lvalue_reference
>
> https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference.md#tue-jul-18-033708-pm-pdt-2023
>
> Time: +1.35432%
> Peak Memory Usage: -0.103283%
> Total Memory Usage: No difference
>
> 2. is_lvalue_reference_v
>
> https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference_v.md#tue-jul-18-034236-pm-pdt-2023
>
> Time: No difference
> Peak Memory Usage: -0.426872%
> Total Memory Usage: -0.677638%
>
> Ken Matsui (8):
>   c++, tree: Move TYPE_REF_P to tree.h
>   gcc: Use TYPE_REF_P
>   c++, tree: Move TYPE_PTR_P to tree.h
>   c++, tree: Move INDIRECT_TYPE_P to tree.h
>   gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P

No, please not.  Definitely not.  The tree code of POINTER_TYPE_P is
POINTER_TYPE so the predicate name is exactly correct.
REFERENCE_TYPE_P would be the canonical predicate for REFERENCE_TYPE,
not TYPE_REF_P.

I don't think the C++ frontend should be the one to decide about middle-end
tree predicate macros.

>   tree: Remove POINTER_TYPE_P
>   tree: Define TYPE_REF_IS_LVALUE
>   c++, lto: Use TYPE_REF_IS_LVALUE
>
>  gcc/ada/gcc-interface/ada-tree.h           |   2 +-
>  gcc/ada/gcc-interface/decl.cc              |   6 +-
>  gcc/ada/gcc-interface/trans.cc             |  16 +--
>  gcc/ada/gcc-interface/utils.cc             |  12 +-
>  gcc/ada/gcc-interface/utils2.cc            |  14 +-
>  gcc/alias.cc                               |  12 +-
>  gcc/analyzer/analyzer.cc                   |   4 +-
>  gcc/analyzer/call-details.h                |   2 +-
>  gcc/analyzer/call-summary.cc               |   2 +-
>  gcc/analyzer/checker-event.cc              |   4 +-
>  gcc/analyzer/constraint-manager.cc         |   2 +-
>  gcc/analyzer/engine.cc                     |   4 +-
>  gcc/analyzer/program-state.cc              |   2 +-
>  gcc/analyzer/region-model-manager.cc       |   6 +-
>  gcc/analyzer/region-model.cc               |   6 +-
>  gcc/analyzer/sm.cc                         |   4 +-
>  gcc/analyzer/svalue.cc                     |   2 +-
>  gcc/analyzer/varargs.cc                    |   2 +-
>  gcc/asan.cc                                |   4 +-
>  gcc/builtins.cc                            |  24 ++--
>  gcc/c-family/c-ada-spec.cc                 |   2 +-
>  gcc/c-family/c-attribs.cc                  |  32 ++---
>  gcc/c-family/c-common.cc                   |  41 +++---
>  gcc/c-family/c-omp.cc                      |   8 +-
>  gcc/c-family/c-pretty-print.cc             |   4 +-
>  gcc/c-family/c-ubsan.cc                    |  10 +-
>  gcc/c-family/c-warn.cc                     |  34 ++---
>  gcc/c/c-decl.cc                            |   8 +-
>  gcc/c/c-parser.cc                          |   4 +-
>  gcc/c/c-typeck.cc                          |  40 +++---
>  gcc/c/gimple-parser.cc                     |   8 +-
>  gcc/calls.cc                               |   2 +-
>  gcc/cfgexpand.cc                           |   6 +-
>  gcc/cgraph.cc                              |   2 +-
>  gcc/cgraphunit.cc                          |   2 +-
>  gcc/config/aarch64/aarch64-builtins.cc     |   2 +-
>  gcc/config/aarch64/aarch64-sve-builtins.cc |   2 +-
>  gcc/config/aarch64/aarch64.cc              |   6 +-
>  gcc/config/arc/arc.cc                      |   2 +-
>  gcc/config/arm/arm-builtins.cc             |   6 +-
>  gcc/config/arm/arm-mve-builtins.cc         |   2 +-
>  gcc/config/avr/avr.cc                      |   6 +-
>  gcc/config/epiphany/epiphany.cc            |   2 +-
>  gcc/config/gcn/gcn-tree.cc                 |   2 +-
>  gcc/config/gcn/gcn.cc                      |   6 +-
>  gcc/config/i386/i386-builtins.cc           |   2 +-
>  gcc/config/i386/i386-options.cc            |   2 +-
>  gcc/config/i386/i386.cc                    |  10 +-
>  gcc/config/m32c/m32c.cc                    |   2 +-
>  gcc/config/m68k/m68k.cc                    |   4 +-
>  gcc/config/mips/mips.cc                    |   2 +-
>  gcc/config/mn10300/mn10300.cc              |   2 +-
>  gcc/config/msp430/msp430.cc                |   2 +-
>  gcc/config/nios2/nios2.cc                  |   2 +-
>  gcc/config/pa/pa.cc                        |   4 +-
>  gcc/config/pru/pru-passes.cc               |   2 +-
>  gcc/config/pru/pru.cc                      |   2 +-
>  gcc/config/rs6000/rs6000-builtin.cc        |   4 +-
>  gcc/config/rs6000/rs6000-c.cc              |  10 +-
>  gcc/config/rs6000/rs6000.cc                |   4 +-
>  gcc/config/s390/s390-c.cc                  |   2 +-
>  gcc/config/s390/s390.cc                    |  12 +-
>  gcc/config/sparc/sparc.cc                  |   2 +-
>  gcc/convert.cc                             |   4 +-
>  gcc/cp/class.cc                            |   4 +-
>  gcc/cp/constexpr.cc                        |   8 +-
>  gcc/cp/coroutines.cc                       |   4 +-
>  gcc/cp/cp-gimplify.cc                      |   2 +-
>  gcc/cp/cp-tree.h                           |  12 --
>  gcc/cp/decl.cc                             |   5 +-
>  gcc/cp/init.cc                             |   5 +-
>  gcc/cp/method.cc                           |   5 +-
>  gcc/cp/pt.cc                               |   8 +-
>  gcc/cp/semantics.cc                        |  18 +--
>  gcc/cp/tree.cc                             |   2 +-
>  gcc/cp/typeck.cc                           |   4 +-
>  gcc/d/d-attribs.cc                         |   6 +-
>  gcc/d/d-builtins.cc                        |   2 +-
>  gcc/d/d-codegen.cc                         |  12 +-
>  gcc/d/d-convert.cc                         |  12 +-
>  gcc/d/expr.cc                              |  10 +-
>  gcc/d/intrinsics.cc                        |  12 +-
>  gcc/dojump.cc                              |   4 +-
>  gcc/dwarf2out.cc                           |   2 +-
>  gcc/emit-rtl.cc                            |   2 +-
>  gcc/expmed.cc                              |   2 +-
>  gcc/expr.cc                                |  22 +--
>  gcc/fold-const.cc                          |  58 ++++----
>  gcc/fortran/trans-array.cc                 |  36 ++---
>  gcc/fortran/trans-decl.cc                  |  32 ++---
>  gcc/fortran/trans-expr.cc                  | 106 +++++++-------
>  gcc/fortran/trans-intrinsic.cc             |  28 ++--
>  gcc/fortran/trans-io.cc                    |   8 +-
>  gcc/fortran/trans-openmp.cc                |  88 ++++++------
>  gcc/fortran/trans-stmt.cc                  |  14 +-
>  gcc/fortran/trans-types.cc                 |   8 +-
>  gcc/fortran/trans.cc                       |  14 +-
>  gcc/function-abi.cc                        |   2 +-
>  gcc/function.cc                            |   6 +-
>  gcc/gimple-array-bounds.cc                 |   6 +-
>  gcc/gimple-expr.cc                         |   8 +-
>  gcc/gimple-fold.cc                         |  20 +--
>  gcc/gimple-loop-versioning.cc              |   4 +-
>  gcc/gimple-low.cc                          |   2 +-
>  gcc/gimple-pretty-print.cc                 |   4 +-
>  gcc/gimple-range-cache.cc                  |   4 +-
>  gcc/gimple-range-fold.cc                   |   2 +-
>  gcc/gimple-range-infer.cc                  |   2 +-
>  gcc/gimple-range-path.cc                   |   4 +-
>  gcc/gimple-ssa-isolate-paths.cc            |   6 +-
>  gcc/gimple-ssa-nonnull-compare.cc          |   4 +-
>  gcc/gimple-ssa-sprintf.cc                  |   4 +-
>  gcc/gimple-ssa-store-merging.cc            |   6 +-
>  gcc/gimple-ssa-strength-reduction.cc       |  22 +--
>  gcc/gimple-ssa-warn-access.cc              |   8 +-
>  gcc/gimple-ssa-warn-restrict.cc            |   6 +-
>  gcc/gimple.cc                              |  10 +-
>  gcc/gimplify.cc                            |  44 +++---
>  gcc/go/go-gcc.cc                           |   2 +-
>  gcc/godump.cc                              |   4 +-
>  gcc/graphite-isl-ast-to-gimple.cc          |   8 +-
>  gcc/graphite-sese-to-poly.cc               |   2 +-
>  gcc/ipa-cp.cc                              |   4 +-
>  gcc/ipa-devirt.cc                          |   8 +-
>  gcc/ipa-free-lang-data.cc                  |   8 +-
>  gcc/ipa-icf-gimple.cc                      |   2 +-
>  gcc/ipa-icf.cc                             |   6 +-
>  gcc/ipa-modref-tree.cc                     |   2 +-
>  gcc/ipa-modref.cc                          |   8 +-
>  gcc/ipa-param-manipulation.cc              |   4 +-
>  gcc/ipa-polymorphic-call.cc                |   6 +-
>  gcc/ipa-prop.cc                            |  28 ++--
>  gcc/ipa-sra.cc                             |   4 +-
>  gcc/jit/dummy-frontend.cc                  |   2 +-
>  gcc/langhooks.cc                           |   2 +-
>  gcc/lto-streamer-out.cc                    |   4 +-
>  gcc/lto/lto-common.cc                      |  10 +-
>  gcc/lto/lto-lang.cc                        |   2 +-
>  gcc/lto/lto-symtab.cc                      |   2 +-
>  gcc/m2/gm2-gcc/m2expr.cc                   |  12 +-
>  gcc/m2/gm2-gcc/m2tree.cc                   |   2 +-
>  gcc/m2/gm2-gcc/m2treelib.cc                |   2 +-
>  gcc/m2/m2pp.cc                             |   4 +-
>  gcc/match.pd                               |  48 +++----
>  gcc/objc/objc-act.cc                       |  32 ++---
>  gcc/objc/objc-encoding.cc                  |   2 +-
>  gcc/objc/objc-gnu-runtime-abi-01.cc        |   4 +-
>  gcc/objc/objc-next-runtime-abi-01.cc       |   4 +-
>  gcc/objc/objc-next-runtime-abi-02.cc       |   6 +-
>  gcc/omp-expand.cc                          | 156 ++++++++++-----------
>  gcc/omp-general.cc                         |  10 +-
>  gcc/omp-low.cc                             |  45 +++---
>  gcc/omp-oacc-neuter-broadcast.cc           |   8 +-
>  gcc/omp-offload.cc                         |   2 +-
>  gcc/omp-simd-clone.cc                      |  28 ++--
>  gcc/pointer-query.cc                       |  12 +-
>  gcc/predict.cc                             |   4 +-
>  gcc/range-op.cc                            |   4 +-
>  gcc/rust/backend/rust-tree.cc              |   2 +-
>  gcc/rust/rust-gcc.cc                       |   2 +-
>  gcc/sese.cc                                |   2 +-
>  gcc/tree-affine.cc                         |  12 +-
>  gcc/tree-cfg.cc                            |  38 ++---
>  gcc/tree-chrec.cc                          |  14 +-
>  gcc/tree-chrec.h                           |   4 +-
>  gcc/tree-core.h                            |   2 +-
>  gcc/tree-data-ref.cc                       |  18 +--
>  gcc/tree-dfa.cc                            |   2 +-
>  gcc/tree-if-conv.cc                        |   4 +-
>  gcc/tree-inline.cc                         |  10 +-
>  gcc/tree-nested.cc                         |   8 +-
>  gcc/tree-object-size.cc                    |  10 +-
>  gcc/tree-outof-ssa.cc                      |   2 +-
>  gcc/tree-pretty-print.cc                   |   8 +-
>  gcc/tree-profile.cc                        |   2 +-
>  gcc/tree-scalar-evolution.cc               |   8 +-
>  gcc/tree-sra.cc                            |   2 +-
>  gcc/tree-ssa-address.cc                    |   6 +-
>  gcc/tree-ssa-alias.cc                      |  18 +--
>  gcc/tree-ssa-ccp.cc                        |  22 +--
>  gcc/tree-ssa-copy.cc                       |   4 +-
>  gcc/tree-ssa-dom.cc                        |   2 +-
>  gcc/tree-ssa-dse.cc                        |   2 +-
>  gcc/tree-ssa-forwprop.cc                   |   6 +-
>  gcc/tree-ssa-ifcombine.cc                  |   2 +-
>  gcc/tree-ssa-loop-ch.cc                    |   2 +-
>  gcc/tree-ssa-loop-ivopts.cc                |  44 +++---
>  gcc/tree-ssa-loop-manip.cc                 |  10 +-
>  gcc/tree-ssa-loop-niter.cc                 |  40 +++---
>  gcc/tree-ssa-loop-split.cc                 |  10 +-
>  gcc/tree-ssa-phiopt.cc                     |   2 +-
>  gcc/tree-ssa-phiprop.cc                    |   2 +-
>  gcc/tree-ssa-reassoc.cc                    |  14 +-
>  gcc/tree-ssa-sccvn.cc                      |   6 +-
>  gcc/tree-ssa-strlen.cc                     |  10 +-
>  gcc/tree-ssa-structalias.cc                |  14 +-
>  gcc/tree-ssa-threadedge.cc                 |   2 +-
>  gcc/tree-ssa-uninit.cc                     |  10 +-
>  gcc/tree-ssa.cc                            |   2 +-
>  gcc/tree-ssanames.cc                       |  22 +--
>  gcc/tree-stdarg.cc                         |   6 +-
>  gcc/tree-streamer-in.cc                    |   2 +-
>  gcc/tree-streamer-out.cc                   |   2 +-
>  gcc/tree-tailcall.cc                       |   8 +-
>  gcc/tree-vect-data-refs.cc                 |   4 +-
>  gcc/tree-vect-loop-manip.cc                |   2 +-
>  gcc/tree-vect-loop.cc                      |   4 +-
>  gcc/tree-vect-stmts.cc                     |  18 +--
>  gcc/tree-vrp.cc                            |   6 +-
>  gcc/tree.cc                                |  64 ++++-----
>  gcc/tree.h                                 |  30 ++--
>  gcc/ubsan.cc                               |  18 +--
>  gcc/value-pointer-equiv.cc                 |   4 +-
>  gcc/value-pointer-equiv.h                  |   2 +-
>  gcc/value-query.cc                         |  12 +-
>  gcc/value-range.h                          |   6 +-
>  gcc/var-tracking.cc                        |   6 +-
>  gcc/varasm.cc                              |  10 +-
>  gcc/vr-values.cc                           |   6 +-
>  219 files changed, 1139 insertions(+), 1148 deletions(-)
>
> --
> 2.41.0
>

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

* Re: [PATCH 0/8] Tweak predicate macros in tree
  2023-07-19  7:07 ` [PATCH 0/8] Tweak predicate macros in tree Richard Biener
@ 2023-07-19 17:27   ` Ken Matsui
  0 siblings, 0 replies; 11+ messages in thread
From: Ken Matsui @ 2023-07-19 17:27 UTC (permalink / raw)
  To: Richard Biener; +Cc: Ken Matsui, gcc-patches

On Wed, Jul 19, 2023 at 12:08 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, Jul 19, 2023 at 1:34 AM Ken Matsui via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > This patch series tweaks predicate macros in tree.h to make the code more
> > readable. TYPE_REF_P is moved to tree.h and used for INDIRECT_TYPE_P and
> > TYPE_REF_IS_LVALUE. TYPE_PTR_P is also moved to tree.h and used for
> > INDIRECT_TYPE_P. POINTER_TYPE_P in tree.h is replaced with INDIRECT_TYPE_P
> > since it is ambiguous. TYPE_REF_IS_LVALUE is defined in tree.h through
> > TYPE_REF_P and TYPE_REF_IS_RVALUE. The same behavior codes with those
> > predicate macros are replaced for clarity.
> >
> > These works were all the way up to implementing __is_lvalue_reference
> > built-in trait and optimizing the is_lvalue_reference trait. However, those
> > changes were dropped since I did not observe any performance improvements.
> > For those who are interested in the benchmark results, they can be found
> > below:
> >
> > 1. is_lvalue_reference
> >
> > https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference.md#tue-jul-18-033708-pm-pdt-2023
> >
> > Time: +1.35432%
> > Peak Memory Usage: -0.103283%
> > Total Memory Usage: No difference
> >
> > 2. is_lvalue_reference_v
> >
> > https://github.com/ken-matsui/gcc-benches/blob/main/is_lvalue_reference_v.md#tue-jul-18-034236-pm-pdt-2023
> >
> > Time: No difference
> > Peak Memory Usage: -0.426872%
> > Total Memory Usage: -0.677638%
> >
> > Ken Matsui (8):
> >   c++, tree: Move TYPE_REF_P to tree.h
> >   gcc: Use TYPE_REF_P
> >   c++, tree: Move TYPE_PTR_P to tree.h
> >   c++, tree: Move INDIRECT_TYPE_P to tree.h
> >   gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P
>
> No, please not.  Definitely not.  The tree code of POINTER_TYPE_P is
> POINTER_TYPE so the predicate name is exactly correct.
> REFERENCE_TYPE_P would be the canonical predicate for REFERENCE_TYPE,
> not TYPE_REF_P.
>
> I don't think the C++ frontend should be the one to decide about middle-end
> tree predicate macros.
>

Hi Richard,

Thank you for your review! This is because of the comment, which
states that POINTER_TYPE_P should be renamed to INDIRECT_TYPE_P.

  /* Nonzero if TYPE represents a pointer or reference type.
     (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
     ascending code order.  */

  #define POINTER_TYPE_P(TYPE) \
    (TREE_CODE (TYPE) == POINTER_TYPE || TYPE_REF_P (TYPE))

Also, INDIRECT_TYPE_P is equivalent to POINTER_TYPE_P.

  #define INDIRECT_TYPE_P(NODE)                  \
    (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))

  #define TYPE_PTR_P(NODE)                       \
    (TREE_CODE (NODE) == POINTER_TYPE)

IMHO, POINTER_TYPE_P and TYPE_PTR_P are confusing since POINTER_TYPE_P
involves TYPE_REF_P but TYPE_PTR_P does not. If this renaming is still
incorrect, I think we should at least remove the comment in
POINTER_TYPE_P. Could you please confirm whether or not this patch is
correct? Thank you!

Sincerely,
Ken

> >   tree: Remove POINTER_TYPE_P
> >   tree: Define TYPE_REF_IS_LVALUE
> >   c++, lto: Use TYPE_REF_IS_LVALUE
> >
> >  gcc/ada/gcc-interface/ada-tree.h           |   2 +-
> >  gcc/ada/gcc-interface/decl.cc              |   6 +-
> >  gcc/ada/gcc-interface/trans.cc             |  16 +--
> >  gcc/ada/gcc-interface/utils.cc             |  12 +-
> >  gcc/ada/gcc-interface/utils2.cc            |  14 +-
> >  gcc/alias.cc                               |  12 +-
> >  gcc/analyzer/analyzer.cc                   |   4 +-
> >  gcc/analyzer/call-details.h                |   2 +-
> >  gcc/analyzer/call-summary.cc               |   2 +-
> >  gcc/analyzer/checker-event.cc              |   4 +-
> >  gcc/analyzer/constraint-manager.cc         |   2 +-
> >  gcc/analyzer/engine.cc                     |   4 +-
> >  gcc/analyzer/program-state.cc              |   2 +-
> >  gcc/analyzer/region-model-manager.cc       |   6 +-
> >  gcc/analyzer/region-model.cc               |   6 +-
> >  gcc/analyzer/sm.cc                         |   4 +-
> >  gcc/analyzer/svalue.cc                     |   2 +-
> >  gcc/analyzer/varargs.cc                    |   2 +-
> >  gcc/asan.cc                                |   4 +-
> >  gcc/builtins.cc                            |  24 ++--
> >  gcc/c-family/c-ada-spec.cc                 |   2 +-
> >  gcc/c-family/c-attribs.cc                  |  32 ++---
> >  gcc/c-family/c-common.cc                   |  41 +++---
> >  gcc/c-family/c-omp.cc                      |   8 +-
> >  gcc/c-family/c-pretty-print.cc             |   4 +-
> >  gcc/c-family/c-ubsan.cc                    |  10 +-
> >  gcc/c-family/c-warn.cc                     |  34 ++---
> >  gcc/c/c-decl.cc                            |   8 +-
> >  gcc/c/c-parser.cc                          |   4 +-
> >  gcc/c/c-typeck.cc                          |  40 +++---
> >  gcc/c/gimple-parser.cc                     |   8 +-
> >  gcc/calls.cc                               |   2 +-
> >  gcc/cfgexpand.cc                           |   6 +-
> >  gcc/cgraph.cc                              |   2 +-
> >  gcc/cgraphunit.cc                          |   2 +-
> >  gcc/config/aarch64/aarch64-builtins.cc     |   2 +-
> >  gcc/config/aarch64/aarch64-sve-builtins.cc |   2 +-
> >  gcc/config/aarch64/aarch64.cc              |   6 +-
> >  gcc/config/arc/arc.cc                      |   2 +-
> >  gcc/config/arm/arm-builtins.cc             |   6 +-
> >  gcc/config/arm/arm-mve-builtins.cc         |   2 +-
> >  gcc/config/avr/avr.cc                      |   6 +-
> >  gcc/config/epiphany/epiphany.cc            |   2 +-
> >  gcc/config/gcn/gcn-tree.cc                 |   2 +-
> >  gcc/config/gcn/gcn.cc                      |   6 +-
> >  gcc/config/i386/i386-builtins.cc           |   2 +-
> >  gcc/config/i386/i386-options.cc            |   2 +-
> >  gcc/config/i386/i386.cc                    |  10 +-
> >  gcc/config/m32c/m32c.cc                    |   2 +-
> >  gcc/config/m68k/m68k.cc                    |   4 +-
> >  gcc/config/mips/mips.cc                    |   2 +-
> >  gcc/config/mn10300/mn10300.cc              |   2 +-
> >  gcc/config/msp430/msp430.cc                |   2 +-
> >  gcc/config/nios2/nios2.cc                  |   2 +-
> >  gcc/config/pa/pa.cc                        |   4 +-
> >  gcc/config/pru/pru-passes.cc               |   2 +-
> >  gcc/config/pru/pru.cc                      |   2 +-
> >  gcc/config/rs6000/rs6000-builtin.cc        |   4 +-
> >  gcc/config/rs6000/rs6000-c.cc              |  10 +-
> >  gcc/config/rs6000/rs6000.cc                |   4 +-
> >  gcc/config/s390/s390-c.cc                  |   2 +-
> >  gcc/config/s390/s390.cc                    |  12 +-
> >  gcc/config/sparc/sparc.cc                  |   2 +-
> >  gcc/convert.cc                             |   4 +-
> >  gcc/cp/class.cc                            |   4 +-
> >  gcc/cp/constexpr.cc                        |   8 +-
> >  gcc/cp/coroutines.cc                       |   4 +-
> >  gcc/cp/cp-gimplify.cc                      |   2 +-
> >  gcc/cp/cp-tree.h                           |  12 --
> >  gcc/cp/decl.cc                             |   5 +-
> >  gcc/cp/init.cc                             |   5 +-
> >  gcc/cp/method.cc                           |   5 +-
> >  gcc/cp/pt.cc                               |   8 +-
> >  gcc/cp/semantics.cc                        |  18 +--
> >  gcc/cp/tree.cc                             |   2 +-
> >  gcc/cp/typeck.cc                           |   4 +-
> >  gcc/d/d-attribs.cc                         |   6 +-
> >  gcc/d/d-builtins.cc                        |   2 +-
> >  gcc/d/d-codegen.cc                         |  12 +-
> >  gcc/d/d-convert.cc                         |  12 +-
> >  gcc/d/expr.cc                              |  10 +-
> >  gcc/d/intrinsics.cc                        |  12 +-
> >  gcc/dojump.cc                              |   4 +-
> >  gcc/dwarf2out.cc                           |   2 +-
> >  gcc/emit-rtl.cc                            |   2 +-
> >  gcc/expmed.cc                              |   2 +-
> >  gcc/expr.cc                                |  22 +--
> >  gcc/fold-const.cc                          |  58 ++++----
> >  gcc/fortran/trans-array.cc                 |  36 ++---
> >  gcc/fortran/trans-decl.cc                  |  32 ++---
> >  gcc/fortran/trans-expr.cc                  | 106 +++++++-------
> >  gcc/fortran/trans-intrinsic.cc             |  28 ++--
> >  gcc/fortran/trans-io.cc                    |   8 +-
> >  gcc/fortran/trans-openmp.cc                |  88 ++++++------
> >  gcc/fortran/trans-stmt.cc                  |  14 +-
> >  gcc/fortran/trans-types.cc                 |   8 +-
> >  gcc/fortran/trans.cc                       |  14 +-
> >  gcc/function-abi.cc                        |   2 +-
> >  gcc/function.cc                            |   6 +-
> >  gcc/gimple-array-bounds.cc                 |   6 +-
> >  gcc/gimple-expr.cc                         |   8 +-
> >  gcc/gimple-fold.cc                         |  20 +--
> >  gcc/gimple-loop-versioning.cc              |   4 +-
> >  gcc/gimple-low.cc                          |   2 +-
> >  gcc/gimple-pretty-print.cc                 |   4 +-
> >  gcc/gimple-range-cache.cc                  |   4 +-
> >  gcc/gimple-range-fold.cc                   |   2 +-
> >  gcc/gimple-range-infer.cc                  |   2 +-
> >  gcc/gimple-range-path.cc                   |   4 +-
> >  gcc/gimple-ssa-isolate-paths.cc            |   6 +-
> >  gcc/gimple-ssa-nonnull-compare.cc          |   4 +-
> >  gcc/gimple-ssa-sprintf.cc                  |   4 +-
> >  gcc/gimple-ssa-store-merging.cc            |   6 +-
> >  gcc/gimple-ssa-strength-reduction.cc       |  22 +--
> >  gcc/gimple-ssa-warn-access.cc              |   8 +-
> >  gcc/gimple-ssa-warn-restrict.cc            |   6 +-
> >  gcc/gimple.cc                              |  10 +-
> >  gcc/gimplify.cc                            |  44 +++---
> >  gcc/go/go-gcc.cc                           |   2 +-
> >  gcc/godump.cc                              |   4 +-
> >  gcc/graphite-isl-ast-to-gimple.cc          |   8 +-
> >  gcc/graphite-sese-to-poly.cc               |   2 +-
> >  gcc/ipa-cp.cc                              |   4 +-
> >  gcc/ipa-devirt.cc                          |   8 +-
> >  gcc/ipa-free-lang-data.cc                  |   8 +-
> >  gcc/ipa-icf-gimple.cc                      |   2 +-
> >  gcc/ipa-icf.cc                             |   6 +-
> >  gcc/ipa-modref-tree.cc                     |   2 +-
> >  gcc/ipa-modref.cc                          |   8 +-
> >  gcc/ipa-param-manipulation.cc              |   4 +-
> >  gcc/ipa-polymorphic-call.cc                |   6 +-
> >  gcc/ipa-prop.cc                            |  28 ++--
> >  gcc/ipa-sra.cc                             |   4 +-
> >  gcc/jit/dummy-frontend.cc                  |   2 +-
> >  gcc/langhooks.cc                           |   2 +-
> >  gcc/lto-streamer-out.cc                    |   4 +-
> >  gcc/lto/lto-common.cc                      |  10 +-
> >  gcc/lto/lto-lang.cc                        |   2 +-
> >  gcc/lto/lto-symtab.cc                      |   2 +-
> >  gcc/m2/gm2-gcc/m2expr.cc                   |  12 +-
> >  gcc/m2/gm2-gcc/m2tree.cc                   |   2 +-
> >  gcc/m2/gm2-gcc/m2treelib.cc                |   2 +-
> >  gcc/m2/m2pp.cc                             |   4 +-
> >  gcc/match.pd                               |  48 +++----
> >  gcc/objc/objc-act.cc                       |  32 ++---
> >  gcc/objc/objc-encoding.cc                  |   2 +-
> >  gcc/objc/objc-gnu-runtime-abi-01.cc        |   4 +-
> >  gcc/objc/objc-next-runtime-abi-01.cc       |   4 +-
> >  gcc/objc/objc-next-runtime-abi-02.cc       |   6 +-
> >  gcc/omp-expand.cc                          | 156 ++++++++++-----------
> >  gcc/omp-general.cc                         |  10 +-
> >  gcc/omp-low.cc                             |  45 +++---
> >  gcc/omp-oacc-neuter-broadcast.cc           |   8 +-
> >  gcc/omp-offload.cc                         |   2 +-
> >  gcc/omp-simd-clone.cc                      |  28 ++--
> >  gcc/pointer-query.cc                       |  12 +-
> >  gcc/predict.cc                             |   4 +-
> >  gcc/range-op.cc                            |   4 +-
> >  gcc/rust/backend/rust-tree.cc              |   2 +-
> >  gcc/rust/rust-gcc.cc                       |   2 +-
> >  gcc/sese.cc                                |   2 +-
> >  gcc/tree-affine.cc                         |  12 +-
> >  gcc/tree-cfg.cc                            |  38 ++---
> >  gcc/tree-chrec.cc                          |  14 +-
> >  gcc/tree-chrec.h                           |   4 +-
> >  gcc/tree-core.h                            |   2 +-
> >  gcc/tree-data-ref.cc                       |  18 +--
> >  gcc/tree-dfa.cc                            |   2 +-
> >  gcc/tree-if-conv.cc                        |   4 +-
> >  gcc/tree-inline.cc                         |  10 +-
> >  gcc/tree-nested.cc                         |   8 +-
> >  gcc/tree-object-size.cc                    |  10 +-
> >  gcc/tree-outof-ssa.cc                      |   2 +-
> >  gcc/tree-pretty-print.cc                   |   8 +-
> >  gcc/tree-profile.cc                        |   2 +-
> >  gcc/tree-scalar-evolution.cc               |   8 +-
> >  gcc/tree-sra.cc                            |   2 +-
> >  gcc/tree-ssa-address.cc                    |   6 +-
> >  gcc/tree-ssa-alias.cc                      |  18 +--
> >  gcc/tree-ssa-ccp.cc                        |  22 +--
> >  gcc/tree-ssa-copy.cc                       |   4 +-
> >  gcc/tree-ssa-dom.cc                        |   2 +-
> >  gcc/tree-ssa-dse.cc                        |   2 +-
> >  gcc/tree-ssa-forwprop.cc                   |   6 +-
> >  gcc/tree-ssa-ifcombine.cc                  |   2 +-
> >  gcc/tree-ssa-loop-ch.cc                    |   2 +-
> >  gcc/tree-ssa-loop-ivopts.cc                |  44 +++---
> >  gcc/tree-ssa-loop-manip.cc                 |  10 +-
> >  gcc/tree-ssa-loop-niter.cc                 |  40 +++---
> >  gcc/tree-ssa-loop-split.cc                 |  10 +-
> >  gcc/tree-ssa-phiopt.cc                     |   2 +-
> >  gcc/tree-ssa-phiprop.cc                    |   2 +-
> >  gcc/tree-ssa-reassoc.cc                    |  14 +-
> >  gcc/tree-ssa-sccvn.cc                      |   6 +-
> >  gcc/tree-ssa-strlen.cc                     |  10 +-
> >  gcc/tree-ssa-structalias.cc                |  14 +-
> >  gcc/tree-ssa-threadedge.cc                 |   2 +-
> >  gcc/tree-ssa-uninit.cc                     |  10 +-
> >  gcc/tree-ssa.cc                            |   2 +-
> >  gcc/tree-ssanames.cc                       |  22 +--
> >  gcc/tree-stdarg.cc                         |   6 +-
> >  gcc/tree-streamer-in.cc                    |   2 +-
> >  gcc/tree-streamer-out.cc                   |   2 +-
> >  gcc/tree-tailcall.cc                       |   8 +-
> >  gcc/tree-vect-data-refs.cc                 |   4 +-
> >  gcc/tree-vect-loop-manip.cc                |   2 +-
> >  gcc/tree-vect-loop.cc                      |   4 +-
> >  gcc/tree-vect-stmts.cc                     |  18 +--
> >  gcc/tree-vrp.cc                            |   6 +-
> >  gcc/tree.cc                                |  64 ++++-----
> >  gcc/tree.h                                 |  30 ++--
> >  gcc/ubsan.cc                               |  18 +--
> >  gcc/value-pointer-equiv.cc                 |   4 +-
> >  gcc/value-pointer-equiv.h                  |   2 +-
> >  gcc/value-query.cc                         |  12 +-
> >  gcc/value-range.h                          |   6 +-
> >  gcc/var-tracking.cc                        |   6 +-
> >  gcc/varasm.cc                              |  10 +-
> >  gcc/vr-values.cc                           |   6 +-
> >  219 files changed, 1139 insertions(+), 1148 deletions(-)
> >
> > --
> > 2.41.0
> >

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

end of thread, other threads:[~2023-07-19 17:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
2023-07-18 23:12 ` [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h Ken Matsui
2023-07-18 23:12 ` [PATCH 2/8] gcc: Use TYPE_REF_P Ken Matsui
2023-07-18 23:12 ` [PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h Ken Matsui
2023-07-18 23:12 ` [PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P " Ken Matsui
2023-07-18 23:12 ` [PATCH 5/8] gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P Ken Matsui
2023-07-18 23:12 ` [PATCH 6/8] tree: Remove POINTER_TYPE_P Ken Matsui
2023-07-18 23:12 ` [PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE Ken Matsui
2023-07-18 23:12 ` [PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE Ken Matsui
2023-07-19  7:07 ` [PATCH 0/8] Tweak predicate macros in tree Richard Biener
2023-07-19 17:27   ` Ken Matsui

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