PR middle-end/90676 - default GIMPLE dumps lack information
authorMartin Sebor <msebor@redhat.com>
Wed, 12 Jun 2019 17:05:35 +0000 (17:05 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 12 Jun 2019 17:05:35 +0000 (11:05 -0600)
gcc/ChangeLog:

PR middle-end/90676
* tree-pretty-print.c (dump_mem_ref): New function.  Include
MEM_REF type in output when different size than operand.
(dump_generic_node): Move code to dump_mem_ref and call it.

gcc/testsuite/ChangeLog:

PR middle-end/90676
* gcc.dg/tree-ssa/dump-6.c: New test.
* g++.dg/tree-ssa/pr19807.C: Adjust expected output.
* g++.dg/tree-ssa/ssa-dse-1.C: Same.
* gcc.dg/store_merging_5.c: Same.
* gcc.dg/tree-prof/stringop-2.c: Same.
* gcc.dg/tree-ssa/pr30375.c: Same.
* gcc.dg/tree-ssa/slsr-27.c: Same.
* gcc.dg/tree-ssa/slsr-28.c: Same.
* gcc.dg/tree-ssa/slsr-29.c: Same.
* gcc.dg/tree-ssa/ssa-dse-24.c: Same.

From-SVN: r272199

13 files changed:
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr19807.C
gcc/testsuite/g++.dg/tree-ssa/ssa-dse-1.C
gcc/testsuite/gcc.dg/store_merging_5.c
gcc/testsuite/gcc.dg/tree-prof/stringop-2.c
gcc/testsuite/gcc.dg/tree-ssa/dump-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c
gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-24.c
gcc/tree-pretty-print.c

index d05e60f0fd3cdd14fc58f8772391d6ee66103b5b..fea2d021c089582ab478a94700eb64aa3f95990e 100644 (file)
@@ -1,3 +1,10 @@
+2019-06-12  Martin Sebor  <msebor@redhat.com>
+
+       PR middle-end/90676
+       * tree-pretty-print.c (dump_mem_ref): New function.  Include
+       MEM_REF type in output when different size than operand.
+       (dump_generic_node): Move code to dump_mem_ref and call it.
+
 2019-06-12  Martin Sebor  <msebor@redhat.com>
 
        PR tree-optimization/90662
index dfdf3f3678ad4839224ecb96607a2ac2712e561b..4c4adbc0445e6362f2154968bc1fd988f5c81adf 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-12  Martin Sebor  <msebor@redhat.com>
+
+       PR middle-end/90676
+       * gcc.dg/tree-ssa/dump-6.c: New test.
+       * g++.dg/tree-ssa/pr19807.C: Adjust expected output.
+       * g++.dg/tree-ssa/ssa-dse-1.C: Same.
+       * gcc.dg/tree-prof/stringop-2.c
+       * gcc.dg/tree-ssa/pr30375.c: Same.
+       * gcc.dg/tree-ssa/slsr-27.c (f): Same.
+       * gcc.dg/tree-ssa/slsr-28.c (f): Same.
+       * gcc.dg/tree-ssa/slsr-29.c (f): Same.
+       * gcc.dg/tree-ssa/ssa-dse-24.c: Same.
+
 2019-06-12  Martin Sebor  <msebor@redhat.com>
 
        PR tree-optimization/90662
index cbe06b4ce62f1d958433af5acb231a86a9853a10..10de295e14d5ef4104c3b75d4264870fbf86f922 100644 (file)
@@ -11,7 +11,8 @@ void foo(void)
        z = 1 + &a[1];
 }
 
-/* { dg-final { scan-tree-dump-times "&MEM\\\[\\\(void .\\\)&a \\\+ 8B\\\]" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&MEM\\\[\\\(void .\\\)&a \\\+ 8B\\\]" 3 "optimized" { target { ! store_merge } } } }
+   { dg-final { scan-tree-dump-times "&MEM <int> \\\[\\\(void .\\\)&a \\\+ 8B\\\]" 3 "optimized" { target { store_merge } } } } */
 
 
 void bar(int i)
