From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5446 invoked by alias); 12 May 2016 07:29: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 5371 invoked by uid 89); 12 May 2016 07:29:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS,SUBJ_ALL_CAPS autolearn=no version=3.3.2 spammy=2016-05-12 X-HELO: mx2.suse.de Received: from mx2.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; Thu, 12 May 2016 07:29:02 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BC4D8AD91 for ; Thu, 12 May 2016 07:28:59 +0000 (UTC) Date: Thu, 12 May 2016 07:29:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] PR71060 Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-05/txt/msg00874.txt.bz2 The PR shows that data-dependence analysis is too strict when making sure that dr_indices of two DRs are compatible enough to be fed into the dependence machinery. The important part is that the structure of the object needs to be the same which is ensured by type equality. Then of course they need to be based on the same address. Things like whether the object was referenced via a restrict pointer or with special alignment doesn't matter for the dependence analysis step using dr_indices. Thus the following patch improves this bit in dependence analysis, not yet fixing the underlying issue of the "miscompare" which is if-conversion dropping restrict info when building masked load/stores. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2016-05-12 Richard Biener PR tree-optimization/71060 * tree-data-ref.c (initialize_data_dependence_relation): Do not require exact match of DR_BASE_OBJECT but only matching address and type. Index: gcc/tree-data-ref.c =================================================================== *** gcc/tree-data-ref.c (revision 236158) --- gcc/tree-data-ref.c (working copy) *************** initialize_data_dependence_relation (str *** 1538,1545 **** } /* If the references do not access the same object, we do not know ! whether they alias or not. */ ! if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), 0)) { DDR_ARE_DEPENDENT (res) = chrec_dont_know; return res; --- 1538,1550 ---- } /* If the references do not access the same object, we do not know ! whether they alias or not. We do not care about TBAA or alignment ! info so we can use OEP_ADDRESS_OF to avoid false negatives. ! But the accesses have to use compatible types as otherwise the ! built indices would not match. */ ! if (!operand_equal_p (DR_BASE_OBJECT (a), DR_BASE_OBJECT (b), OEP_ADDRESS_OF) ! || !types_compatible_p (TREE_TYPE (DR_BASE_OBJECT (a)), ! TREE_TYPE (DR_BASE_OBJECT (b)))) { DDR_ARE_DEPENDENT (res) = chrec_dont_know; return res;