From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76999 invoked by alias); 10 Jul 2015 07:51:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 76990 invoked by uid 89); 10 Jul 2015 07:51:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 10 Jul 2015 07:51:20 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ADE46AC4C for ; Fri, 10 Jul 2015 07:51:17 +0000 (UTC) Date: Fri, 10 Jul 2015 07:51:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR66823 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-07/txt/msg00843.txt.bz2 On Thu, 9 Jul 2015, Richard Biener wrote: > > The following fixes a stupid bug with -ftree-loop-if-convert-stores. > We were treating all but the same base as candidate to determine > whether a ref was accessed unconditionally ... > > Bootstrap & regtest running on x86_64-unknown-linux-gnu. Applied as follows, with gcc.dg/vect/pr61194.c adjusted which now FAILs because in int i; for (i=0; i<1024; ++i) z[i] = ((x[i]>0) & (w[i]<0)) ? z[i] : y[i]; while z[i] is correctly identified as not trapping because it is written to unconditionally, y[i] is not (but was previously as any of the unconditional accesses to x[i], w[i] or z[i] counted as that). Applied to trunk. 2015-07-10 Richard Biener PR tree-optimization/66823 * tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix inverted predicate. * gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores which should not be necessary. XFAIL. Index: gcc/tree-if-conv.c =================================================================== --- gcc/tree-if-conv.c (revision 225610) +++ gcc/tree-if-conv.c (working copy) @@ -642,7 +642,7 @@ memrefs_read_or_written_unconditionally || TREE_CODE (ref_base_b) == REALPART_EXPR) ref_base_b = TREE_OPERAND (ref_base_b, 0); - if (!operand_equal_p (ref_base_a, ref_base_b, 0)) + if (operand_equal_p (ref_base_a, ref_base_b, 0)) { tree cb = bb_predicate (gimple_bb (DR_STMT (b))); Index: gcc/testsuite/gcc.dg/vect/pr61194.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr61194.c (revision 225610) +++ gcc/testsuite/gcc.dg/vect/pr61194.c (working copy) @@ -1,5 +1,4 @@ /* { dg-require-effective-target vect_cond_mixed } */ -/* { dg-additional-options "-ftree-loop-if-convert-stores" } */ #include "tree-vect.h" @@ -39,4 +38,4 @@ int main() return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */