This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix print_c_tree
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 21 Aug 2003 16:48:53 -0400
- Subject: Re: [tree-ssa] Fix print_c_tree
- Organization: Red Hat Canada
- References: <20030821203531.GA12374@atrey.karlin.mff.cuni.cz>
On Thu, 2003-08-21 at 16:35, Zdenek Dvorak wrote:
> Hello,
>
> print_c_tree shares the buffer of global_dc->printer; I suppose there is
> some reason for this hack, so just fix for the bug it causes --
> the buffer->stream is rewritten to the dump file, then the writes to
> global_dc->printer after this file is closed cause crash.
>
Where are you getting a crash? Are you using print_c_tree after we're
in GIMPLE form? The only place where we call it from is from the
genericizer. I can see it crashing after global_dc->printer was
destroyed, but not before.
However, you're right in that reusing global_dc->printer is not a good
idea. I was trying to avoid the overhead of always creating a
pretty_printer object, but I think it's best if we just do that in
print_c_tree.
> After installing it there is another ice, observable by compiling
> anything with -fdump-tree-all-all:
>
I'm not getting a crash with -fdump-tree-all-all without your patch.
Could you change your patch to just create a pretty_printer object
instead of re-using global_dc->printer?
Thanks. Diego.