From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22261 invoked by alias); 31 Dec 2013 16:53:41 -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 22241 invoked by uid 48); 31 Dec 2013 16:53:38 -0000 From: "bmei at broadcom dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59651] Vectorizer failing to spot dependence causes incorrect code generation. Date: Tue, 31 Dec 2013 16:53: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: bmei at broadcom dot com X-Bugzilla-Status: UNCONFIRMED 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: 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: 2013-12/txt/msg02503.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59651 --- Comment #1 from Bingfeng Mei --- That is interesting. On x86-64, GCC does say it cannot determine dist vector between a[3] & a[b] and needs run-time aliasing test. In the end it gives up due to too few iterations. note: === vect_analyze_data_ref_dependences === (compute_affine_dependence stmt_a: _5 = a[3]; stmt_b: a[b.0_16] = _7; (analyze_overlapping_iterations (chrec_a = 3) (chrec_b = {3, +, -1}_1) (analyze_siv_subscript ) (overlap_iterations_a = [0]) (overlap_iterations_b = [0])) (Dependence relation cannot be represented by distance vector.) ) (compute_affine_dependence stmt_a: _5 = a[3]; stmt_b: _5 = a[3]; (analyze_overlapping_iterations (chrec_a = 3) (chrec_b = 3) (overlap_iterations_a = [0]) (overlap_iterations_b = [0])) ) (compute_affine_dependence stmt_a: a[b.0_16] = _7; stmt_b: a[b.0_16] = _7; (analyze_overlapping_iterations (chrec_a = {3, +, -1}_1) (chrec_b = {3, +, -1}_1) (overlap_iterations_a = [0]) (overlap_iterations_b = [0])) ) /projects/firepath_tools1_scratch/bmei/trunk/gcc/testsuite/gcc.dg/torture/pr52943.c:13:7: note: versioning for alias required: bad dist vector for a[3] and a[b.0_16] /projects/firepath_tools1_scratch/bmei/trunk/gcc/testsuite/gcc.dg/torture/pr52943.c:13:7: note: mark for run-time aliasing test between a[3] and a[b.0_16]