From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19428 invoked by alias); 8 Jul 2010 09:07:49 -0000 Received: (qmail 19416 invoked by uid 22791); 8 Jul 2010 09:07:48 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jul 2010 09:07:39 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id EC3D590847 for ; Thu, 8 Jul 2010 11:07:36 +0200 (CEST) Date: Thu, 08 Jul 2010 09:07:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR44838 Message-ID: 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: 2010-07/txt/msg00634.txt.bz2 This fixes PR44838, a case that exposes that using SSA name equivalence to derive value equivalence isn't valid in RTL. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2010-07-08 Richard Guenther PR rtl-optimization/44838 * tree-ssa-alias.c (indirect_refs_may_alias_p): When not in SSA form do not use pointer equivalence. Index: gcc/tree-ssa-alias.c =================================================================== *** gcc/tree-ssa-alias.c (revision 161913) --- gcc/tree-ssa-alias.c (working copy) *************** indirect_refs_may_alias_p (tree ref1 ATT *** 801,807 **** /* If both bases are based on pointers they cannot alias if they may not point to the same memory object or if they point to the same object and the accesses do not overlap. */ ! if (operand_equal_p (ptr1, ptr2, 0)) { if (TREE_CODE (base1) == MEM_REF) offset1 += mem_ref_offset (base1).low * BITS_PER_UNIT; --- 801,808 ---- /* If both bases are based on pointers they cannot alias if they may not point to the same memory object or if they point to the same object and the accesses do not overlap. */ ! if ((!cfun || gimple_in_ssa_p (cfun)) ! && operand_equal_p (ptr1, ptr2, 0)) { if (TREE_CODE (base1) == MEM_REF) offset1 += mem_ref_offset (base1).low * BITS_PER_UNIT;