This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Convert more passes to new dump framework
- From: Teresa Johnson <tejohnson at google dot com>
- To: Xinliang David Li <davidxl at google dot com>
- 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>, Dehao Chen <dehao at google dot com>, Sharad Singhai <singhai at google dot com>
- Date: Fri, 30 Aug 2013 21:58:26 -0700
- Subject: Re: [PATCH] Convert more passes to new dump framework
- Authentication-results: sourceware.org; auth=none
- References: <CAAe5K+W=brFLz3kZYFXTYAE+T2yJVPF=z+vp+uKh4d+9vQXJKQ at mail dot gmail dot com> <20130806123714 dot GD3166 at virgil dot suse> <CAAe5K+VSDkg5sKB2nvraHFv66ZKGO84W6obYj+sBfGZ7F3-hpw at mail dot gmail dot com> <20130806160102 dot GE3166 at virgil dot suse> <CAAe5K+VCwEUz1BWAnAvPrSBT3DHsu1P-eF4-nQb9+aFyDyRORw at mail dot gmail dot com> <CAAe5K+Vu0en=WFJp5bw-Vu=n05LYGxvmmfctnZSWeS-5PKT=Rg at mail dot gmail dot com> <CAFiYyc17odz-dL10BcNcKc8B_QNE2KB538dunz45=1Kn67d-gw at mail dot gmail dot com> <CAAe5K+W2rXph_7YkB1DgyXK55s4XQVtV+yvGY3q30-1DEkSK7A at mail dot gmail dot com> <CAFiYyc1DUmGZ1qeBL8mKRGy_1bd1whTW_XmmkOc-PU4WmGMoEg at mail dot gmail dot com> <CAAe5K+WBuaShbbA_hre_LK90NoShJ8yCRF0NLLnGcoQuZ6P-Nw at mail dot gmail dot com> <CAFiYyc2GNvLbsuWeBAsXHTt1kBY_ksDeXN0Spb9XwhuYd4MP0w at mail dot gmail dot com> <CAAkRFZLGvTPzFFLMif1Qw+1w8uUDa7mA00Ur7YOvLSFYTDp84w at mail dot gmail dot com> <CAAe5K+XjXYMMSJBy_W8B-ccZ8GddAnJXnUonzQzegCJzE3XGgA at mail dot gmail dot com> <CAAkRFZKumZHfyS8KFhDvB9PCfrY6ZLoOwP14SJbz5UcCSm-TXQ at mail dot gmail dot com> <CAAe5K+XsbF4hkyWHrNRoAZyMsXzEwgA_SpnckmAaLgMhLg8Rdg at mail dot gmail dot com>
>>>> Besides, we might also want to
>>>> use the same machinery (dump_printf_loc etc) for dump file dumping.
>>>> The current behavior of using '-details' to turn on opt-info-all
>>>> messages for dump files are not desirable.
>>>
>>> Interestingly, this doesn't even work. When I do
>>> -fdump-ipa-inline-details=stderr (with my patch containing the inliner
>>> messages) I am not getting those inliner messages emitted to stderr.
>>> Even though in dumpfile.c "details" is set to (TDF_DETAILS |
>>> MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION | MSG_NOTE). I'm not
>>> sure why, but will need to debug this.
>>
>> It works for vectorizer pass.
>
> Ok, let me see what is going on - I just confirmed that it is not
> working for the loop unroller messages either.
>
Found the issue. The stream was incorrectly being closed when it was
stderr/stdout. So only the dump output before the first dump_finish
call was being emitted to stderr. I fixed this the same way the
alt_dump_file was being handled just below - don't close if it is
stderr/stdout. Confirmed that this fixes the problem.
(So the real ratio between the volume of -fdump-...=stderr and
-fopt-info is much higher than what I reported in an earlier email)
Is the following patch ok, pending regression tests?
2013-08-30 Teresa Johnson <tejohnson@google.com>
* dumpfile.c (dump_finish): Don't close stderr/stdout.
Index: dumpfile.c
===================================================================
--- dumpfile.c (revision 202059)
+++ dumpfile.c (working copy)
@@ -450,7 +450,8 @@ dump_finish (int phase)
if (phase < 0)
return;
dfi = get_dump_file_info (phase);
- if (dfi->pstream)
+ if (dfi->pstream && strcmp("stderr", dfi->pfilename) != 0
+ && strcmp("stdout", dfi->pfilename) != 0)
fclose (dfi->pstream);
if (dfi->alt_stream && strcmp("stderr", dfi->alt_filename) != 0
Thanks,
Teresa