public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: law@redhat.com
To: Diego Novillo <dnovillo@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: [tree-ssa] Mainline merge as of 2003-04-06
Date: Wed, 09 Apr 2003 23:59:00 -0000	[thread overview]
Message-ID: <200304092254.h39MsCPf018186@speedy.slc.redhat.com> (raw)
In-Reply-To: Your message of "Wed, 09 Apr 2003 15:36:34 EDT." <20030409193634.GA24420@tornado.toronto.redhat.com>

In message <20030409193634.GA24420@tornado.toronto.redhat.com>, Diego Novillo w
rites:
 >The fixes to the flowgraph code were needed to better handle the
 >presence of empty statements in the function.  The inliner is now
 >inlining functions after they've been optimized by the tree
 >optimizers.  This was confusing the flowgraph in various places.
Note it's still confusing things.  Consider:

void __cxa_bad_cast() ()
{
  void * <UVcf50>;
  struct bad_cast * T.1;
  void * _ZTISt8bad_cast.2;

  
  # BLOCK 0 (k.C:13).  PRED:.  SUCC:.
  {
    <UVcf50> = __cxa_allocate_exception (1);
    try
      {
        
        # 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
                  }
                }
              }
            catch
              {
                
                # BLOCK 3 (k.C:7).  PRED:.  SUCC:.
                <<<eh_filter ()>>>
                  {
                    
                    # BLOCK 4 (k.C:7).  PRED:.  SUCC:.
                    __cxa_call_unexpected (<<<exception object>>>)
                  }
              }
          }
        };
        (void)0
      }
    catch
      {
        
        # BLOCK 5 (k.C:14).  PRED:.  SUCC:.
        <<<eh_filter ()>>>
          {
            
            # BLOCK 6 (k.C:14).  PRED:.  SUCC:.
            terminate ()
          }
      };
    
    # BLOCK 7 (k.C:14).  PRED:.  SUCC:.
    _ZTISt8bad_cast.2 = &_ZTISt8bad_cast;
    __cxa_throw (<UVcf50>, _ZTISt8bad_cast.2, 0B)
  }
}

$17 = void


[ This is obviously before we add edges to the CFG. ]

Of particular interest is block #2.  There are no executable statements in
this block (one could certainly argue that we shouldn't have created a
block in this case -- that's on my TODO list).

Anyway, we want to create an edge from block #2 to it's successor block.
However, it's not immediately clear what its successor block ought to 
be.  The code as it stands right now will try to make an edge to the
next statement in the parent's block -- but that happens to be an
empty_stmt_node which was ignored when building the CFG (ie, it has no
block).  This causes us to segfault.

We really want to wire an edge from block #2 to block #7, but that 
would require that we know how to get to the parent of the empty
statement node.  

How is this supposed to work?

Jeff

  reply	other threads:[~2003-04-09 22:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09 20:37 Diego Novillo
2003-04-09 23:59 ` law [this message]
2003-04-10  9:30   ` Diego Novillo
2003-04-10 16:40     ` law
2003-04-10 20:20       ` Diego Novillo
2003-04-14 16:08         ` law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200304092254.h39MsCPf018186@speedy.slc.redhat.com \
    --to=law@redhat.com \
    --cc=dnovillo@redhat.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).