>>>> 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 <tejohn...@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