index 1fd8dec99e986c78b54608a335f3f74c5afca7cb..7bcb65af13cf61ec0096e2cf1d089a2a841f92a4 100644 (file)
@@ -97,5 +97,5 @@ int main()
 }
 
 
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" } } */
-
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { ! store_merge } } } }
+   { dg-final { scan-tree-dump-times "MEM <char\\\[176]> \\\[\\(struct FixBuf \\*\\)&<retval> \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { store_merge } } } } */
index e6c349767bc6c67bfe5e36ff5828edf99d87301f..6e7c72510ffd47868ebe5e75769ae29b92f55c11 100644 (file)
@@ -26,5 +26,7 @@ foo1 (struct bar *p, char tmp)
 }
 
 
-/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" } } */
-/* { dg-final { scan-tree-dump-times "MEM\\\[.*\\\]" 1 "store-merging" } } */
+/* { dg-final { scan-tree-dump-times "Merging successful" 1 "store-merging" } }
+   { dg-final { scan-tree-dump-times "MEM\\\[.*\\\]" 1 "store-merging" { target { ! store_merge } } } }
+   { dg-final { scan-tree-dump-times "MEM <unsigned int> \\\[.*\\\]" 1 "store-merging" { target { store_merge && ilp32 } } } }
+   { dg-final { scan-tree-dump-times "MEM <unsigned long> \\\[.*\\\]" 1 "store-merging" { target { store_merge && lp64 } } } } */
index 3242cf5b8a21c01811f619835e1b9bbc2fb2e494..c1f757388fd66fd2e92b81807906dc9f9ad19bfb 100644 (file)
@@ -21,5 +21,6 @@ main()
 }
 /* autofdo doesn't support value profiling for now: */
 /* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 4 stringop" "profile"} } */
-/* The versioned memset of size 4 should be optimized to an assignment.  */
-/* { dg-final-use-not-autofdo { scan-tree-dump "MEM\\\[\\(void .\\)&a\\\] = 168430090" "optimized"} } */
+/* The versioned memset of size 4 should be optimized to an assignment.
+   { dg-final-use-not-autofdo { scan-tree-dump "MEM\\\[\\(void .\\)&a\\\] = 168430090" "optimized" { target { ! store_merge } } } }
+   { dg-final-use-not-autofdo { scan-tree-dump "MEM <\[a-z \]+> \\\[\\(void .\\)&a\\\] = 168430090" "optimized" { target { store_merge } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c b/gcc/testsuite/gcc.dg/tree-ssa/dump-6.c
new file mode 100644 (file)
index 0000000..3e09668
--- /dev/null
@@ -0,0 +1,38 @@
+/* PR middle-end/90676 - default GIMPLE dumps lack information
+   { dg-do compile }
+   { dg-options "-O2 -fdump-tree-store-merging" }
+   { dg-require-effective-target int32plus }
+   { dg-require-effective-target store_merge } */
+
+
+extern char a2[2];
+
+void f2 (void)
+{
+  a2[0] = 1;
+  a2[1] = 0;
+}
+
+extern char a4[4];
+
+void f4 (void)
+{
+  a4[0] = 1;
+  a4[1] = 0;
+  a4[2] = 0;
+  a4[3] = 0;
+}
+
+extern char a8[8];
+
+void f8 (void)
+{
+  a8[0] = 1;
+  for (int i = 1; i != 8; ++i)
+    a8[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump "MEM <unsigned short> \\\[\\(char \\*\\)\\&a2] = " "store-merging" } }
+   { dg-final { scan-tree-dump "MEM <unsigned int> \\\[\\(char \\*\\)\\&a4] = " "store-merging" } }
+   { dg-final { scan-tree-dump "MEM <unsigned int> \\\[\\(char \\*\\)\\&a8] = " "store-merging" { target { ilp32 } } } }
+   { dg-final { scan-tree-dump "MEM <unsigned long> \\\[\\(char \\*\\)\\&a8] = " "store-merging" { target { lp64 } } } } */
index 4494a2b0bd6b274ac983914c75580f9098fe00f3..5c068a3ddc00b4209439c3cbbf3c695bd3c24455 100644 (file)
@@ -22,5 +22,6 @@ void test_signed_msg_encoding(void)
     f();
 }
 
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct _s \\*\\)&signInfo \\+ \[0-9\]+B\\\] = {}" 1 "dse1" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct _s \\*\\)&signInfo \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { ! store_merge } } } }
+   { dg-final { scan-tree-dump-times "MEM <char\\\[8]> \\\[\\(struct _s \\*\\)&signInfo \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { store_merge } } } } */
 
index 35b3d00ee44a5b6edd1d0616e242b0e6eb49cc80..e3560ee5d9aeb8ce96f4686ee5770d858e26537b 100644 (file)
@@ -19,4 +19,5 @@ f (struct x *p, unsigned int n)
 /* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom3" { target { int32 } } } } */
 /* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom3" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+;" 1 "dom3" } } */
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 3 "dom3" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 3 "dom3" { target { ! store_merge } } } } */
+/* { dg-final { scan-tree-dump-times "MEM <int> \\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 3 "dom3" { target { store_merge } } } } */
index 732d2324db5404a3d6eb40d94ce29e5f453b5892..0db27af76ce54753ce31f9343d8da1cbf4fbc467 100644 (file)
@@ -23,4 +23,5 @@ f (struct x *p, unsigned int n)
 /* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom3" { target { int32 } } } } */
 /* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom3" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom3" } } */
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" { target { ! store_merge } } } } */
+/* { dg-final { scan-tree-dump-times "MEM <int> \\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" { target { store_merge } } } } */
index a22cc7906dac00214d0d6f920fe228945bf9ec84..0f6169df3127a5b6fadaa4aa891f0535a92fa935 100644 (file)
@@ -25,4 +25,5 @@ f (struct x *p, unsigned int n)
 /* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom3" { target { int32 } } } } */
 /* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom3" { target { int16 } } } } */
 /* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom3" } } */
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" { target { ! store_merge } } } } */
+/* { dg-final { scan-tree-dump-times "MEM <int> \\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom3" { target { store_merge } } } } */
index 282194c1e3279e21e54b1f9349ca45ba0b6a05ad..240c90637171d2774195108b284f6b59de2ca010 100644 (file)
@@ -59,4 +59,5 @@ void foo(int prec,
     bar (&info);
 }
 
