public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] genemit: Print file+line in the "Splitting with" message
@ 2019-09-06 19:25 Segher Boessenkool
  2019-09-08 19:56 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Segher Boessenkool @ 2019-09-06 19:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

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.

Testing on powerpc64-linux {-m32,-m64}.  Is this okay for trunk if that
succeeds?


Segher


2019-09-06  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.

---
 gcc/genemit.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/genemit.c b/gcc/genemit.c
index 3ff8197..4d7011c 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -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");
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] genemit: Print file+line in the "Splitting with" message
  2019-09-06 19:25 [PATCH] genemit: Print file+line in the "Splitting with" message Segher Boessenkool
@ 2019-09-08 19:56 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2019-09-08 19:56 UTC (permalink / raw)
  To: Segher Boessenkool, gcc-patches

On 9/6/19 1:25 PM, Segher Boessenkool wrote:
> 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.
> 
> Testing on powerpc64-linux {-m32,-m64}.  Is this okay for trunk if that
> succeeds?
> 
> 
> Segher
> 
> 
> 2019-09-06  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.
OK
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-08 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 19:25 [PATCH] genemit: Print file+line in the "Splitting with" message Segher Boessenkool
2019-09-08 19:56 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).