From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70265 invoked by alias); 6 Sep 2019 19:25:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 70254 invoked by uid 89); 6 Sep 2019 19:25:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Sep 2019 19:25:49 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 8F7C11240EF4; Fri, 6 Sep 2019 19:25:47 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH] genemit: Print file+line in the "Splitting with" message Date: Fri, 06 Sep 2019 19:25:00 -0000 Message-Id: <1abb1af2913b31ece951c44700b51a1fcab8075a.1567797611.git.segher@kernel.crashing.org> X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00424.txt.bz2 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 * 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