From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3578 invoked by alias); 21 Jan 2015 15:02:03 -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 3489 invoked by uid 48); 21 Jan 2015 15:01:50 -0000 From: "izamyatin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds" Date: Wed, 21 Jan 2015 15:02: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.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: izamyatin at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 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-01/txt/msg02216.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64277 --- Comment #6 from Igor Zamyatin --- cunroll phase 7 times completely unrolls post-loop that was generated by vectorizer. And later vrp complains on those unrolled iterations. Note that for the test without if (nc > 3), i.e. void foo(short a[], short m) { int i,j; int f1[10]; short nc; nc = m + 1; for (i = 0, j = m; i < nc; i++, j--) { a[i] = f1[i]; a[j] = i; } return; } vrp doesn't complain while cunroll still performs 7 times complete unroll. Most probably merge block generated for the original testcase affects vrp's work: : # prephitmp_39 = PHI j_18 = (int) m_7(D); if (prephitmp_39 > 0) goto ; else goto ;