]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gimple-pretty-print.c
Merge in trunk.
[thirdparty/gcc.git] / gcc / gimple-pretty-print.c
index a45dd535d9523cb642263335b85ad90939516840..c95b9c463571d41531354fcc5a1de07603a5ee9d 100644 (file)
@@ -27,9 +27,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "hashtab.h"
-#include "tree-ssa.h"
-#include "dumpfile.h"  /* for dump_flags */
+#include "bitmap.h"
 #include "gimple.h"
+#include "gimple-ssa.h"
+#include "cgraph.h"
+#include "tree-cfg.h"
+#include "tree-ssanames.h"
+#include "dumpfile.h"  /* for dump_flags */
 #include "value-prof.h"
 #include "trans-mem.h"
 
@@ -535,11 +539,12 @@ dump_gimple_assign (pretty_printer *buffer, gimple gs, int spc, int flags)
 static void
 dump_gimple_return (pretty_printer *buffer, gimple gs, int spc, int flags)
 {
-  tree t;
+  tree t, t2;
 
   t = gimple_return_retval (gs);
+  t2 = gimple_return_retbnd (gs);
   if (flags & TDF_RAW)
-    dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs, t);
+    dump_gimple_fmt (buffer, spc, flags, "%G <%T %T>", gs, t, t2);
   else
     {
       pp_string (buffer, "return");
@@ -548,6 +553,11 @@ dump_gimple_return (pretty_printer *buffer, gimple gs, int spc, int flags)
          pp_space (buffer);
          dump_generic_node (buffer, t, spc, flags, false);
        }
+      if (t2)
+       {
+         pp_string (buffer, ", ");
+         dump_generic_node (buffer, t2, spc, flags, false);
+       }
       pp_semicolon (buffer);
     }
 }
@@ -1714,7 +1724,7 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
     {
       unsigned int align, misalign;
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (node);
-      pp_string (buffer, "PT = ");
+      pp_string (buffer, "PT = ");
       pp_points_to_solution (buffer, &pi->pt);
       newline_and_indent (buffer, spc);
       if (get_ptr_info_alignment (pi, &align, &misalign))
@@ -1722,17 +1732,16 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
          pp_printf (buffer, "# ALIGN = %u, MISALIGN = %u", align, misalign);
          newline_and_indent (buffer, spc);
        }
-      pp_string (buffer, "# ");
     }
 
   if (!POINTER_TYPE_P (TREE_TYPE (node))
       && SSA_NAME_RANGE_INFO (node))
     {
-      widest_int min, max;
+      widest_int min, max, nonzero_bits;
       value_range_type range_type = get_range_info (node, &min, &max);
 
       if (range_type == VR_VARYING)
-       pp_printf (buffer, "# RANGE  VR_VARYING");
+       pp_printf (buffer, "# RANGE VR_VARYING");
       else if (range_type == VR_RANGE || range_type == VR_ANTI_RANGE)
        {
          pp_printf (buffer, "# RANGE ");
@@ -1741,18 +1750,27 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
          pp_printf (buffer, ", ");
          pp_wide_int (buffer, max, TYPE_SIGN (TREE_TYPE (node)));
          pp_printf (buffer, "]");
-         newline_and_indent (buffer, spc);
        }
+      nonzero_bits = get_nonzero_bits (node);
+      if (nonzero_bits != -1
+         && (nonzero_bits
+             != wi::mask <widest_int> (TYPE_PRECISION (TREE_TYPE (node)), false)))
+       {
+         pp_string (buffer, " NONZERO ");
+         pp_wide_int (buffer, nonzero_bits, UNSIGNED);
+       }
+      newline_and_indent (buffer, spc);
     }
 }
 
 
 /* Dump a PHI node PHI.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
    The caller is responsible for calling pp_flush on BUFFER to finalize
-   pretty printer.  */
+   pretty printer.  If COMMENT is true, print this after #.  */
 
 static void
-dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags)
+dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, bool comment,
+                int flags)
 {
   size_t i;
   tree lhs = gimple_phi_result (phi);
@@ -1760,6 +1778,9 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags)
   if (flags & TDF_ALIAS)
     dump_ssaname_info (buffer, lhs, spc);
 
+  if (comment)
+    pp_string (buffer, "# ");
+
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi,
                     gimple_phi_result (phi));
@@ -2095,7 +2116,7 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
       break;
 
     case GIMPLE_PHI:
-      dump_gimple_phi (buffer, gs, spc, flags);
+      dump_gimple_phi (buffer, gs, spc, false, flags);
       break;
 
     case GIMPLE_OMP_PARALLEL:
@@ -2271,8 +2292,7 @@ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
       if (!virtual_operand_p (gimple_phi_result (phi)) || (flags & TDF_VOPS))
         {
           INDENT (indent);
-          pp_string (buffer, "# ");
-          dump_gimple_phi (buffer, phi, indent, flags);
+         dump_gimple_phi (buffer, phi, indent, true, flags);
           pp_newline (buffer);
         }
     }