[PATCH] Don't abort in C++ emit_local_var

Jakub Jelinek jakub@redhat.com
Wed Jun 21 05:11:00 GMT 2000


On Wed, Jun 21, 2000 at 02:34:13AM -0700, Mark Mitchell wrote:
> 
> Jakub --
> 
>   I'm sort-of unhappy about this patch.  It really is odd to have
> emit_local_var being called more than once.  That assert has turned up
> a lot of bugs.
> 
>   I'm not at all confident that your change is safe.  Is there any
> guarantee that the stack slots allocated to the local are still valid?
> Won't they have been marked as going out of scope by that point?

In most cases it should be safe, but you're right, at least in the case
of dynamic objects things would be miscompiled.
Now the question is how to solve it.
walk_tree is cp/ only, DECL_STMT is not defined in tree.def either.
So either that would have to be a language specific hook which would check
each args[].tree_value and say if it is impossible for it to be an argument
to a tail call, or there could be a cfun variable, initialized by
expand_call, which would expand_decl set if it is emitting any instructions
(ie. last two if clauses) in order to set DECL_RTL.
expand_call would then use that variable to check if it should kill the tail
call sequence.

> 
>   I think the sibling call stuff should punt if encounters any
> DECL_STMTs inside the arguments to the call, instead.

	Jakub


More information about the Gcc-patches mailing list