[Bug tree-optimization/27381] [4.2 Regression] ice on valid code with -O

amacleod at redhat dot com gcc-bugzilla@gcc.gnu.org
Tue May 2 15:38:00 GMT 2006



------- Comment #5 from amacleod at redhat dot com  2006-05-02 15:38 -------
The assert condition is not flawed.  It has exposed a second bug with the old
immuse iterator scheme that was also hidden by the old algorithm work around
Jeff had implemented.

When iterating over the immediate uses, and deleting a stmt (such as a
conditional) causes an edge to be removed, PHI nodes have an argument deleted.  

when we remove PHI arguments, we move the last phi argument to whatever
position we actually deleted, and reduce the argument count.  When arguments
are moved, they were simply being delinked and then linked back into the use
chain. 

In this particular example, the argument being moved was another occurence of
the ssa_name being iterated over, and by delinking it and linking it back in,
it was moved back to the beginning of the immuse list. This caused it to be
missed during the iteration pahse, and rightfully triggered the assert.

The fix is to simply keep the same linked position when the argument is moved
instead of removing it from the list and linking it back in.

Patch is currently being tested.

Andrew


-- 

amacleod at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |amacleod at redhat dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-05-02 12:26:37         |2006-05-02 15:38:29
               date|                            |


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



More information about the Gcc-bugs mailing list