This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: don't clobber dump files during preprocessing


On Wed, Nov 24, 2010 at 5:19 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> While investigating PR debug/46338, I was set down a wrong path because
> the dump file I wanted to look at had been clobbered.
>
> I compiled a .C file with -fcompare-debug -save-temps
> -fdump-tree-profile.
>
> That ran cc1plus four times: preprocessing then compiling with the
> wanted options, then preprocessing and compiling with -gtoggle. ?All the
> runs had the -fdump flag pass in the command line.
>
> (I realize we could generally save the second preprocessing in this
> case, but it's probably too much trouble to cover such an unusual case,
> and since we do process twice without -save-temps, such an optimization
> might turn out to be troublesome)
>
> The confusing bit was that the .profile dump wanted to look at had no
> useful info, only the totals printed at the end of compilation. ?So
> there I go trying to figure out why the initial compilation didn't have
> any profile info there, whereas the -gtoggle recompilation did. ?It
> didn't make sense and, indeed, once I took -save-temps out to debug it,
> it no longer happened.
>
> It turned out that it was the second preprocessing that clobbered the
> dump file of the first compilation. ?It doesn't get -auxbase flags like
> the compiler run does, so it doesn't create .gk dump files instead. ?But
> then, it shouldn't be touching compilation dump files at all, since
> we're not compiling anything.
>
> This is what the patch fixes: arrange for preprocessing-only compiles to
> not call the pass finalizers that emit dump file summaries.
>
> Regstrapped on x86_64-linux-gnu and i686-linux-gnu. ?Ok to install?

Ok if you also move statistics_fini () inside the conditional.

Thanks,
Richard.

>
>
> --
> Alexandre Oliva, freedom fighter ? ?http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/ ? FSF Latin America board member
> Free Software Evangelist ? ? ?Red Hat Brazil Compiler Engineer
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]