From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12047 invoked by alias); 14 Jun 2011 08:44:00 -0000 Received: (qmail 12037 invoked by uid 22791); 14 Jun 2011 08:43:59 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 08:43:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 521C28765C; Tue, 14 Jun 2011 10:43:38 +0200 (CEST) Date: Tue, 14 Jun 2011 09:10:00 -0000 From: Richard Guenther To: Jakub Jelinek Cc: Bernd Schmidt , gcc-patches@gcc.gnu.org Subject: Re: RFC: Fix GCSE exp_equiv_p on MEMs with different MEM_ATTRS (PR rtl-optimization/49390) In-Reply-To: <20110613184028.GW17079@tyan-ft48-01.lab.bos.redhat.com> Message-ID: References: <20110613184028.GW17079@tyan-ft48-01.lab.bos.redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 X-SW-Source: 2011-06/txt/msg01016.txt.bz2 On Mon, 13 Jun 2011, Jakub Jelinek wrote: > Hi! > > As the testcase shows, the > http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02945.html > patch looks wrong, MEM_ATTRS matters quite a lot for the > alias oracle, so ignoring it leads to miscompilations. > > Instead of just reverting the patch, this patch attempts to add > some exceptions, notably when MEM_ATTRS are indirect with MEM_REF > containing an SSA_NAME as base, and the SSA_NAMEs have the same > var (maybe that check is unnecessary) and both SSA_NAMEs have the > same points-to info, we can consider them interchangeable. Hum, I think this is bogus. When the SSA names are not exactly the same we miss the must-alias check which prevents TBAA from being applied. So if you really want equivalency for the alias oracle then you have to preserve whether the SSA names are exactly the same or not. The patch that reverted the MEM_ATTR comparison didn't come with a single testcase (ugh, I realize I approved it though ;)). What I suspect is that we are not good with sharing MEM_ATTRS with MEM_EXPRs, esp. using operand_equal_p for comparing MEM_EXPRs does not do a structural comparison of the trees (that was ok as long as we didn't have INDIRECT_REFs as bases for MEM_EXPRs but NULLed them). Maybe it was already fixed with my patch to treat the base operand of MEM_REFs specially via OEP_CONSTANT_ADDRESS_OF? So, please consider reverting Bernds patch instead. Bernd, do you have any testcases? Thanks, Richard.