This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: After edge insertion, two bb's share the same heda
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: 25 Jul 2003 22:37:34 -0400
- Subject: Re: [tree-ssa]: After edge insertion, two bb's share the same heda
- References: <79A0F4E8-BEDB-11D7-9190-000A95A34564@dberlin.org>
On Fri, 2003-07-25 at 16:06, Daniel Berlin wrote:
> After insertion into a switch statement, I end up with two bb's that
> share the same head pointer
>
> (gdb) p bb->index
> $7 = 345
> (gdb) p bb->head_tree_p
> $8 = (tree *) 0x42afe2dc
> (gdb) p basic_block_info.data.bb[444].head_tree_p
> $9 = (tree *) 0x42afe2dc
>
> Is this allowed?
No. Big problems.
> It screws up normal insertion royally.
>
Not suprised :-)
> Note that 345 was an empty block (but still had the same head_tree_p)
> at the time 444 was created by bsi_insert_on_edge_immediate.
>
> The edge we insert on is also from 54->346 (346 is the successor block
> of 345), so it looks like collateral damage that we chose the same
> head_tree_p as block 345.
>
Soooo. What block is the switch stmt in? Whats block 345? I clearly need
more context :-)
> We end up with head_tree_p of block 345, and using it, after line 3820
> of tree-cfg.c:
>
> 3820 tsi = tsi_last (&BIND_EXPR_BODY (SWITCH_BODY (sw_stmt)));
>
> IE after this line, tsi points to block 345's head_tree_p, and we build
> a statement and append it into the new bb, and the new bb gets 345's
> head_tree_p:
>
> We then append this to the new bb here:
> 3827 append_stmt_to_bb (tsi_container (tsi), new_bb, sw_stmt);
>
>
> Andrew, the switch statement insertion is beyond my comprehension. If
> I send you the test case and instructions, can you look at this?
>
Its the child no one wants to talk about :-) Yep, I'll take a look. As
long as its simple enough of an example for me to understand :-) Even a
breakdown of whats in each block and what the relationship between the
edge you are inserting on and the pred/succs of the involved blocks is
probably enough for me to sort it out. It seems there is a switch
involved, what edge are you inserting on, and what are the pred/succs
which cause this to be a critical edge?
Andrew