This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Removal of gotos from cfg based ir
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: Diego Novillo <dnovillo at redhat dot com>, Richard Henderson <rth at redhat dot com>, Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>
- Date: 03 Dec 2003 23:04:40 -0500
- Subject: Re: [tree-ssa] Removal of gotos from cfg based ir
- References: <20031114204445.GC28319@redhat.com><200311150009.hAF09vpk000830@speedy.slc.redhat.com><20031115011144.GA30263@redhat.com><1068861619.19718.11.camel@frodo.toronto.redhat.com><20031118012436.GA14766@atrey.karlin.mff.cuni.cz><1070044425.31180.550.camel@p4><20031130170545.GA5576@atrey.karlin.mff.cuni.cz><1070465652.9315.2271.camel@p4> <1070492181.9321.2448.camel@p4> <20031203230606.GA18526@atrey.karlin.mff.cuni.cz>
On Wed, 2003-12-03 at 18:06, Zdenek Dvorak wrote:
> Hello,
>
> > Im running into a problem with my new code with your last change:
>
> [snip]
>
> > You are calling tree_ssa_finish outside the if (n_basic_blocks)
> > conditional, but init_tree_ssa is never called in this case. Its causing
> > me segfaults since there is an assumption that if you call
> > delete_tree_ssa, that init_tree_ssa must have been called.
>
> I don't see any such dependancy in delete_tree_ssa; I assume you mean
> some code you added there?
I have init code when init_tree_ssa() is initialized, and then delete
code when it delete_tree_ssa() is called.
>
> > There shouldn't be a dependancy on ssa if its never initialized... I
> > suspect the tree_ssa_finish can be moved inside the conditional and a
> > simple ELSE clause to take care of the 0 BB case?
>
> Probably. Or possibly you could move the actions you have added into
> delete_tree_ssa to rewrite_out_of_ssa (I don't know what they are,
> so I cannot know whether it is suitable solution).
>
Well, I think its pretty bad form to be calling delete_tree_ssa() when
you haven't called init_tree_ssa() in general. Its like calling free()
when you haven't called malloc(), I certainly wouldn't expect it to
work. My code assumes that you if you call delete() you called init(). I
think thats quite fair..... So I think you oughta restructure it so that
they are called in proper pairs.
Andrew