From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 13:51:00 -0000 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 Content-Type: multipart/mixed; boundary="nextPart1815181.EQjWSDEcsr" Content-Transfer-Encoding: 7Bit X-SW-Source: 2017-06/txt/msg01119.txt.bz2 This is a multi-part message in MIME format. --nextPart1815181.EQjWSDEcsr Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 555 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. -- Eric Botcazou --nextPart1815181.EQjWSDEcsr Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="p.diff" Content-length: 558 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 --nextPart1815181.EQjWSDEcsr--