This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa Too many edges in CFG
- From: law at redhat dot com
- To: Jason Merrill <jason at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 08 May 2003 09:56:19 -0600
- Subject: Re: [tree-ssa Too many edges in CFG
- Reply-to: law at redhat dot com
In message <firstname.lastname@example.org>, Jason Merrill writes:
>On Thu, 08 May 2003 09:18:20 -0600, email@example.com wrote:
>> In message <20030508151341.GA14715@tornado.toronto.redhat.com>, Diego Novil
>> >On Wed, May 07, 2003 at 02:25:20PM -0700, Richard Henderson wrote:
>> >> On Tue, May 06, 2003 at 08:50:06PM -0600, firstname.lastname@example.org wrote:
>> >> > + /* Some calls are known not to return. For such calls we nee
>> >> > + add an edge to the exit block. No fall thru edge is needed
>> >> > + as these calls can not return in the normal sense. */
>> >> Why do you need an edge to the exit block?
>> >I don't think we use that for anything right now. In the future,
>> >the predecessor blocks of EXIT_BLOCK_PTR will be the blocks where
>> >we want to put copy-out operations for globals and statics.
>> But for a non-returning function the edge to the exit block can never
>But a call to a non-returning function does in fact exit the function, just
>not by returning to the caller.
Right. And since the non-returning function exits by not returning to the
caller means that we do not traverse the edge from the nonreturning
function to the exit block. Thus any insns on that edge are totally
useless and can be ignored.
> IIUC, the optimizers assume that any
>non-dead code will be on some path between the entry and exit blocks. And,
>as Diego says, if we've deferred copy-out operations we need to insert them
>here, as a non-returning function can still refer to globals, and might do
>a longjmp or throw to get back to our caller.
Certainly we have to insert the proper copies *before* the call, but for
a nonreturning call, no copies after the call are necessary.