From patchwork Wed Oct 3 16:47:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 148067 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6706823lji; Wed, 3 Oct 2018 09:47:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV61EMkIAuEZOH5VM6LzB8uxMEcyONnh0tDOafN9d6Ctis30y/J6m+W9wvV7NEqr3Hr+hgKHs X-Received: by 2002:a17:902:bf0a:: with SMTP id bi10-v6mr2482295plb.163.1538585276444; Wed, 03 Oct 2018 09:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538585276; cv=none; d=google.com; s=arc-20160816; b=lQdC+CcL9TJElPP+OOwRYLMYQJSlIdPxZ3PmuSX6RQsRA8OgODMZvEaoxAmi7oGbmp TaBCc3qCnXyGq3LbZDW5dU0FpXH3FIxQWelqTKwBXudTtq0QgBZt7PbWanBn2NcdkA6a NfT0NrzOtO3xvT/dotsNYtroIjr5KJyrTkqmsvpXYCR9+OMfKJyoCLX3dDoVMU9CtDC/ ix4b8inDYxDZWXv4Ul8LPzGUbVnisyBk6DkPYzlL7L1bKbRSRgHyT0+1XVTLyhAGDNkV LDlCSFh5rQ85cVLyCvqe6Q8fJthaw/QXUJEPcuDH03byHNtGDgXWtoybDtRNsN56Vm5K YLNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=4/sE5y9vEdy573CGy+/BPWXFI3AEmjy/xtbct/pwnQY=; b=E0ZFmcM+9P9AeopGKtuArceSzgPZHZbNuo6DE0ku4ZlSP52HLFDk6z+rC6UND0Y2dz rndsK1uBReK0SXGpeMJQFiogfcLVs8eeD2LxlGgP89nrcFJxT7BcsNwFNMK5KVz6s+aB BI7Pr064/2B6B4X9EdW8zRrNw2dQ/0V/DxJoeojZYzZ0AFCzz5F4RiJnLUk/qScc/dxu 04/p9cTG3TVDLsJ2uf7FJ5fM+kZbDfujPBDZw5CaYTakcEAcZTutu2bRebr64Dt5YdPm BtWcftKJlFc1oqV/Dxc8k+dA4U5KjgF98yn3KjKkL/zhgY5UDK0C58iftlFuIJ8a6u82 JUkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uPQ4BsQf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jOUp6n+s; spf=pass (google.com: domain of gcc-patches-return-486889-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486889-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i5-v6si1924755pgg.559.2018.10.03.09.47.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 09:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-486889-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uPQ4BsQf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jOUp6n+s; spf=pass (google.com: domain of gcc-patches-return-486889-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-486889-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=AfPtYV4TFP0b5lC1TlYhnMsXPR0M8W8JaMaoSMJwY5O ySFVNEMFQMs3kmD9WMsikx2T8AkhnXj+wgSgNkbp8PNDlC3Cu4zSoq9sFhxKOdgp LUkA0b46Wihu4NDKCG1R7zshuMdZ857RXt3HSt2Cmc2hAg6EwWeXg3tN60yaTdRM = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=Q50EbUfEtHxQgQcoEg7tJK3n7+A=; b=uPQ4BsQfWmBmCSz5l e3U9thjSuJYTbwd3Hz30TpHJAAtezFHxU7TikcPjpmofZrWOBbWyc1U6TKA4pXKG dZuVIGmY2lj8id19cSAv2NtwJwQa5byOVFn7jtfC/Xya+IdHY8L0afKvMHQjkJY4 6HLNuhdl5FsoY060Dmpievd5JQ= Received: (qmail 49924 invoked by alias); 3 Oct 2018 16:47:45 -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 49913 invoked by uid 89); 3 Oct 2018 16:47:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Never, HX-Envelope-From:sk:thomas., removes, 2018-08 X-HELO: mail-io1-f43.google.com Received: from mail-io1-f43.google.com (HELO mail-io1-f43.google.com) (209.85.166.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Oct 2018 16:47:40 +0000 Received: by mail-io1-f43.google.com with SMTP id e12-v6so5555185iok.12 for ; Wed, 03 Oct 2018 09:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=WoJsdg4zG2PkViirNkVEm86fAKHfi0KnEa8rNKRQ2Ys=; b=jOUp6n+smXa1dHrfb/wKFLvWuLhCMWAATTvg4W29x4x1ycfCfZFm1kDkWVKZSfhUKt QYHGQD2+fDX5CgX0c/VhVLBVvGhN2x4uGaeB2H6YzMKjZeCn9eaL1vW4579j7UfIhpRE Slq3RUkeHAzRf6Y91vgJkZu+klw2Lp62qfcI8= MIME-Version: 1.0 From: Thomas Preudhomme Date: Wed, 3 Oct 2018 17:47:27 +0100 Message-ID: Subject: [PATCH, LRA] Never reload fixed form constraints memory operand To: Vladimir Makarov Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Hi, The unconditional reload of address operand for recognized instruction in process_address_1 prevent the patch for fixing "PR85434: Address of stack protector guard spilled to stack on ARM" proposed at [1]. The code in this patch attempt to control which registers are used to make PIC access but the reload performed by process_address_1 will use generic PIC access. This patch removes the test for the instruction to be unrecognized to do the reload, thus always avoiding to reload address operand for fixed constraints (such as "X" used in the patch). [1] https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01838.html ChangeLog entry is as follows: *** gcc/ChangeLog *** 2018-10-03 Thomas Preud'homme * lra-constraints.c (process_address_1): Bail out for all satisfied fixed constraints. Testing: Successfully bootstrapped and regtested on: - arm-linux-gnueabihf (both Arm and Thumb2 mode) - aarch64-linux-gnu - x86_64-linux-gnu - i386-linux-gnu - sparc64-linux-gnu (gcc202) - powerpc64le-linux-gnu (gcc112) Is this ok for trunk? Best regards, Thomas >From 2831d8b886d92513c2d30d43a6a989d2bbd0ceee Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 27 Sep 2018 09:50:12 +0100 Subject: [PATCH] [PATCH, LRA] Never reload fixed form constraints memory operand Hi, The unconditional reload of address operand for recognized instruction in process_address_1 prevent the patch for fixing "PR85434: Address of stack protector guard spilled to stack on ARM" proposed at [1]. The code in this patch attempt to control which registers are used to make PIC access but the reload performed by process_address_1 will use generic PIC access. This patch removes the test for the instruction to be unrecognized to do the reload, thus always avoiding to reload address operand for fixed constraints (such as "X" used in the patch). [1] https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01838.html ChangeLog entry is as follows: *** gcc/ChangeLog *** 2018-10-03 Thomas Preud'homme * lra-constraints.c (process_address_1): Bail out for all satisfied fixed constraints. Testing: Successfully bootstrapped and regtested on: - arm-linux-gnueabihf (both Arm and Thumb2 mode) - aarch64-linux-gnu - x86_64-linux-gnu - i386-linux-gnu - sparc64-linux-gnu (gcc202) - powerpc64le-linux-gnu (gcc112) Is this ok for trunk? Best regards, Thomas --- gcc/lra-constraints.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 774d1ff3aaa..c3edd9ef45d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3243,8 +3243,7 @@ process_address_1 (int nop, bool check_only_p, /* Do not attempt to decompose arbitrary addresses generated by combine for asm operands with loose constraints, e.g 'X'. */ else if (MEM_P (op) - && !(INSN_CODE (curr_insn) < 0 - && get_constraint_type (cn) == CT_FIXED_FORM + && !(get_constraint_type (cn) == CT_FIXED_FORM && constraint_satisfied_p (op, cn))) decompose_mem_address (&ad, op); else if (GET_CODE (op) == SUBREG -- 2.19.0