From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17104 invoked by alias); 25 Feb 2015 14:55: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 17082 invoked by uid 48); 25 Feb 2015 14:55:37 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65206] Vectorized version of loop is removed. Date: Wed, 25 Feb 2015 15:08: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 2015-02/txt/msg02792.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65206 --- Comment #2 from Richard Biener --- We apply versioning for aliasing but compute it as always aliasing in some way, thus the runtime check gets immediately folded and thus the vectorized loop removed: t.c:7:3: note: create runtime check for data references a1[i_16] and *_34 t.c:7:3: note: created 1 versioning for alias checks. t.c:7:3: note: loop versioned for vectorization because of possible aliasing ... but I see the alias runtime check nowhere. The DRs are (gdb) p debug_data_reference (dr_a.dr) #(Data Ref: # bb: 4 # stmt: _5 = a1[i_16]; # ref: a1[i_16]; # base_object: a1; # Access function 0: {0, +, 1}_1 #) $17 = void (gdb) p debug_data_reference (dr_b.dr) #(Data Ref: # bb: 4 # stmt: MASK_STORE (_34, 0B, _ifc__32, _9); # ref: *_34; # base_object: MEM[(float *)&a1]; # Access function 0: {0B, +, 4}_1 #) so maybe the code doing masked loads/stores updates the DRs in a way that will later confuse runtime alias checking. Or for some reason it doesn't update it enough to make data-dependence analysis handle it. Clearly this is a must-dependence (but with known distance), so sth that data dependence analysis should handle and sth that the runtime alias checking isn't handling.