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: [tree-ssa] Removal of gotos from cfg based ir


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


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