From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15169 invoked by alias); 2 May 2006 15:38:33 -0000 Received: (qmail 15134 invoked by uid 48); 2 May 2006 15:38:30 -0000 Date: Tue, 02 May 2006 15:38:00 -0000 Message-ID: <20060502153830.15133.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/27381] [4.2 Regression] ice on valid code with -O In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "amacleod at redhat dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00184.txt.bz2 List-Id: ------- 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