tree-pretty-print.c (dump_generic_node): Change dump format for REALPART_EXPR and...
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Thu, 22 Dec 2016 20:30:33 +0000 (20:30 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Thu, 22 Dec 2016 20:30:33 +0000 (20:30 +0000)
2016-12-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* tree-pretty-print.c (dump_generic_node): Change dump format for
REALPART_EXPR and IMAGPART_EXPR with TDF_GIMPLE.

testsuite/
* gcc.dg/gimplefe-20.c: New test-case.

From-SVN: r243898

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gimplefe-20.c [new file with mode: 0644]
gcc/tree-pretty-print.c

index 64f7b88d3adeded1ae168291dfed049bfaf32e28..16ca10b945e026ab2796e1f42e732b8b9f630e10 100644 (file)
@@ -1,3 +1,8 @@
+2016-12-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
+
+       * tree-pretty-print.c (dump_generic_node): Change dump format for
+       REALPART_EXPR and IMAGPART_EXPR with TDF_GIMPLE.
+
 2016-12-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * varasm.c (build_constant_desc): Use the alignment of the var
index 439bcbf0b73875b318fdd0e63a26b9da271624dc..c8b5544eb2c9ab8b1f47c648a563e57c5bd8114b 100644 (file)
@@ -1,3 +1,7 @@
+2016-12-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
+
+       * gcc.dg/gimplefe-20.c: New test-case.
+
 2016-12-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * gcc.target/s390/litpool-str-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/gimplefe-20.c b/gcc/testsuite/gcc.dg/gimplefe-20.c
new file mode 100644 (file)
index 0000000..99b3180
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple -fdump-tree-ssa-gimple" } */
+
+_Complex a;
+
+double __GIMPLE() f()
+{
+  double t1;
+  double t2;
+  double _1;
+
+bb1:
+  t1_2 = __real a;
+  t2_3 = __imag a;
+  _1 = t1_2 + t2_3;
+  return _1;
+}
+
+/* { dg-final { scan-tree-dump "__real a" "ssa" } } */
+/* { dg-final { scan-tree-dump "__imag a" "ssa" } } */
index 5b3e23e40f7e8b5c02a8a3dd2da2e4a9bf6e1e34..40c0bc6defe2f6142b751541dadcadb9697df84b 100644 (file)
@@ -2451,15 +2451,31 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
       break;
 
     case REALPART_EXPR:
-      pp_string (pp, "REALPART_EXPR <");
-      dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
-      pp_greater (pp);
+      if (flags & TDF_GIMPLE)
+       {
+         pp_string (pp, "__real ");
+         dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
+       }
+      else
+       {
+         pp_string (pp, "REALPART_EXPR <");
+         dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
+         pp_greater (pp);
+       }
       break;
 
     case IMAGPART_EXPR:
-      pp_string (pp, "IMAGPART_EXPR <");
-      dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
-      pp_greater (pp);
+      if (flags & TDF_GIMPLE)
+       {
+         pp_string (pp, "__imag ");
+         dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
+       }
+      else
+       {
+         pp_string (pp, "IMAGPART_EXPR <");
+         dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
+         pp_greater (pp);
+       }
       break;
 
     case VA_ARG_EXPR: