From patchwork Sun Jul 4 11:39:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 57836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C7F82B6F17 for ; Sun, 4 Jul 2010 21:39:28 +1000 (EST) Received: (qmail 27832 invoked by alias); 4 Jul 2010 11:39:26 -0000 Received: (qmail 27824 invoked by uid 22791); 4 Jul 2010 11:39:25 -0000 X-SWARE-Spam-Status: No, hits=-3.4 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; Sun, 04 Jul 2010 11:39:21 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 662D4867E2 for ; Sun, 4 Jul 2010 13:39:19 +0200 (CEST) Date: Sun, 4 Jul 2010 13:39:19 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR44656, value-replace for disambiugation during VN In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Sun, 4 Jul 2010, Richard Guenther wrote: > > This makes sure we value-replace references we try to disambiguate > against. The easiest place is to do in the translation hook when > we failed to disambiguate against the reference as it is in the IL. > > gcc.dg/tree-ssa/loadpre6.c which I XFAILed during the mem-ref2 > merge shows how we can leverage more PTA (and not rely on false > TBAA as we do for 4.5 and previous releases). > > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. I committed an old version. Fixed like the following. Richard. Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (revision 161798) +++ gcc/tree-ssa-sccvn.c (revision 161799) @@ -1218,12 +1218,12 @@ vn_reference_lookup_3 (ao_ref *ref, tree tree lhs = gimple_assign_lhs (def_stmt); ao_ref ref1; VEC (vn_reference_op_s, heap) *operands = NULL; - bool res; + bool res = true; copy_reference_ops_from_ref (lhs, &operands); operands = valueize_refs (operands); - ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs), - TREE_TYPE (lhs), operands); - res = refs_may_alias_p_1 (ref, &ref1, true); + if (ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs), + TREE_TYPE (lhs), operands)) + res = refs_may_alias_p_1 (ref, &ref1, true); VEC_free (vn_reference_op_s, heap, operands); if (!res) return NULL; Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 161798) +++ gcc/ChangeLog (revision 161799) @@ -1,5 +1,9 @@ 2010-07-04 Richard Guenther + * tree-ssa-sccvn.c (vn_reference_lookup_3): Fix last commit. + +2010-07-04 Richard Guenther + PR tree-optimization/44656 * tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation again after value-replacing in the defintions lhs.