From patchwork Thu Jun 15 13:51:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 776297 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wpQ0N0PmWz9rvt for ; Thu, 15 Jun 2017 23:51:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ejLcX3/X"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=Em+uZO6/fYRjS5Jo Wz2P5mjFbEKy4kmv4rPWixXww/+gIYiEifqipJ92Jl9iwjt9w9ud8UU/rinQoeJZ 0Qoi4D/v6DirvZUuLmefBNymMBgaMNgbE2SpfYA8QeolQNrT08GLX4gVhIGgYs3x g76pEDmC/nZJBj6yIUvZ9DEP7GY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=bH8jOvpC2nM8LzToNpk1Wr /2Qc8=; b=ejLcX3/XOAbqfbOFFq/b+AVuKHMsHMdBaHCNWIsDzhD/Oh8v2KCB57 /H5qieYxmM43af/u0RInZrUBw9erBBiGHmOnAJYyAUekIYs6UrQ05CcMGvLJk/+V 8TsedPINjBdzIId8ikcx/1eeKUkSroJeE51RMjgYoTZKa53tvy6a8= Received: (qmail 123806 invoked by alias); 15 Jun 2017 13:51:32 -0000 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 Received: (qmail 123796 invoked by uid 89); 15 Jun 2017 13:51:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Jun 2017 13:51:30 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 84C8581458 for ; Thu, 15 Jun 2017 15:51:33 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oKgAO2W3yYTf for ; Thu, 15 Jun 2017 15:51:33 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 62C6581454 for ; Thu, 15 Jun 2017 15:51:33 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr Date: Thu, 15 Jun 2017 15:51:32 +0200 Message-ID: <59903573.zuAO1vMF2R@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Hi, the transformation done to TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr is exactly the same as one of those done in maybe_fold_tmr, the latter is better written and the former function calls the latter, so this patch changes maybe_canonicalize_mem_ref_addr to avoid touching TARGET_MEM_REF directly. Tested on x86-64/Linux, OK for the mainline? 2017-06-15 Eric Botcazou PR bootstrap/80897 * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Do not change TARGET_MEM_REF expressions directly. Index: gimple-fold.c =================================================================== --- gimple-fold.c (revision 249091) +++ gimple-fold.c (working copy) @@ -4178,8 +4178,7 @@ maybe_canonicalize_mem_ref_addr (tree *t /* Canonicalize MEM [&foo.bar, 0] which appears after propagating of invariant addresses into a SSA name MEM_REF address. */ - if (TREE_CODE (*t) == MEM_REF - || TREE_CODE (*t) == TARGET_MEM_REF) + if (TREE_CODE (*t) == MEM_REF) { tree addr = TREE_OPERAND (*t, 0); if (TREE_CODE (addr) == ADDR_EXPR