genemit: Print file+line in the "Splitting with" message
authorSegher Boessenkool <segher@kernel.crashing.org>
Sun, 8 Sep 2019 20:58:18 +0000 (22:58 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Sun, 8 Sep 2019 20:58:18 +0000 (22:58 +0200)
It's tiresome to have to look in insn-emit.c to see where some split
came from, so let's print that info to the dump file as well.  But
don't print the full path, just the basename, for greater readability.

* genemit.c (gen_split): Print the filename and line number where the
splitter (or peephole2) was defined, to the dump file.

From-SVN: r275497

gcc/ChangeLog
gcc/genemit.c

index 83581ac41bfc3e1abf9ea2c8caeaa657e125de33..c39e0d4d55aae93c9552cd9ef7acc3e9010d8fc5 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-08  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * genemit.c (gen_split): Print the filename and line number where the
+       splitter (or peephole2) was defined, to the dump file.
+
 2019-09-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/91665
index 3ff819720ec6d7d90e5407bf7065544c5c65d84f..4d7011c3aff6f224f6bca6b438740045ff4d41df 100644 (file)
@@ -609,9 +609,14 @@ gen_split (md_rtx_info *info)
   if (GET_CODE (split) == DEFINE_PEEPHOLE2)
     output_peephole2_scratches (split);
 
+  const char *fn = info->loc.filename;
+  for (const char *p = fn; *p; p++)
+    if (*p == '/')
+      fn = p + 1;
+
   printf ("  if (dump_file)\n");
-  printf ("    fprintf (dump_file, \"Splitting with gen_%s_%d\\n\");\n",
-         name, info->index);
+  printf ("    fprintf (dump_file, \"Splitting with gen_%s_%d (%s:%d)\\n\");\n",
+         name, info->index, fn, info->loc.lineno);
 
   printf ("  start_sequence ();\n");