re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins)
[gcc.git] / gcc / sched-vis.c
index b35c137f7c4f31004f7745e1bb10e0313fb6bd29..8b77238e9d8ef3630102e5c75c0b50bad0a2b215 100644 (file)
@@ -1,5 +1,5 @@
 /* Printing of RTL in "slim", mnemonic like form.
-   Copyright (C) 1992-2014 Free Software Foundation, Inc.
+   Copyright (C) 1992-2015 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
    and currently maintained by, Jim Wilson (wilson@cygnus.com)
 
@@ -28,7 +28,14 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "rtl.h"
+#include "alias.h"
+#include "symtab.h"
 #include "tree.h"      /* FIXME: To dump INSN_VAR_LOCATION_DECL.  */
+#include "predict.h"
+#include "hard-reg-set.h"
+#include "function.h"
+#include "dominance.h"
+#include "cfg.h"
 #include "basic-block.h"
 #include "dumpfile.h"  /* for the TDF_* flags */
 #include "pretty-print.h"
@@ -48,7 +55,7 @@ along with GCC; see the file COPYING3.  If not see
    pointer, via str_pattern_slim, but this usage is discouraged.  */
 
 /* For insns we print patterns, and for some patterns we print insns...  */
-static void print_insn_with_notes (pretty_printer *, const_rtx);
+static void print_insn_with_notes (pretty_printer *, const rtx_insn *);
 
 /* This recognizes rtx'en classified as expressions.  These are always
    represent some action on values or results of other expression, that
@@ -468,7 +475,7 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_printf (pp, "`%s'", XSTR (x, 0));
       break;
     case LABEL_REF:
-      pp_printf (pp, "L%d", INSN_UID (XEXP (x, 0)));
+      pp_printf (pp, "L%d", INSN_UID (LABEL_REF_LABEL (x)));
       break;
     case CONST:
     case HIGH:
@@ -578,8 +585,9 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
       break;
     case SEQUENCE:
       {
+       const rtx_sequence *seq = as_a <const rtx_sequence *> (x);
        pp_string (pp, "sequence{");
-       if (INSN_P (XVECEXP (x, 0, 0)))
+       if (INSN_P (seq->element (0)))
          {
            /* Print the sequence insns indented.  */
            const char * save_print_rtx_head = print_rtx_head;
@@ -591,16 +599,16 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
                      sizeof (indented_print_rtx_head),
                      "%s     ", print_rtx_head);
            print_rtx_head = indented_print_rtx_head;
-           for (int i = 0; i < XVECLEN (x, 0); i++)
-             print_insn_with_notes (pp, XVECEXP (x, 0, i));
+           for (int i = 0; i < seq->len (); i++)
+             print_insn_with_notes (pp, seq->insn (i));
            pp_printf (pp, "%s      ", save_print_rtx_head);
            print_rtx_head = save_print_rtx_head;
          }
        else
          {
-           for (int i = 0; i < XVECLEN (x, 0); i++)
+           for (int i = 0; i < seq->len (); i++)
              {
-               print_pattern (pp, XVECEXP (x, 0, i), verbose);
+               print_pattern (pp, seq->element (i), verbose);
                pp_semicolon (pp);
              }
          }
@@ -649,7 +657,7 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
    with their INSN_UIDs.  */
 
 void
-print_insn (pretty_printer *pp, const_rtx x, int verbose)
+print_insn (pretty_printer *pp, const rtx_insn *x, int verbose)
 {
   if (verbose)
     {
@@ -767,7 +775,7 @@ print_insn (pretty_printer *pp, const_rtx x, int verbose)
    note attached to the instruction.  */
 
 static void
-print_insn_with_notes (pretty_printer *pp, const_rtx x)
+print_insn_with_notes (pretty_printer *pp, const rtx_insn *x)
 {
   pp_string (pp, print_rtx_head);
   print_insn (pp, x, 1);
@@ -803,7 +811,7 @@ dump_value_slim (FILE *f, const_rtx x, int verbose)
 /* Emit a slim dump of X (an insn) to the file F, including any register
    note attached to the instruction.  */
 void
-dump_insn_slim (FILE *f, const_rtx x)
+dump_insn_slim (FILE *f, const rtx_insn *x)
 {
   pretty_printer rtl_slim_pp;
   rtl_slim_pp.buffer->stream = f;
@@ -815,14 +823,14 @@ dump_insn_slim (FILE *f, const_rtx x)
    If COUNT < 0 it will stop only at LAST or NULL rtx.  */
 
 void
-dump_rtl_slim (FILE *f, const_rtx first, const_rtx last,
+dump_rtl_slim (FILE *f, const rtx_insn *first, const rtx_insn *last,
               int count, int flags ATTRIBUTE_UNUSED)
 {
-  const_rtx insn, tail;
+  const rtx_insn *insn, *tail;
   pretty_printer rtl_slim_pp;
   rtl_slim_pp.buffer->stream = f;
 
-  tail = last ? NEXT_INSN (last) : NULL_RTX;
+  tail = last ? NEXT_INSN (last) : NULL;
   for (insn = first;
        (insn != NULL) && (insn != tail) && (count != 0);
        insn = NEXT_INSN (insn))
@@ -841,7 +849,7 @@ dump_rtl_slim (FILE *f, const_rtx first, const_rtx last,
 void
 rtl_dump_bb_for_graph (pretty_printer *pp, basic_block bb)
 {
-  rtx insn;
+  rtx_insn *insn;
   bool first = true;
 
   /* TODO: inter-bb stuff.  */
@@ -873,17 +881,19 @@ str_pattern_slim (const_rtx x)
 }
 
 /* Emit a slim dump of X (an insn) to stderr.  */
-extern void debug_insn_slim (const_rtx);
+extern void debug_insn_slim (const rtx_insn *);
 DEBUG_FUNCTION void
-debug_insn_slim (const_rtx x)
+debug_insn_slim (const rtx_insn *x)
 {
   dump_insn_slim (stderr, x);
 }
 
 /* Same as above, but using dump_rtl_slim.  */
-extern void debug_rtl_slim (FILE *, const_rtx, const_rtx, int, int);
+extern void debug_rtl_slim (FILE *, const rtx_insn *, const rtx_insn *,
+                           int, int);
 DEBUG_FUNCTION void
-debug_rtl_slim (const_rtx first, const_rtx last, int count, int flags)
+debug_rtl_slim (const rtx_insn *first, const rtx_insn *last, int count,
+               int flags)
 {
   dump_rtl_slim (stderr, first, last, count, flags);
 }