This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] PATCH to clean up tree-cfg.c
- From: law at redhat dot com
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Sep 2003 15:38:16 -0600
- Subject: Re: [tree-ssa] PATCH to clean up tree-cfg.c
- Reply-to: law at redhat dot com
In message <wvl4qzjl4kg.fsf@prospero.boston.redhat.com>, Jason Merrill writes:
>On Thu, 11 Sep 2003 11:08:57 -0400, Jason Merrill <jason@redhat.com> wrote:
>
>> *** tree-ssa-ccp.c.~1~ 2003-09-11 02:24:33.000000000 +0000
>> --- tree-ssa-ccp.c 2003-09-11 04:35:58.000000000 +0000
>> *************** visit_stmt (tree stmt)
>> *** 570,578 ****
>> {
>> DONT_SIMULATE_AGAIN (stmt) = 1;
>>
>> ! /* If STMT is a control statement or a computed goto, then mark all
>> the output edges executable. */
>> ! if (is_ctrl_stmt (stmt) || is_computed_goto (stmt))
>> add_outgoing_control_edges (bb_for_stmt (stmt));
>> }
>>
>> --- 570,578 ----
>> {
>> DONT_SIMULATE_AGAIN (stmt) = 1;
>>
>> ! /* If STMT is a control structure or a computed goto, then mark all
>> the output edges executable. */
>> ! if (is_ctrl_structure (stmt) || is_computed_goto (stmt))
>> add_outgoing_control_edges (bb_for_stmt (stmt));
>> }
>>
>
>BTW, I wondered if this test should be changed to just
>
> if (is_ctrl_stmt (stmt))
>
>The difference would be that currently we aren't marking normal gotos--I
>don't know whether or not that's intentional.
Simple GOTOs are handled somewhat specially for the sake of efficiency.
A simple GOTO_EXPR will end a block and the block will have a single
normal edge to the destination of the GOTO_EXPR. That edge is added to
the worklist the first time the block containing the GOTO_EXPR is
simulated.
The only way a block ending in a simple GOTO_EXPR can have more than
one outgoing edge is if all the other edges are abnormals and the abnormals
are also added to the worklist as soon as the block containing the
GOTO_EXPR is simulated.
jeff