-/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct printf_info \\*\\)&info \\+ \[0-9\]+B\\\] = {}" 1 "dse1" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct printf_info \\*\\)&info \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { ! store_merge } } } }
+   { dg-final { scan-tree-dump-times "MEM <char[4]> \\\[\\(struct printf_info \\*\\)&info \\+ \[0-9\]+B\\\] = {}" 1 "dse1" { target { store_merge } } } } */
index 1e6c96813bbb59d82b77513aa32ec8ec149c6fb1..329cc6fceeb2a39dc99ccbb85b57ed69106da079 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "internal-fn.h"
 #include "gomp-constants.h"
 #include "gimple.h"
+#include "fold-const.h"
 
 /* Disable warnings about quoting issues in the pp_xxx calls below
    that (intentionally) don't follow GCC diagnostic conventions.  */
@@ -1378,6 +1379,129 @@ dump_omp_atomic_memory_order (pretty_printer *pp, enum omp_memory_order mo)
     }
 }
 
+/* Helper to dump a MEM_REF node.  */
+
+static void
+dump_mem_ref (pretty_printer *pp, tree node, int spc, dump_flags_t flags)
+{
+  if (flags & TDF_GIMPLE)
+    {
+      pp_string (pp, "__MEM <");
+      dump_generic_node (pp, TREE_TYPE (node),
+                        spc, flags | TDF_SLIM, false);
+      if (TYPE_ALIGN (TREE_TYPE (node))
+         != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node))))
+       {
+         pp_string (pp, ", ");
+         pp_decimal_int (pp, TYPE_ALIGN (TREE_TYPE (node)));
+       }
+      pp_greater (pp);
+      pp_string (pp, " (");
+      if (TREE_TYPE (TREE_OPERAND (node, 0))
+         != TREE_TYPE (TREE_OPERAND (node, 1)))
+       {
+         pp_left_paren (pp);
+         dump_generic_node (pp, TREE_TYPE (TREE_OPERAND (node, 1)),
+                            spc, flags | TDF_SLIM, false);
+         pp_right_paren (pp);
+       }
+      dump_generic_node (pp, TREE_OPERAND (node, 0),
+                        spc, flags | TDF_SLIM, false);
+      if (! integer_zerop (TREE_OPERAND (node, 1)))
+       {
+         pp_string (pp, " + ");
+         dump_generic_node (pp, TREE_OPERAND (node, 1),
+                            spc, flags | TDF_SLIM, false);
+       }
+      pp_right_paren (pp);
+    }
+  else if (integer_zerop (TREE_OPERAND (node, 1))
+          /* Dump the types of INTEGER_CSTs explicitly, for we can't
+             infer them and MEM_ATTR caching will share MEM_REFs
+             with differently-typed op0s.  */
+          && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
+          /* Released SSA_NAMES have no TREE_TYPE.  */
+          && TREE_TYPE (TREE_OPERAND (node, 0)) != NULL_TREE
+          /* Same pointer types, but ignoring POINTER_TYPE vs.
+             REFERENCE_TYPE.  */
+          && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
+              == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))
+          && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 0)))
+              == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 1))))
+          && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 0)))
+              == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 1))))
+          /* Same value types ignoring qualifiers.  */
+          && (TYPE_MAIN_VARIANT (TREE_TYPE (node))
+              == TYPE_MAIN_VARIANT
+              (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1)))))
+          && (!(flags & TDF_ALIAS)
+              || MR_DEPENDENCE_CLIQUE (node) == 0))
+    {
+      if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR)
+       {
+         /* Enclose pointers to arrays in parentheses.  */
+         tree op0 = TREE_OPERAND (node, 0);
+         tree op0type = TREE_TYPE (op0);
+         if (POINTER_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)
+             && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
+           pp_right_paren (pp);
+       }
+      else
+       dump_generic_node (pp,
+                          TREE_OPERAND (TREE_OPERAND (node, 0), 0),
+                          spc, flags, false);
+    }
+  else
+    {
+      pp_string (pp, "MEM");
+
+      tree nodetype = TREE_TYPE (node);
+      tree op0 = TREE_OPERAND (node, 0);
+      tree op1 = TREE_OPERAND (node, 1);
+      tree op1type = TYPE_MAIN_VARIANT (TREE_TYPE (op1));
+
+      tree op0size = TYPE_SIZE (nodetype);
+      tree op1size = TYPE_SIZE (TREE_TYPE (op1type));
+
+      if (!op0size || !op1size
+         || !operand_equal_p (op0size, op1size, 0))
+       {
+         pp_string (pp, " <");
+         /* If the size of the type of the operand is not the same
+            as the size of the MEM_REF expression include the type
+            of the latter similar to the TDF_GIMPLE output to make
+            it clear how many bytes of memory are being accessed.  */
+         dump_generic_node (pp, nodetype, spc, flags | TDF_SLIM, false);
+         pp_string (pp, "> ");
+       }
+
+      pp_string (pp, "[(");
+      dump_generic_node (pp, op1type, spc, flags | TDF_SLIM, false);
+      pp_right_paren (pp);
+      dump_generic_node (pp, op0, spc, flags, false);
+      if (!integer_zerop (op1))
+      if (!integer_zerop (TREE_OPERAND (node, 1)))
+       {
+         pp_string (pp, " + ");
+         dump_generic_node (pp, op1, spc, flags, false);
+       }
+      if ((flags & TDF_ALIAS)
+         && MR_DEPENDENCE_CLIQUE (node) != 0)
+       {
+         pp_string (pp, " clique ");
+         pp_unsigned_wide_integer (pp, MR_DEPENDENCE_CLIQUE (node));
+         pp_string (pp, " base ");
+         pp_unsigned_wide_integer (pp, MR_DEPENDENCE_BASE (node));
+       }
+      pp_right_bracket (pp);
+    }
+ }
+
 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
    indent.  FLAGS specifies details to show in the dump (see TDF_* in
    dumpfile.h).  If IS_STMT is true, the object printed is considered
