This is the mail archive of the gcc-patches@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]

Patch RFC [tree-ssa]: ICE in DSE


I'm getting an ICE in DSE in sixtrack, which I can't post, and haven't been able to
duplicate it in a small example. However the situation is straightforward:


#   i__9878 = VDEF <i__9879>;                  [A]
i_ = 6;
#   i__9164 = VDEF <i__9878>;                  [B]
i_ = 1;

#i__10497 = PHI <i__9164(4), i__2915(7)>; [C]

#   i__2915 = VDEF <i__10497>;                [D]
i_ = T.17897_9327;

When deleting [B], the use from [A] is updated to point to [D] rather than [C]
(which is correctly updated to use i_9878). This leads to a crash later when deleting [A].
The fix is also easy. OK, pending tesitng and ChangeLog?


Index: tree-ssa-dse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dse.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 tree-ssa-dse.c
*** tree-ssa-dse.c      16 Mar 2004 22:31:56 -0000      1.1.2.6
--- tree-ssa-dse.c      18 Mar 2004 20:45:03 -0000
*************** dse_optimize_stmt (struct dom_walk_data
*** 311,317 ****

          /* Any immediate uses which reference STMT need to instead
             reference USE.  This allows us to cascade dead stores.  */
!         redirect_immediate_uses (stmt, use);

          /* Finally remove the dead store.  */
          bsi_remove (&bsi);
--- 311,317 ----

/* Any immediate uses which reference STMT need to instead
reference USE. This allows us to cascade dead stores. */
! redirect_immediate_uses (stmt, skipped_phi ? skipped_phi : use);


          /* Finally remove the dead store.  */
          bsi_remove (&bsi);


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