This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't dump bb details when removing a block
- From: Teresa Johnson <tejohnson at google dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 11 Apr 2014 13:50:22 -0700
- Subject: Re: [PATCH] Don't dump bb details when removing a block
- Authentication-results: sourceware.org; auth=none
- References: <DUB129-W8171D8DEB627FB0257D271E4540 at phx dot gbl>
On Fri, Apr 11, 2014 at 1:36 AM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
> Hi Teresa,
>
>> @@ -1947,7 +1947,7 @@ remove_bb (basic_block bb)
>> fprintf (dump_file, "Removing basic block %d\n", bb->index);
>> if (dump_flags & TDF_DETAILS)
>> {
>> - dump_bb (dump_file, bb, 0, dump_flags);
>> + dump_bb (dump_file, bb, 0, dump_flags && ~TDF_DETAILS);
>> fprintf (dump_file, "\n");
>> }
>> }
>
>
> did you mean "dump_flags & ~TDF_DETAILS", logical & ???
> Bernd.
>
Yep, that is a mistake. I had fixed the issue I was trying to solve by
inadvertently passing '0'. In any case, the new patch (see below)
addresses this differently.
On Fri, Apr 11, 2014 at 1:14 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> IMHO it's odd to strip just a single flag - I'd go for specifying the desired
> flags explicitely, like dumping with TDF_BLOCKS only (dumping edges
> is certainly useful IMHO). Or dump with 0.
Ok, I have addressed this by passing only TDF_BLOCKS. This exposed a
bug in dump_bb_info in the condition guarding the call to
check_bb_profile, which was not actually checking if flags contained
TDF_DETAILS, also fixed in the new patch below.
>
> Either way ok for stage1.
>
> Thanks,
> Richard.
Thanks, I have retested with the new patch below and will wait for
stage 1 before committing.
Teresa
2014-04-11 Teresa Johnson <tejohnson@google.com>
* cfg.c (dump_bb_info): Fix flags check.
* tree-cfg.c (remove_bb): Only dump TDF_BLOCKS when removing.
2014-04-11 Teresa Johnson <tejohnson@google.com>
* gcc.dg/tree-prof/update-loopch.c: Update expected output.
Index: cfg.c
===================================================================
--- cfg.c (revision 208492)
+++ cfg.c (working copy)
@@ -743,11 +743,10 @@ dump_bb_info (FILE *outf, basic_block bb, int inde
fputs (", probably never executed", outf);
}
fputc ('\n', outf);
- if (TDF_DETAILS)
- check_bb_profile (bb, outf, indent, flags);
if (flags & TDF_DETAILS)
{
+ check_bb_profile (bb, outf, indent, flags);
if (flags & TDF_COMMENT)
fputs (";; ", outf);
fprintf (outf, "%s prev block ", s_indent);
Index: testsuite/gcc.dg/tree-prof/update-loopch.c
===================================================================
--- testsuite/gcc.dg/tree-prof/update-loopch.c (revision 208492)
+++ testsuite/gcc.dg/tree-prof/update-loopch.c (working copy)
@@ -15,8 +15,9 @@ main ()
is once reached directly from entry point of function, rest via loopback
edge. */
/* { dg-final-use { scan-ipa-dump "loop depth 1, count 33334" "profile"} } */
-/* { dg-final-use { scan-tree-dump "loop depth 1, count 33332"
"optimized"} } */
-/* { dg-final-use { scan-tree-dump-times "Removing basic block
\[^\r\n\]*\[\\r\\n\]+\[^\r\n\]*\[\\r\\n\]+Invalid sum
of\[^\r\n\]*\[\\r\\n\]+Invalid sum of" 1 "optimized"} } */
-/* { dg-final-use { scan-tree-dump-times "Invalid sum of" 2 "optimized"} } */
+/* { dg-final-use { scan-tree-dump "loop depth 1, count 33333"
"optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "loop depth 1, count 33332"
"optimized"} } */
+/* { dg-final-use { scan-tree-dump "Removing basic block" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
/* { dg-final-use { cleanup-ipa-dump "profile" } } */
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
Index: tree-cfg.c
===================================================================
--- tree-cfg.c (revision 208492)
+++ tree-cfg.c (working copy)
@@ -1947,7 +1947,7 @@ remove_bb (basic_block bb)
fprintf (dump_file, "Removing basic block %d\n", bb->index);
if (dump_flags & TDF_DETAILS)
{
- dump_bb (dump_file, bb, 0, dump_flags);
+ dump_bb (dump_file, bb, 0, TDF_BLOCKS);
fprintf (dump_file, "\n");
}
}
--
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413