public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/28798]  New: remove_phi_node attempts removal of a phi node resized by resize_phi_node
@ 2006-08-22  6:07 hosking at cs dot purdue dot edu
  2006-08-22  6:10 ` [Bug tree-optimization/28798] " pinskia at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 23+ messages in thread
From: hosking at cs dot purdue dot edu @ 2006-08-22  6:07 UTC (permalink / raw)
  To: gcc-bugs

If a phi node has been resized using resize_phi_node, it may later be attempted
to be removed by remove_dead_inserted_code using remove_phi_node, as the old
phi node will be present in inserted_exprs, yet the phi node will not be in the
chain of phi nodes for its original basic block.

I believe the fix is to make remove_phi_node bail out if the phi node is not
present in the list of phi nodes for its basic block:

void
remove_phi_node (tree phi, tree prev)
{
  tree *loc;

  if (prev)
    {
      loc = &PHI_CHAIN (prev);
    }
  else
    {
      for (loc = &(bb_for_stmt (phi)->phi_nodes);
           loc && *loc != phi;
           loc = &PHI_CHAIN (*loc))
        ;
    }
  if (!loc) return;

  /* Remove PHI from the chain.  */
  *loc = PHI_CHAIN (phi);

  /* If we are deleting the PHI node, then we should release the
     SSA_NAME node so that it can be reused.  */
  release_phi_node (phi);
  release_ssa_name (PHI_RESULT (phi));
}


-- 
           Summary: remove_phi_node attempts removal of a phi node resized
                    by resize_phi_node
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hosking at cs dot purdue dot edu
 GCC build triplet: i386-apple-darwin8.7.1
  GCC host triplet: i386-apple-darwin8.7.1
GCC target triplet: i386-apple-darwin8.7.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28798


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

end of thread, other threads:[~2006-08-31  5:38 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22  6:07 [Bug tree-optimization/28798] New: remove_phi_node attempts removal of a phi node resized by resize_phi_node hosking at cs dot purdue dot edu
2006-08-22  6:10 ` [Bug tree-optimization/28798] " pinskia at gcc dot gnu dot org
2006-08-22  6:17 ` pinskia at gcc dot gnu dot org
2006-08-22 12:47   ` Daniel Berlin
2006-08-22 12:47 ` dberlin at dberlin dot org
2006-08-23 13:40 ` hosking at cs dot purdue dot edu
2006-08-23 15:16   ` Andrew Pinski
2006-08-23 15:16 ` pinskia at gmail dot com
2006-08-23 18:12 ` pinskia at gcc dot gnu dot org
2006-08-23 22:30 ` hosking at cs dot purdue dot edu
2006-08-23 23:52   ` Daniel Berlin
2006-08-23 23:43 ` hosking at cs dot purdue dot edu
2006-08-24  0:15   ` Andrew Pinski
2006-08-23 23:52 ` dberlin at dberlin dot org
2006-08-24  0:15 ` pinskia at physics dot uc dot edu
2006-08-24  0:57 ` hosking at cs dot purdue dot edu
2006-08-24  2:45   ` Daniel Berlin
2006-08-24  2:45 ` dberlin at dberlin dot org
2006-08-24 15:27 ` hosking at cs dot purdue dot edu
2006-08-25 15:19   ` Daniel Berlin
2006-08-25 15:19 ` dberlin at dberlin dot org
2006-08-29 15:53 ` hosking at cs dot purdue dot edu
2006-08-31  5:38 ` hosking at cs dot purdue dot edu

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