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] PATCH to clean up tree-cfg.c


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


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