PR c++/68795: fix uninitialized close_paren_loc in cp_parser_postfix_expression
[gcc.git] / gcc / gimple-pretty-print.c
index 42e3f5f7e7e6db2b1ecd38fdcb1d3270f7de8372..b26d7a7671371b6ac3eee495c01a38b0bd830060 100644 (file)
@@ -1,5 +1,5 @@
 /* Pretty formatting of GIMPLE statements and expressions.
-   Copyright (C) 2001-2013 Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldyh@redhat.com> and
    Diego Novillo <dnovillo@google.com>
 
@@ -22,25 +22,17 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
+#include "backend.h"
 #include "tree.h"
-#include "stringpool.h"
-#include "diagnostic.h"
+#include "gimple.h"
+#include "gimple-predict.h"
+#include "ssa.h"
+#include "cgraph.h"
 #include "gimple-pretty-print.h"
-#include "hashtab.h"
-#include "bitmap.h"
-#include "basic-block.h"
-#include "tree-ssa-alias.h"
 #include "internal-fn.h"
 #include "tree-eh.h"
-#include "gimple-expr.h"
-#include "is-a.h"
-#include "gimple.h"
 #include "gimple-iterator.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"
@@ -54,7 +46,7 @@ along with GCC; see the file COPYING3.  If not see
    gimple statement GS.  */
 
 static void
