From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10012 invoked by alias); 26 Jun 2014 14:29:21 -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 9979 invoked by uid 48); 26 Jun 2014 14:29:17 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61619] Benefits from -ftree-vectorize lost easily when changing unrelated code Date: Thu, 26 Jun 2014 14:29: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: 4.9.0 X-Bugzilla-Keywords: 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-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed 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: 2014-06/txt/msg02132.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61619 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-06-26 Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- bug.cpp:69:13: note: not vectorized: number of iterations cannot be computed. bug.cpp:69:13: note: bad loop form. The loop is : # sum_62 = PHI # p_71 = PHI [bug.cpp : 69:80] _32 = [bug.cpp : 69] *p_71; [bug.cpp : 69:80] sum_33 = sum_62 + _32; [bug.cpp : 29:31] p_50 = p_71 + pretmp_7; [bug.cpp : 69:13] if (_48 != p_50) goto ; else goto ; : goto ; The above is with -fopt-info-vec-missed and the excerpt is from the bug.cpp.114t.vect file produced by -fdump-tree-vect-details-lineno I believe the issue is that the initialization of S and E are not inlined if none of the uncomments are done. If you expect all abstraction to be removed by inlining the 'flatten' attribute can do magic. Unfortunately the inits look like [/usr/include/c++/4.9/bits/stl_algobase.h : 378:6] MEM[(char * {ref-all})&S] = MEM[(char * {ref-all})&._94]; pretmp_22 = MEM[(struct array *)&S]; which we don't fold to the constant init 1 for some reason.