public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [tree-ssa]: Insertion at beginning of bb broken
@ 2003-05-29 23:56 Daniel Berlin
  2003-05-30  0:46 ` Andrew MacLeod
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Berlin @ 2003-05-29 23:56 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tree-ssa]: Insertion at beginning of bb broken
  2003-05-30  0:46 ` Andrew MacLeod
@ 2003-05-30  0:46   ` Daniel Berlin
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Berlin @ 2003-05-30  0:46 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: gcc mailing list

> So does this fix it for you?
Yeah.
I just wasn't sure it was always correct.
:)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tree-ssa]: Insertion at beginning of bb broken
  2003-05-29 23:56 [tree-ssa]: Insertion at beginning of bb broken Daniel Berlin
@ 2003-05-30  0:46 ` Andrew MacLeod
  2003-05-30  0:46   ` Daniel Berlin
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew MacLeod @ 2003-05-30  0:46 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: gcc mailing list

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-29 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-29 23:56 [tree-ssa]: Insertion at beginning of bb broken Daniel Berlin
2003-05-30  0:46 ` Andrew MacLeod
2003-05-30  0:46   ` Daniel Berlin

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).