From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21003 invoked by alias); 17 Feb 2015 12:03:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20948 invoked by uid 48); 17 Feb 2015 12:03:05 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65063] [4.8/4.9/5 Regression] gcc.dg/vect/vect-double-reduc-6.c FAILs with -O3 -fno-tree-loop-ivcanon -fno-tree-vectorize Date: Tue, 17 Feb 2015 12:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg01894.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65063 --- Comment #3 from Richard Biener --- The tail loop ends up with completely off initial conditions because its values are computed before pcom transform which ends up releasing the SSA names used therein. Then unrolling assigns some random new SSA names to them. So it seems to me that pcom doesn't deal with the case of a tail loop at all - at least it doesn't compute entry values for that. There isn't a 1:1 relation between the values either and the old IVs are removed. Also there seems to be always at least one tail iteration. In the existing testcases the old IVs simply don't become dead. So we have to restrict unrolling to the case where we don't replace looparound PHIs.