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]: Insertion at beginning of bb broken


On Thu, 2003-05-29 at 18:00, Daniel Berlin wrote:
> It no longer updates the bb head properly if you insert *before* the 
> first statement of a bb.
> 
> This is because it does:
> 3556		same_tsi = inserted_tsi;
> 3557      tsi_next (&same_tsi);
> 3558
> 3559      if (curr_container == curr_bb->head_tree_p)
> 3560        {
> 3561          curr_bb->head_tree_p = tsi_container (same_tsi);
> 
> the structure after insertion, at line 3556, is like so:
> 
>   <compound_expr 0x190d940  <<<<<<<<<<<< NEW THING
>      type <void_type 0x15477e0 void VOID
>          align 8 symtab 0 alias set 21
>          pointer_to_this <pointer_type 0x1547850>>
>      side-effects
>      arg 0 <modify_expr 0x190d900
>          type <integer_type 0x1540540 long unsigned int unsigned SI
>              size <integer_cst 0x153d578 constant 32>
>              unit size <integer_cst 0x153d63c constant 4>
>              align 32 symtab 0 alias set -1 precision 32 min 
> <integer_cst 0x153d738 0> max <integer_cst 0x153d754 4294967295>>
>          side-effects
>          arg 0 <ssa_name 0x190d920 type <integer_type 0x1540540 long 
> unsigned int>
>             >
>          arg 1 <minus_expr 0x190d8e0 type <integer_type 0x1540540 long 
> unsigned int>
> 
>              arg 0 <ssa_name 0x1901040 type <integer_type 0x158f4d0 
> size_t>
>                 >
>              arg 1 <integer_cst 0x191b86c constant 1>>>
>      arg 1 <compound_expr 0x18dc5e0 type <void_type 0x15477e0 void>   
> <<<<<<<<<< OLD THING
>          side-effects
>          arg 0 <modify_expr 0x18dc600 type <integer_type 0x1540540 long 
> unsigned int>
>              side-effects
>              arg 0 <ssa_name 0x1904a00 type <integer_type 0x1540540 long 
> unsigned int>
>                 > arg 1 <ssa_name 0x190d920>
>              ../../gcc/unwind-dw2-fde.c:548>
> 
> inserted_tsi is a pointer to NEW THING.
> tsi_nexting moves it to OLD THING
> tsi_container (OLD THING) == OLD THING
> So we set the head to old thing, which is what it was already.
> This used to work right, and set the head to the new thing
> Can you please fix it?
> --Dan
> 

So does this fix it for you?

Andrew

	* tree-cfg.c (bsi_insert_before): Set BB head to new stmt container.


Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.96
diff -c -p -r1.1.4.96 tree-cfg.c
*** tree-cfg.c	24 May 2003 13:08:50 -0000	1.1.4.96
--- tree-cfg.c	29 May 2003 22:21:55 -0000
*************** bsi_insert_before (curr_bsi, t, mode)
*** 3558,3564 ****
  
    if (curr_container == curr_bb->head_tree_p)
      {
!       curr_bb->head_tree_p = tsi_container (same_tsi);
        /* If the parent block is a COND_EXPR or LOOP_EXPR, check if this
  	 is the block which they point to and update if necessary.  */
        if (parent)
--- 3558,3564 ----
  
    if (curr_container == curr_bb->head_tree_p)
      {
!       curr_bb->head_tree_p = tsi_container (inserted_tsi);
        /* If the parent block is a COND_EXPR or LOOP_EXPR, check if this
  	 is the block which they point to and update if necessary.  */
        if (parent)



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