@@ -1636,109 +1760,8 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
       break;
 
     case MEM_REF:
-      {
-       if (flags & TDF_GIMPLE)
-         {
-           pp_string (pp, "__MEM <");
-           dump_generic_node (pp, TREE_TYPE (node),
-                              spc, flags | TDF_SLIM, false);
-           if (TYPE_ALIGN (TREE_TYPE (node))
-               != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node))))
-             {
-               pp_string (pp, ", ");
-               pp_decimal_int (pp, TYPE_ALIGN (TREE_TYPE (node)));
-             }
-           pp_greater (pp);
-           pp_string (pp, " (");
-           if (TREE_TYPE (TREE_OPERAND (node, 0))
-               != TREE_TYPE (TREE_OPERAND (node, 1)))
-             {
-               pp_left_paren (pp);
-               dump_generic_node (pp, TREE_TYPE (TREE_OPERAND (node, 1)),
-                                  spc, flags | TDF_SLIM, false);
-               pp_right_paren (pp);
-             }
-           dump_generic_node (pp, TREE_OPERAND (node, 0),
-                              spc, flags | TDF_SLIM, false);
-           if (! integer_zerop (TREE_OPERAND (node, 1)))
-             {
-               pp_string (pp, " + ");
-               dump_generic_node (pp, TREE_OPERAND (node, 1),
-                                  spc, flags | TDF_SLIM, false);
-             }
-           pp_right_paren (pp);
-         }
-       else if (integer_zerop (TREE_OPERAND (node, 1))
-           /* Dump the types of INTEGER_CSTs explicitly, for we can't
-              infer them and MEM_ATTR caching will share MEM_REFs
-              with differently-typed op0s.  */
-           && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
-           /* Released SSA_NAMES have no TREE_TYPE.  */
-           && TREE_TYPE (TREE_OPERAND (node, 0)) != NULL_TREE
-           /* Same pointer types, but ignoring POINTER_TYPE vs.
-              REFERENCE_TYPE.  */
-           && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
-               == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))
-           && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 0)))
-               == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 1))))
-           && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 0)))
-               == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 1))))
-           /* Same value types ignoring qualifiers.  */
-           && (TYPE_MAIN_VARIANT (TREE_TYPE (node))
-               == TYPE_MAIN_VARIANT
-                   (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1)))))
-           && (!(flags & TDF_ALIAS)
-               || MR_DEPENDENCE_CLIQUE (node) == 0))
-         {
-           if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR)
-             {
-               /* Enclose pointers to arrays in parentheses.  */
-               tree op0 = TREE_OPERAND (node, 0);
-               tree op0type = TREE_TYPE (op0);
-               if (POINTER_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)
-                   && TREE_CODE (TREE_TYPE (op0type)) == ARRAY_TYPE)
-                 pp_right_paren (pp);
-             }
-           else
-             dump_generic_node (pp,
-                                TREE_OPERAND (TREE_OPERAND (node, 0), 0),
-                                spc, flags, false);
-         }
-       else
-         {
-           tree ptype;
-
-           pp_string (pp, "MEM[");
-           pp_left_paren (pp);
-           ptype = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node, 1)));
-           dump_generic_node (pp, ptype,
-                              spc, flags | TDF_SLIM, false);
-           pp_right_paren (pp);
-           dump_generic_node (pp, TREE_OPERAND (node, 0),
-                              spc, flags, false);
-           if (!integer_zerop (TREE_OPERAND (node, 1)))
-             {
-               pp_string (pp, " + ");
-               dump_generic_node (pp, TREE_OPERAND (node, 1),
-                                  spc, flags, false);
-             }
-           if ((flags & TDF_ALIAS)
-               && MR_DEPENDENCE_CLIQUE (node) != 0)
-             {
-               pp_string (pp, " clique ");
-               pp_unsigned_wide_integer (pp, MR_DEPENDENCE_CLIQUE (node));
-               pp_string (pp, " base ");
-               pp_unsigned_wide_integer (pp, MR_DEPENDENCE_BASE (node));
-             }
-           pp_right_bracket (pp);
-         }
-       break;
-      }
+      dump_mem_ref (pp, node, spc, flags);
+      break;
 
     case TARGET_MEM_REF:
       {