]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/print-rtl.c
c++: Handle multiple aggregate overloads [PR95319].
[thirdparty/gcc.git] / gcc / print-rtl.c
index 5dd2e31340a34562741a3ef0a9f32862f5e9dd5a..611ea079c371d56540ed1d2d1616c126641a7e54 100644 (file)
@@ -1,5 +1,5 @@
 /* Print RTL for GCC.
-   Copyright (C) 1987-2018 Free Software Foundation, Inc.
+   Copyright (C) 1987-2020 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -54,6 +54,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "print-rtl.h"
 #include "rtl-iter.h"
 
+/* Disable warnings about quoting issues in the pp_xxx calls below
+   that (intentionally) don't follow GCC diagnostic conventions.  */
+#if __GNUC__ >= 10
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
 /* String printed at beginning of each RTL when it is dumped.
    This string is set to ASM_COMMENT_START when the RTL is dumped in
    the assembly output file.  */
@@ -370,7 +377,20 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx)
        m_sawclose = 1;
 
       for (int j = 0; j < XVECLEN (in_rtx, idx); j++)
-       print_rtx (XVECEXP (in_rtx, idx, j));
+       {
+         int j1;
+
+         print_rtx (XVECEXP (in_rtx, idx, j));
+         for (j1 = j + 1; j1 < XVECLEN (in_rtx, idx); j1++)
+           if (XVECEXP (in_rtx, idx, j) != XVECEXP (in_rtx, idx, j1))
+             break;
+
+         if (j1 != j + 1)
+           {
+             fprintf (m_outfile, " repeated x%i", j1 - j);
+             j = j1 - 1;
+           }
+       }
 
       m_indent -= 2;
     }
@@ -398,7 +418,8 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx)
       if (INSN_HAS_LOCATION (in_insn))
        {
          expanded_location xloc = insn_location (in_insn);
-         fprintf (m_outfile, " \"%s\":%i", xloc.file, xloc.line);
+         fprintf (m_outfile, " \"%s\":%i:%i", xloc.file, xloc.line,
+                  xloc.column);
        }
 #endif
     }
@@ -1664,7 +1685,9 @@ print_value (pretty_printer *pp, const_rtx x, int verbose)
       pp_string (pp, tmp);
       break;
     case CONST_STRING:
-      pp_printf (pp, "\"%s\"", XSTR (x, 0));
+      pp_string (pp, "\"");
+      pretty_print_string (pp, XSTR (x, 0), strlen (XSTR (x, 0)));
+      pp_string (pp, "\"");
       break;
     case SYMBOL_REF:
       pp_printf (pp, "`%s'", XSTR (x, 0));
@@ -1742,7 +1765,6 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
       print_exp (pp, x, verbose);
       break;
     case CLOBBER:
-    case CLOBBER_HIGH:
     case USE:
       pp_printf (pp, "%s ", GET_RTX_NAME (GET_CODE (x)));
       print_value (pp, XEXP (x, 0), verbose);
@@ -1794,7 +1816,7 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose)
            gcc_assert (strlen (print_rtx_head) < sizeof (indented_print_rtx_head) - 4);
            snprintf (indented_print_rtx_head,
                      sizeof (indented_print_rtx_head),
-                     "%s     ", print_rtx_head);
+                     "%s    ", print_rtx_head);
            print_rtx_head = indented_print_rtx_head;
            for (int i = 0; i < seq->len (); i++)
              print_insn_with_notes (pp, seq->insn (i));
@@ -2128,3 +2150,7 @@ debug_bb_n_slim (int n)
 }
 
 #endif
+
+#if __GNUC__ >= 10
+#  pragma GCC diagnostic pop
+#endif