From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27388 invoked by alias); 16 Jan 2013 10:04:52 -0000 Received: (qmail 27317 invoked by uid 48); 16 Jan 2013 10:04:28 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52865] GCC can't vectorize fortran loop but able to vectorize similar c-loop Date: Wed, 16 Jan 2013 10:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-01/txt/msg01483.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52865 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-01-16 Ever Confirmed|0 |1 --- Comment #8 from Richard Biener 2013-01-16 10:04:27 UTC --- In another bug I stated that while (1) { ... if (countm1.0 == 0) goto L.2; countm1.0 = countm1.0 + 4294967295; } L.2:; is bad for the vectorizer (the non-empty latch block). You instead want GFortran to emit while (1) { ... tem = countm1.0 countm1.0 = countm1.0 + 4294967295; if (tem == 0) goto L.2; } L.2:; where hopefully the addition does not overflow ... That said, somewhat lessening the restriction on empty latch blocks is certainly possible (IV increments should be fine), but it might be not as trivial as it looks.