[tree-ssa] Mainline merge as of 2003-04-06
law@redhat.com
law@redhat.com
Wed Apr 9 23:59:00 GMT 2003
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
More information about the Gcc
mailing list