This is the mail archive of the gcc@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] Mainline merge as of 2003-04-06


On Wed, 2003-04-09 at 18:54, law at redhat dot com wrote:

>         # BLOCK 1 (k.C:14).  PRED:.  SUCC:.
>         T.1 = (struct bad_cast *)<UVcf50>;
>         {
>           struct bad_cast * const this;
> 
>           this = (struct bad_cast * const)T.1;
>           {
>             try
>               {
>                 
>                 # BLOCK 2 (k.C:7).  PRED:.  SUCC:.
>                 {
>                   {
>                     (void)0
>                   }
>                 }
>               }
> [ ... ]
>
> How is this supposed to work?
> 
When you are about to make the recursive call to make_blocks to build
the blocks for the body of the TRY_EXPR, you should set the
NEXT_BLOCK_LINK argument to whichever statement should execute after
that body has executed.  For instance, the handlers for COND_EXPR and
SWITCH_EXPR set it to the statement following the entry statement:

if ()
  {
    s1;
    s2;
    s3;
  }
s4;

When make_cond_expr_blocks() calls make_blocks(), the argument
NEXT_BLOCK_LINK will be set to s4.  This way, when making an edge out of
s3's block, make_edges will know that it should go to s4's block.

The main loop in make_blocks should be smart enough to use the BIND_EXPR
of that TRY_EXPR's body and store NEXT_BLOCK_LINK in the BIND_EXPR.  To
visualize this, you can use this:

main()
{
  int a;
  a = foo();
  if (a > 3)
    {
        {
        }
    }
  a++;
}

If you want, I could take a look at the patch, but at first sight it
seems that you are only missing setting NEXT_BLOCK_LINK when building
the body of the TRY_EXPR.


Diego.


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