-do_niy (pretty_printer *buffer, gimple gs)
+do_niy (pretty_printer *buffer, gimple *gs)
 {
   pp_printf (buffer, "<<< Unknown GIMPLE statement: %s >>>\n",
             gimple_code_name[(int) gimple_code (gs)]);
@@ -74,7 +66,7 @@ newline_and_indent (pretty_printer *buffer, int spc)
 /* Print the GIMPLE statement GS on stderr.  */
 
 DEBUG_FUNCTION void
-debug_gimple_stmt (gimple gs)
+debug_gimple_stmt (gimple *gs)
 {
   print_gimple_stmt (stderr, gs, 0, TDF_VOPS|TDF_MEMSYMS);
 }
@@ -84,7 +76,7 @@ debug_gimple_stmt (gimple gs)
    FLAGS as in pp_gimple_stmt_1.  */
 
 void
-print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
+print_gimple_stmt (FILE *file, gimple *g, int spc, int flags)
 {
   pretty_printer buffer;
   pp_needs_newline (&buffer) = true;
@@ -94,13 +86,13 @@ print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
 }
 
 DEBUG_FUNCTION void
-debug (gimple_statement_base &ref)
+debug (gimple &ref)
 {
   print_gimple_stmt (stderr, &ref, 0, 0);
 }
 
 DEBUG_FUNCTION void
-debug (gimple_statement_base *ptr)
+debug (gimple *ptr)
 {
   if (ptr)
     debug (*ptr);
@@ -114,7 +106,7 @@ debug (gimple_statement_base *ptr)
    of the statement.  */
 
 void
-print_gimple_expr (FILE *file, gimple g, int spc, int flags)
+print_gimple_expr (FILE *file, gimple *g, int spc, int flags)
 {
   flags |= TDF_RHS_ONLY;
   pretty_printer buffer;
@@ -137,7 +129,7 @@ dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc, int flags)
 
   for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
     {
-      gimple gs = gsi_stmt (i);
+      gimple *gs = gsi_stmt (i);
       INDENT (spc);
       pp_gimple_stmt_1 (buffer, gs, spc, flags);
       if (!gsi_one_before_end_p (i))
@@ -196,11 +188,11 @@ dump_gimple_fmt (pretty_printer *buffer, int spc, int flags,
         {
           gimple_seq seq;
           tree t;
-          gimple g;
+         gimple *g;
           switch (*++c)
             {
               case 'G':
-                g = va_arg (args, gimple);
+               g = va_arg (args, gimple *);
                 tmp = gimple_code_name[gimple_code (g)];
                 pp_string (buffer, tmp);
                 break;
@@ -261,7 +253,7 @@ dump_gimple_fmt (pretty_printer *buffer, int spc, int flags,
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_unary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
 {
   enum tree_code rhs_code = gimple_assign_rhs_code (gs);
   tree lhs = gimple_assign_lhs (gs);
@@ -345,7 +337,7 @@ dump_unary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_binary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
 {
   const char *p;
   enum tree_code code = gimple_assign_rhs_code (gs);
@@ -401,7 +393,7 @@ dump_binary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
    assignment GS.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc, int flags)
 {
   const char *p;
   enum tree_code code = gimple_assign_rhs_code (gs);
@@ -437,6 +429,16 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
       dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
       pp_greater (buffer);
       break;
+
+    case SAD_EXPR:
+      pp_string (buffer, "SAD_EXPR <");
+      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
+      pp_string (buffer, ", ");
+      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
+      pp_string (buffer, ", ");
+      dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
+      pp_greater (buffer);
+      break;
     
     case VEC_PERM_EXPR:
       pp_string (buffer, "VEC_PERM_EXPR <");
@@ -486,7 +488,7 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_assign (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -545,13 +547,14 @@ dump_gimple_assign (pretty_printer *buffer, gimple gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_return (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_return (pretty_printer *buffer, greturn *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");
@@ -560,6 +563,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);
     }
 }
@@ -569,7 +577,7 @@ dump_gimple_return (pretty_printer *buffer, gimple gs, int spc, int flags)
    dump_gimple_call.  */
 
 static void
-dump_gimple_call_args (pretty_printer *buffer, gimple gs, int flags)
+dump_gimple_call_args (pretty_printer *buffer, gcall *gs, int flags)
 {
   size_t i;
 
@@ -642,7 +650,7 @@ pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc, int flags)
 {
   tree lhs = gimple_call_lhs (gs);
   tree fn = gimple_call_fn (gs);
@@ -775,7 +783,8 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_switch (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_switch (pretty_printer *buffer, gswitch *gs, int spc,
+                   int flags)
 {
   unsigned int i;
 
@@ -808,7 +817,7 @@ dump_gimple_switch (pretty_printer *buffer, gimple gs, int spc, int flags)
    pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_cond (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T, %T, %T, %T>", gs,
@@ -852,7 +861,7 @@ dump_gimple_cond (pretty_printer *buffer, gimple gs, int spc, int flags)
    TDF_* in dumpfils.h).  */
 
 static void
-dump_gimple_label (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc, int flags)
 {
   tree label = gimple_label_label (gs);
   if (flags & TDF_RAW)
@@ -873,7 +882,7 @@ dump_gimple_label (pretty_printer *buffer, gimple gs, int spc, int flags)
    TDF_* in dumpfile.h).  */
 
 static void
-dump_gimple_goto (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc, int flags)
 {
   tree label = gimple_goto_dest (gs);
   if (flags & TDF_RAW)
@@ -888,7 +897,7 @@ dump_gimple_goto (pretty_printer *buffer, gimple gs, int spc, int flags)
    TDF_* in dumpfile.h).  */
 
 static void
-dump_gimple_bind (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <", gs);
@@ -921,7 +930,7 @@ dump_gimple_bind (pretty_printer *buffer, gimple gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_try (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -977,7 +986,7 @@ dump_gimple_try (pretty_printer *buffer, gimple gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_catch (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
       dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+CATCH <%S>%->", gs,
@@ -993,7 +1002,8 @@ dump_gimple_catch (pretty_printer *buffer, gimple gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_eh_filter (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_eh_filter (pretty_printer *buffer, geh_filter *gs, int spc,
+                      int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+FAILURE <%S>%->", gs,
@@ -1009,8 +1019,8 @@ dump_gimple_eh_filter (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple.  */
 
 static void
-dump_gimple_eh_must_not_throw (pretty_printer *buffer, gimple gs,
-                              int spc, int flags)
+dump_gimple_eh_must_not_throw (pretty_printer *buffer,
+                              geh_mnt *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs,
@@ -1026,7 +1036,8 @@ dump_gimple_eh_must_not_throw (pretty_printer *buffer, gimple gs,
    dumpfile.h).  */
 
 static void
-dump_gimple_eh_else (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_eh_else (pretty_printer *buffer, geh_else *gs, int spc,
+                    int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags,
@@ -1044,7 +1055,7 @@ dump_gimple_eh_else (pretty_printer *buffer, gimple gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_resx (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs,
@@ -1056,7 +1067,7 @@ dump_gimple_resx (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_eh_dispatch (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs,
@@ -1071,7 +1082,7 @@ dump_gimple_eh_dispatch (pretty_printer *buffer, gimple gs, int spc, int flags)
    in dumpfile.h).  */
 
 static void
-dump_gimple_debug (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc, int flags)
 {
   switch (gs->subcode)
     {
@@ -1104,7 +1115,7 @@ dump_gimple_debug (pretty_printer *buffer, gimple gs, int spc, int flags)
 
 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER.  */
 static void
-dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, int flags)
 {
   size_t i;
 
@@ -1116,13 +1127,23 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
        case GF_OMP_FOR_KIND_FOR:
          kind = "";
          break;
+       case GF_OMP_FOR_KIND_DISTRIBUTE:
+         kind = " distribute";
+         break;
+       case GF_OMP_FOR_KIND_TASKLOOP:
+         kind = " taskloop";
+         break;
+       case GF_OMP_FOR_KIND_CILKFOR:
+         kind = " _Cilk_for";
+         break;
+       case GF_OMP_FOR_KIND_OACC_LOOP:
+         kind = " oacc_loop";
+         break;
        case GF_OMP_FOR_KIND_SIMD:
          kind = " simd";
          break;
        case GF_OMP_FOR_KIND_CILKSIMD:
          kind = " cilksimd";
-       case GF_OMP_FOR_KIND_DISTRIBUTE:
-         kind = " distribute";
          break;
        default:
          gcc_unreachable ();
@@ -1149,25 +1170,39 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
        case GF_OMP_FOR_KIND_FOR:
          pp_string (buffer, "#pragma omp for");
          break;
+       case GF_OMP_FOR_KIND_DISTRIBUTE:
+         pp_string (buffer, "#pragma omp distribute");
+         break;
+       case GF_OMP_FOR_KIND_TASKLOOP:
+         pp_string (buffer, "#pragma omp taskloop");
+         break;
+       case GF_OMP_FOR_KIND_CILKFOR:
+         break;
+       case GF_OMP_FOR_KIND_OACC_LOOP:
+         pp_string (buffer, "#pragma acc loop");
+         break;
        case GF_OMP_FOR_KIND_SIMD:
          pp_string (buffer, "#pragma omp simd");
          break;
        case GF_OMP_FOR_KIND_CILKSIMD:
          pp_string (buffer, "#pragma simd");
          break;
-       case GF_OMP_FOR_KIND_DISTRIBUTE:
-         pp_string (buffer, "#pragma omp distribute");
-         break;
        default:
          gcc_unreachable ();
        }
-      dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
+      if (gimple_omp_for_kind (gs) != GF_OMP_FOR_KIND_CILKFOR)
+       dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
       for (i = 0; i < gimple_omp_for_collapse (gs); i++)
        {
          if (i)
            spc += 2;
-         newline_and_indent (buffer, spc);
-         pp_string (buffer, "for (");
+         if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR)
+           pp_string (buffer, "_Cilk_for (");
+         else
+           {
+             newline_and_indent (buffer, spc);
+             pp_string (buffer, "for (");
+           }
          dump_generic_node (buffer, gimple_omp_for_index (gs, i), spc,
                             flags, false);
          pp_string (buffer, " = ");
@@ -1192,6 +1227,9 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
            case GE_EXPR:
              pp_greater_equal (buffer);
              break;
+           case NE_EXPR:
+             pp_string (buffer, "!=");
+             break;
            default:
              gcc_unreachable ();
            }
@@ -1210,6 +1248,8 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
 
       if (!gimple_seq_empty_p (gimple_omp_body (gs)))
        {
+         if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR)
+           dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
          newline_and_indent (buffer, spc + 2);
          pp_left_brace (buffer);
          pp_newline (buffer);
@@ -1223,7 +1263,8 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_continue (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_continue (pretty_printer *buffer, gomp_continue *gs,
+                         int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1247,7 +1288,8 @@ dump_gimple_omp_continue (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_single (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_single (pretty_printer *buffer, gomp_single *gs,
+                       int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1275,7 +1317,8 @@ dump_gimple_omp_single (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_target (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs,
+                       int spc, int flags)
 {
   const char *kind;
   switch (gimple_omp_target_kind (gs))
@@ -1289,6 +1332,33 @@ dump_gimple_omp_target (pretty_printer *buffer, gimple gs, int spc, int flags)
     case GF_OMP_TARGET_KIND_UPDATE:
       kind = " update";
       break;
+    case GF_OMP_TARGET_KIND_ENTER_DATA:
+      kind = " enter data";
+      break;
+    case GF_OMP_TARGET_KIND_EXIT_DATA:
+      kind = " exit data";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_KERNELS:
+      kind = " oacc_kernels";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_PARALLEL:
+      kind = " oacc_parallel";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_DATA:
+      kind = " oacc_data";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_UPDATE:
+      kind = " oacc_update";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA:
+      kind = " oacc_enter_exit_data";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_DECLARE:
+      kind = " oacc_declare";
+      break;
+    case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
+      kind = " oacc_host_data";
+      break;
     default:
       gcc_unreachable ();
     }
@@ -1297,7 +1367,9 @@ dump_gimple_omp_target (pretty_printer *buffer, gimple gs, int spc, int flags)
       dump_gimple_fmt (buffer, spc, flags, "%G%s <%+BODY <%S>%nCLAUSES <", gs,
                       kind, gimple_omp_body (gs));
       dump_omp_clauses (buffer, gimple_omp_target_clauses (gs), spc, flags);
-      dump_gimple_fmt (buffer, spc, flags, " >");
+      dump_gimple_fmt (buffer, spc, flags, " >, %T, %T%n>",
+                      gimple_omp_target_child_fn (gs),
+                      gimple_omp_target_data_arg (gs));
     }
   else
     {
@@ -1309,16 +1381,28 @@ dump_gimple_omp_target (pretty_printer *buffer, gimple gs, int spc, int flags)
          pp_string (buffer, " [child fn: ");
          dump_generic_node (buffer, gimple_omp_target_child_fn (gs),
                             spc, flags, false);
-         pp_right_bracket (buffer);
+         pp_string (buffer, " (");
+         if (gimple_omp_target_data_arg (gs))
+           dump_generic_node (buffer, gimple_omp_target_data_arg (gs),
+                              spc, flags, false);
+         else
+           pp_string (buffer, "???");
+         pp_string (buffer, ")]");
        }
-      if (!gimple_seq_empty_p (gimple_omp_body (gs)))
+      gimple_seq body = gimple_omp_body (gs);
+      if (body && gimple_code (gimple_seq_first_stmt (body)) != GIMPLE_BIND)
        {
          newline_and_indent (buffer, spc + 2);
-         pp_character (buffer, '{');
+         pp_left_brace (buffer);
          pp_newline (buffer);
-         dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags);
+         dump_gimple_seq (buffer, body, spc + 4, flags);
          newline_and_indent (buffer, spc + 2);
-         pp_character (buffer, '}');
+         pp_right_brace (buffer);
+       }
+      else if (body)
+       {
+         pp_newline (buffer);
+         dump_gimple_seq (buffer, body, spc + 2, flags);
        }
     }
 }
@@ -1326,7 +1410,8 @@ dump_gimple_omp_target (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_teams (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_teams (pretty_printer *buffer, gomp_teams *gs, int spc,
+                      int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1354,8 +1439,8 @@ dump_gimple_omp_teams (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_sections (pretty_printer *buffer, gimple gs, int spc,
-                         int flags)
+dump_gimple_omp_sections (pretty_printer *buffer, gomp_sections *gs,
+                         int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1391,7 +1476,7 @@ dump_gimple_omp_sections (pretty_printer *buffer, gimple gs, int spc,
    pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_block (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
@@ -1406,9 +1491,6 @@ dump_gimple_omp_block (pretty_printer *buffer, gimple gs, int spc, int flags)
        case GIMPLE_OMP_TASKGROUP:
          pp_string (buffer, "#pragma omp taskgroup");
          break;
-       case GIMPLE_OMP_ORDERED:
-         pp_string (buffer, "#pragma omp ordered");
-         break;
        case GIMPLE_OMP_SECTION:
          pp_string (buffer, "#pragma omp section");
          break;
@@ -1430,8 +1512,8 @@ dump_gimple_omp_block (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_critical (pretty_printer *buffer, gimple gs, int spc,
-                         int flags)
+dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs,
+                         int spc, int flags)
 {
   if (flags & TDF_RAW)
     dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
@@ -1446,6 +1528,32 @@ dump_gimple_omp_critical (pretty_printer *buffer, gimple gs, int spc,
                             flags, false);
          pp_right_paren (buffer);
        }
+      dump_omp_clauses (buffer, gimple_omp_critical_clauses (gs), spc, flags);
+      if (!gimple_seq_empty_p (gimple_omp_body (gs)))
+       {
+         newline_and_indent (buffer, spc + 2);
+         pp_left_brace (buffer);
+         pp_newline (buffer);
+         dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags);
+         newline_and_indent (buffer, spc + 2);
+         pp_right_brace (buffer);
+       }
+    }
+}
+
+/* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer BUFFER.  */
+
+static void
+dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs,
+                        int spc, int flags)
+{
+  if (flags & TDF_RAW)
+    dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
+                    gimple_omp_body (gs));
+  else
+    {
+      pp_string (buffer, "#pragma omp ordered");
+      dump_omp_clauses (buffer, gimple_omp_ordered_clauses (gs), spc, flags);
       if (!gimple_seq_empty_p (gimple_omp_body (gs)))
        {
          newline_and_indent (buffer, spc + 2);
@@ -1461,7 +1569,7 @@ dump_gimple_omp_critical (pretty_printer *buffer, gimple gs, int spc,
 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_omp_return (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1491,15 +1599,19 @@ dump_gimple_omp_return (pretty_printer *buffer, gimple gs, int spc, int flags)
 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER.  */
 
 static void
-dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_transaction (pretty_printer *buffer, gtransaction *gs,
+                        int spc, int flags)
 {
   unsigned subcode = gimple_transaction_subcode (gs);
 
   if (flags & TDF_RAW)
     {
       dump_gimple_fmt (buffer, spc, flags,
-                      "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
-                      gs, subcode, gimple_transaction_label (gs),
+                      "%G [SUBCODE=%x,NORM=%T,UNINST=%T,OVER=%T] "
+                      "<%+BODY <%S> >",
+                      gs, subcode, gimple_transaction_label_norm (gs),
+                      gimple_transaction_label_uninst (gs),
+                      gimple_transaction_label_over (gs),
                       gimple_transaction_body (gs));
     }
   else
@@ -1512,13 +1624,35 @@ dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags)
        pp_string (buffer, "__transaction_atomic");
       subcode &= ~GTMA_DECLARATION_MASK;
 
-      if (subcode || gimple_transaction_label (gs))
+      if (gimple_transaction_body (gs))
+       {
+         newline_and_indent (buffer, spc + 2);
+         pp_left_brace (buffer);
+         pp_newline (buffer);
+         dump_gimple_seq (buffer, gimple_transaction_body (gs),
+                          spc + 4, flags);
+         newline_and_indent (buffer, spc + 2);
+         pp_right_brace (buffer);
+       }
+      else
        {
          pp_string (buffer, "  //");
-         if (gimple_transaction_label (gs))
+         if (gimple_transaction_label_norm (gs))
+           {
+             pp_string (buffer, " NORM=");
+             dump_generic_node (buffer, gimple_transaction_label_norm (gs),
+                                spc, flags, false);
+           }
+         if (gimple_transaction_label_uninst (gs))
            {
-             pp_string (buffer, " LABEL=");
-             dump_generic_node (buffer, gimple_transaction_label (gs),
+             pp_string (buffer, " UNINST=");
+             dump_generic_node (buffer, gimple_transaction_label_uninst (gs),
+                                spc, flags, false);
+           }
+         if (gimple_transaction_label_over (gs))
+           {
+             pp_string (buffer, " OVER=");
+             dump_generic_node (buffer, gimple_transaction_label_over (gs),
                                 spc, flags, false);
            }
          if (subcode)
@@ -1559,17 +1693,6 @@ dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags)
              pp_right_bracket (buffer);
            }
        }
-
-      if (!gimple_seq_empty_p (gimple_transaction_body (gs)))
-       {
-         newline_and_indent (buffer, spc + 2);
-         pp_left_brace (buffer);
-         pp_newline (buffer);
-         dump_gimple_seq (buffer, gimple_transaction_body (gs),
-                          spc + 4, flags);
-         newline_and_indent (buffer, spc + 2);
-         pp_right_brace (buffer);
-       }
     }
 }
 
@@ -1578,7 +1701,7 @@ dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags)
    dumpfile.h).  */
 
 static void
-dump_gimple_asm (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_asm (pretty_printer *buffer, gasm *gs, int spc, int flags)
 {
   unsigned int i, n, f, fields;
 
@@ -1754,7 +1877,7 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
   if (!POINTER_TYPE_P (TREE_TYPE (node))
       && SSA_NAME_RANGE_INFO (node))
     {
-      double_int min, max, nonzero_bits;
+      wide_int min, max, nonzero_bits;
       value_range_type range_type = get_range_info (node, &min, &max);
 
       if (range_type == VR_VARYING)
@@ -1763,34 +1886,39 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc)
        {
          pp_printf (buffer, "# RANGE ");
          pp_printf (buffer, "%s[", range_type == VR_RANGE ? "" : "~");
-         pp_double_int (buffer, min, TYPE_UNSIGNED (TREE_TYPE (node)));
+         pp_wide_int (buffer, min, TYPE_SIGN (TREE_TYPE (node)));
          pp_printf (buffer, ", ");
-         pp_double_int (buffer, max, TYPE_UNSIGNED (TREE_TYPE (node)));
+         pp_wide_int (buffer, max, TYPE_SIGN (TREE_TYPE (node)));
          pp_printf (buffer, "]");
        }
       nonzero_bits = get_nonzero_bits (node);
-      if (nonzero_bits != double_int_minus_one
-         && (nonzero_bits
-             != double_int::mask (TYPE_PRECISION (TREE_TYPE (node)))))
+      if (nonzero_bits != -1)
        {
          pp_string (buffer, " NONZERO ");
-         sprintf (pp_buffer (buffer)->digit_buffer,
-                  HOST_WIDE_INT_PRINT_DOUBLE_HEX,
-                  (unsigned HOST_WIDE_INT) nonzero_bits.high,
-                  nonzero_bits.low);
-         pp_string (buffer, pp_buffer (buffer)->digit_buffer);
+         pp_wide_int (buffer, nonzero_bits, UNSIGNED);
        }
       newline_and_indent (buffer, spc);
     }
 }
 
+/* As dump_ssaname_info, but dump to FILE.  */
+
+void
+dump_ssaname_info_to_file (FILE *file, tree node, int spc)
+{
+  pretty_printer buffer;
+  pp_needs_newline (&buffer) = true;
+  buffer.buffer->stream = file;
+  dump_ssaname_info (&buffer, node, spc);
+  pp_flush (&buffer);
+}
 
 /* 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.  If COMMENT is true, print this after #.  */
 
 static void
-dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, bool comment,
+dump_gimple_phi (pretty_printer *buffer, gphi *phi, int spc, bool comment,
                 int flags)
 {
   size_t i;
@@ -1813,21 +1941,7 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, bool comment,
   for (i = 0; i < gimple_phi_num_args (phi); i++)
     {
       if ((flags & TDF_LINENO) && gimple_phi_arg_has_location (phi, i))
-        {
-         expanded_location xloc;
-
-         xloc = expand_location (gimple_phi_arg_location (phi, i));
-         pp_left_bracket (buffer);
-         if (xloc.file)
-           {
-             pp_string (buffer, xloc.file);
-             pp_string (buffer, " : ");
-           }
-         pp_decimal_int (buffer, xloc.line);
-         pp_colon (buffer);
-         pp_decimal_int (buffer, xloc.column);
-         pp_string (buffer, "] ");
-       }
+       dump_location (buffer, gimple_phi_arg_location (phi, i));
       dump_generic_node (buffer, gimple_phi_arg_def (phi, i), spc, flags,
                         false);
       pp_left_paren (buffer);
@@ -1845,8 +1959,8 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, bool comment,
    dumpfile.h).  */
 
 static void
-dump_gimple_omp_parallel (pretty_printer *buffer, gimple gs, int spc,
-                          int flags)
+dump_gimple_omp_parallel (pretty_printer *buffer, gomp_parallel *gs,
+                         int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1899,7 +2013,7 @@ dump_gimple_omp_parallel (pretty_printer *buffer, gimple gs, int spc,
    dumpfile.h).  */
 
 static void
-dump_gimple_omp_task (pretty_printer *buffer, gimple gs, int spc,
+dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc,
                      int flags)
 {
   if (flags & TDF_RAW)
@@ -1917,7 +2031,10 @@ dump_gimple_omp_task (pretty_printer *buffer, gimple gs, int spc,
   else
     {
       gimple_seq body;
-      pp_string (buffer, "#pragma omp task");
+      if (gimple_omp_task_taskloop_p (gs))
+       pp_string (buffer, "#pragma omp taskloop");
+      else
+       pp_string (buffer, "#pragma omp task");
       dump_omp_clauses (buffer, gimple_omp_task_clauses (gs), spc, flags);
       if (gimple_omp_task_child_fn (gs))
        {
@@ -1956,8 +2073,8 @@ dump_gimple_omp_task (pretty_printer *buffer, gimple gs, int spc,
    in dumpfile.h).  */
 
 static void
-dump_gimple_omp_atomic_load (pretty_printer *buffer, gimple gs, int spc,
-                             int flags)
+dump_gimple_omp_atomic_load (pretty_printer *buffer, gomp_atomic_load *gs,
+                            int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -1989,8 +2106,8 @@ dump_gimple_omp_atomic_load (pretty_printer *buffer, gimple gs, int spc,
    in dumpfile.h).  */
 
 static void
-dump_gimple_omp_atomic_store (pretty_printer *buffer, gimple gs, int spc,
-                             int flags)
+dump_gimple_omp_atomic_store (pretty_printer *buffer,
+                             gomp_atomic_store *gs, int spc, int flags)
 {
   if (flags & TDF_RAW)
     {
@@ -2016,7 +2133,7 @@ dump_gimple_omp_atomic_store (pretty_printer *buffer, gimple gs, int spc,
    FLAGS are as in pp_gimple_stmt_1.  */
 
 static void
-dump_gimple_mem_ops (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc, int flags)
 {
   tree vdef = gimple_vdef (gs);
   tree vuse = gimple_vuse (gs);
@@ -2046,7 +2163,7 @@ dump_gimple_mem_ops (pretty_printer *buffer, gimple gs, int spc, int flags)
    pp_flush on BUFFER to finalize the pretty printer.  */
 
 void
-pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
+pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, int flags)
 {
   if (!gs)
     return;
@@ -2055,19 +2172,7 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
     pp_printf (buffer, "<&%p> ", (void *) gs);
 
   if ((flags & TDF_LINENO) && gimple_has_location (gs))
-    {
-      expanded_location xloc = expand_location (gimple_location (gs));
-      pp_left_bracket (buffer);
-      if (xloc.file)
-       {
-         pp_string (buffer, xloc.file);
-         pp_string (buffer, " : ");
-       }
-      pp_decimal_int (buffer, xloc.line);
-      pp_colon (buffer);
-      pp_decimal_int (buffer, xloc.column);
-      pp_string (buffer, "] ");
-    }
+    dump_location (buffer, gimple_location (gs));
 
   if (flags & TDF_EH)
     {
@@ -2089,31 +2194,31 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
   switch (gimple_code (gs))
     {
     case GIMPLE_ASM:
-      dump_gimple_asm (buffer, gs, spc, flags);
+      dump_gimple_asm (buffer, as_a <gasm *> (gs), spc, flags);
       break;
 
     case GIMPLE_ASSIGN:
-      dump_gimple_assign (buffer, gs, spc, flags);
+      dump_gimple_assign (buffer, as_a <gassign *> (gs), spc, flags);
       break;
 
     case GIMPLE_BIND:
-      dump_gimple_bind (buffer, gs, spc, flags);
+      dump_gimple_bind (buffer, as_a <gbind *> (gs), spc, flags);
       break;
 
     case GIMPLE_CALL:
-      dump_gimple_call (buffer, gs, spc, flags);
+      dump_gimple_call (buffer, as_a <gcall *> (gs), spc, flags);
       break;
 
     case GIMPLE_COND:
-      dump_gimple_cond (buffer, gs, spc, flags);
+      dump_gimple_cond (buffer, as_a <gcond *> (gs), spc, flags);
       break;
 
     case GIMPLE_LABEL:
-      dump_gimple_label (buffer, gs, spc, flags);
+      dump_gimple_label (buffer, as_a <glabel *> (gs), spc, flags);
       break;
 
     case GIMPLE_GOTO:
-      dump_gimple_goto (buffer, gs, spc, flags);
+      dump_gimple_goto (buffer, as_a <ggoto *> (gs), spc, flags);
       break;
 
     case GIMPLE_NOP:
@@ -2121,56 +2226,63 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
       break;
 
     case GIMPLE_RETURN:
-      dump_gimple_return (buffer, gs, spc, flags);
+      dump_gimple_return (buffer, as_a <greturn *> (gs), spc, flags);
       break;
 
     case GIMPLE_SWITCH:
-      dump_gimple_switch (buffer, gs, spc, flags);
+      dump_gimple_switch (buffer, as_a <gswitch *> (gs), spc, flags);
       break;
 
     case GIMPLE_TRY:
-      dump_gimple_try (buffer, gs, spc, flags);
+      dump_gimple_try (buffer, as_a <gtry *> (gs), spc, flags);
       break;
 
     case GIMPLE_PHI:
-      dump_gimple_phi (buffer, gs, spc, false, flags);
+      dump_gimple_phi (buffer, as_a <gphi *> (gs), spc, false, flags);
       break;
 
     case GIMPLE_OMP_PARALLEL:
-      dump_gimple_omp_parallel (buffer, gs, spc, flags);
+      dump_gimple_omp_parallel (buffer, as_a <gomp_parallel *> (gs), spc,
+                               flags);
       break;
 
     case GIMPLE_OMP_TASK:
-      dump_gimple_omp_task (buffer, gs, spc, flags);
+      dump_gimple_omp_task (buffer, as_a <gomp_task *> (gs), spc, flags);
       break;
 
     case GIMPLE_OMP_ATOMIC_LOAD:
-      dump_gimple_omp_atomic_load (buffer, gs, spc, flags);
-
+      dump_gimple_omp_atomic_load (buffer, as_a <gomp_atomic_load *> (gs),
+                                  spc, flags);
       break;
 
     case GIMPLE_OMP_ATOMIC_STORE:
-      dump_gimple_omp_atomic_store (buffer, gs, spc, flags);
+      dump_gimple_omp_atomic_store (buffer,
+                                   as_a <gomp_atomic_store *> (gs),
+                                   spc, flags);
       break;
 
     case GIMPLE_OMP_FOR:
-      dump_gimple_omp_for (buffer, gs, spc, flags);
+      dump_gimple_omp_for (buffer, as_a <gomp_for *> (gs), spc, flags);
       break;
 
     case GIMPLE_OMP_CONTINUE:
-      dump_gimple_omp_continue (buffer, gs, spc, flags);
+      dump_gimple_omp_continue (buffer, as_a <gomp_continue *> (gs), spc,
+                               flags);
       break;
 
     case GIMPLE_OMP_SINGLE:
-      dump_gimple_omp_single (buffer, gs, spc, flags);
+      dump_gimple_omp_single (buffer, as_a <gomp_single *> (gs), spc,
+                             flags);
       break;
 
     case GIMPLE_OMP_TARGET:
-      dump_gimple_omp_target (buffer, gs, spc, flags);
+      dump_gimple_omp_target (buffer, as_a <gomp_target *> (gs), spc,
+                             flags);
       break;
 
     case GIMPLE_OMP_TEAMS:
-      dump_gimple_omp_teams (buffer, gs, spc, flags);
+      dump_gimple_omp_teams (buffer, as_a <gomp_teams *> (gs), spc,
+                            flags);
       break;
 
     case GIMPLE_OMP_RETURN:
@@ -2178,7 +2290,8 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
       break;
 
     case GIMPLE_OMP_SECTIONS:
-      dump_gimple_omp_sections (buffer, gs, spc, flags);
+      dump_gimple_omp_sections (buffer, as_a <gomp_sections *> (gs),
+                               spc, flags);
       break;
 
     case GIMPLE_OMP_SECTIONS_SWITCH:
@@ -2187,41 +2300,49 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
 
     case GIMPLE_OMP_MASTER:
     case GIMPLE_OMP_TASKGROUP:
-    case GIMPLE_OMP_ORDERED:
     case GIMPLE_OMP_SECTION:
       dump_gimple_omp_block (buffer, gs, spc, flags);
       break;
 
+    case GIMPLE_OMP_ORDERED:
+      dump_gimple_omp_ordered (buffer, as_a <gomp_ordered *> (gs), spc,
+                              flags);
+      break;
+
     case GIMPLE_OMP_CRITICAL:
-      dump_gimple_omp_critical (buffer, gs, spc, flags);
+      dump_gimple_omp_critical (buffer, as_a <gomp_critical *> (gs), spc,
+                               flags);
       break;
 
     case GIMPLE_CATCH:
-      dump_gimple_catch (buffer, gs, spc, flags);
+      dump_gimple_catch (buffer, as_a <gcatch *> (gs), spc, flags);
       break;
 
     case GIMPLE_EH_FILTER:
-      dump_gimple_eh_filter (buffer, gs, spc, flags);
+      dump_gimple_eh_filter (buffer, as_a <geh_filter *> (gs), spc, flags);
       break;
 
     case GIMPLE_EH_MUST_NOT_THROW:
-      dump_gimple_eh_must_not_throw (buffer, gs, spc, flags);
+      dump_gimple_eh_must_not_throw (buffer,
+                                    as_a <geh_mnt *> (gs),
+                                    spc, flags);
       break;
 
     case GIMPLE_EH_ELSE:
-      dump_gimple_eh_else (buffer, gs, spc, flags);
+      dump_gimple_eh_else (buffer, as_a <geh_else *> (gs), spc, flags);
       break;
 
     case GIMPLE_RESX:
-      dump_gimple_resx (buffer, gs, spc, flags);
+      dump_gimple_resx (buffer, as_a <gresx *> (gs), spc, flags);
       break;
 
     case GIMPLE_EH_DISPATCH:
-      dump_gimple_eh_dispatch (buffer, gs, spc, flags);
+      dump_gimple_eh_dispatch (buffer, as_a <geh_dispatch *> (gs), spc,
+                              flags);
       break;
 
     case GIMPLE_DEBUG:
-      dump_gimple_debug (buffer, gs, spc, flags);
+      dump_gimple_debug (buffer, as_a <gdebug *> (gs), spc, flags);
       break;
 
     case GIMPLE_PREDICT:
@@ -2235,7 +2356,8 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
       break;
 
     case GIMPLE_TRANSACTION:
-      dump_gimple_transaction (buffer, gs, spc, flags);
+      dump_gimple_transaction (buffer, as_a <gtransaction *> (gs), spc,
+                              flags);
       break;
 
     default:
@@ -2274,7 +2396,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags)
     }
   else
     {
-      gimple stmt = first_stmt (bb);
+      gimple *stmt = first_stmt (bb);
       if (!stmt || gimple_code (stmt) != GIMPLE_LABEL)
        fprintf (outf, "%*s<bb %d>:\n", indent, "", bb->index);
     }
@@ -2301,11 +2423,11 @@ dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED,
 static void
 dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
 {
-  gimple_stmt_iterator i;
+  gphi_iterator i;
 
   for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
     {
-      gimple phi = gsi_stmt (i);
+      gphi *phi = i.phi ();
       if (!virtual_operand_p (gimple_phi_result (phi)) || (flags & TDF_VOPS))
         {
           INDENT (indent);
@@ -2322,7 +2444,7 @@ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
 static void
 pp_cfg_jump (pretty_printer *buffer, basic_block bb)
 {
-  gimple stmt;
+  gimple *stmt;
 
   stmt = first_stmt (bb);
 
@@ -2332,7 +2454,9 @@ pp_cfg_jump (pretty_printer *buffer, basic_block bb)
   if (stmt && gimple_code (stmt) == GIMPLE_LABEL)
     {
       pp_string (buffer, " (");
-      dump_generic_node (buffer, gimple_label_label (stmt), 0, 0, false);
+      dump_generic_node (buffer,
+                        gimple_label_label (as_a <glabel *> (stmt)),
+                        0, 0, false);
       pp_right_paren (buffer);
       pp_semicolon (buffer);
     }
@@ -2349,7 +2473,7 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
                     int flags)
 {
   edge e;
-  gimple stmt;
+  gimple *stmt;
 
   stmt = last_stmt (bb);
 
@@ -2383,22 +2507,8 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
       INDENT (indent);
 
       if ((flags & TDF_LINENO)
-         && e->goto_locus != UNKNOWN_LOCATION
-         )
-       {
-         expanded_location goto_xloc;
-         goto_xloc = expand_location (e->goto_locus);
-         pp_left_bracket (buffer);
-         if (goto_xloc.file)
-           {
-             pp_string (buffer, goto_xloc.file);
-             pp_string (buffer, " : ");
-           }
-         pp_decimal_int (buffer, goto_xloc.line);
-         pp_string (buffer, " : ");
-         pp_decimal_int (buffer, goto_xloc.column);
-         pp_string (buffer, "] ");
-       }
+         && e->goto_locus != UNKNOWN_LOCATION)
+       dump_location (buffer, e->goto_locus);
 
       pp_cfg_jump (buffer, e->dest);
       pp_newline (buffer);
@@ -2414,7 +2524,7 @@ gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
                     int flags)
 {
   gimple_stmt_iterator gsi;
-  gimple stmt;
+  gimple *stmt;
   int label_indent = indent - 2;
 
   if (label_indent < 0)
@@ -2468,14 +2578,13 @@ gimple_dump_bb (FILE *file, basic_block bb, int indent, int flags)
 void
 gimple_dump_bb_for_graph (pretty_printer *pp, basic_block bb)
 {
-  gimple_stmt_iterator gsi;
-
   pp_printf (pp, "<bb %d>:\n", bb->index);
   pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true);
 
-  for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+  for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+       gsi_next (&gsi))
     {
-      gimple phi = gsi_stmt (gsi);
+      gphi *phi = gsi.phi ();
       if (!virtual_operand_p (gimple_phi_result (phi))
          || (dump_flags & TDF_VOPS))
        {
@@ -2488,9 +2597,10 @@ gimple_dump_bb_for_graph (pretty_printer *pp, basic_block bb)
        }
     }
 
-  for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+  for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+       gsi_next (&gsi))
     {
-      gimple stmt = gsi_stmt (gsi);
+      gimple *stmt = gsi_stmt (gsi);
       pp_bar (pp);
       pp_write_text_to_stream (pp);
       pp_gimple_stmt_1 (pp, stmt, 0, dump_flags);