From patchwork Mon Jul 15 11:04:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1131933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-505089-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Nvc80Bre"; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="JiqS6NQM"; dkim-atps=neutral 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 45nLKJ6kkYz9sDB for ; Mon, 15 Jul 2019 21:05:07 +1000 (AEST) 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:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=mBF lcaSB9MTjQRMgtpRuEY6bf9pTJWK8fXFwxZJuxClcmq/yQmnxsr54jTUiSm66p// Z5Lipanxh5B6hY22+/L6hINVVooPztnnMhHJPXbr5kRUYDyYghRm0mgyElEAJZ3i 6uWgyzCJOVCR/tWrZRhNyslPuhnSZvGn5/JLmE3I= 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:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=NLyWZNP1d X241E7iycIB9q0IqhI=; b=Nvc80BreBmhbi3PiufbKRj2j4e6pQPV6806nP8GLQ dnlNPd0QOvtPaowIs+7dsoxXVE0YhHaADNi/KD448dUvanN+Koi+/e3K1kbBndBj OsnZGh2d9idM5pYvmr+QwAJ3SLeSm64Alx6CLMTBrbDkBkrKB5eO7UCz1AB2GfAk oU= Received: (qmail 34078 invoked by alias); 15 Jul 2019 11:04:59 -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 34068 invoked by uid 89); 15 Jul 2019 11:04:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SEM_URI, SEM_URIRED, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30061.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Jul 2019 11:04:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kp0ndK+MiAE8/iNddXlN/eXqqmOQEwWHVVJ09D51Id7Hik9rkoIp6lspGfaPuqLEBdEi6wsy4OY7oNNf4y5NNrRKwi2R+8y9VYbwIawQ/vlWIWSCqF8c+oF387h2o48knUU2nGbcUnosjenvB2SVpKYh2oXtOfJUUtB3Q9kDh0GtANHZctQaf6JXzhDilaHqgybIdOFmOcv33IkDlq5sSYVOiX5IFFj7YR7QvrzhCELsDCR/STMrYhr0bYTxMn6/Wlbbucj9S9d3vbj5RxGvaG5ROe8TlyM8JofIlEqo/kUR3T0KqxeCWvITdtQWoRXtcp1Xm/MU6mY4m0GfZx2HhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2UvaLyWH288B1hwfxWb9TdtufFY3rbC+oClsHgyKecM=; b=cVYDCACB2SWgKvwG4OxRZKHdBGOYZG0NSxnslfvz5qP+cSfQHNip046zAVihFyutnFz8JWvvu6wqSkRijgiGu/PItyJs0g2Y91b79ela2keERO5JGCKKkCS2YLeAWO2iaxSOn2VmYKhWqVal0SYhSlykK+ZAI4M+QvOGX3bB5+/HO7H+n3y7nsdpF2Zzydbd46GOmfTGhnNUDHq5wqKge2YXMg3D9AyzPbmaSlTBlsnGqtU6RlxpzXGl6bybIkhel90AMLSVHFxn1enL+a3V8al32yIa53ml6avasCG/fUzAhgPw2s1oQrCiwJJhNVErch4TS4+Dy6Wwzij42BOS4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2UvaLyWH288B1hwfxWb9TdtufFY3rbC+oClsHgyKecM=; b=JiqS6NQMGFI30/+7BcUMrKkZQzD/Ikulk82jspUjzRm/EWT4XaQEPeAcvRWbnKy2EyAJoPebLfUPgwFv9s/iLAbMKeuzQ90n5Sf4tH0z33yZWfRArDg5MYb0A7dk7CPDpNTmRNegAy2dMtzs4Yy0bXUW8qVuxw7gdmQVG4GPqqM= Received: from VI1PR0801MB2127.eurprd08.prod.outlook.com (10.168.62.22) by VI1PR0801MB1983.eurprd08.prod.outlook.com (10.173.72.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Mon, 15 Jul 2019 11:04:53 +0000 Received: from VI1PR0801MB2127.eurprd08.prod.outlook.com ([fe80::dcfd:3eda:5cf:aef7]) by VI1PR0801MB2127.eurprd08.prod.outlook.com ([fe80::dcfd:3eda:5cf:aef7%5]) with mapi id 15.20.2073.012; Mon, 15 Jul 2019 11:04:53 +0000 From: Wilco Dijkstra To: GCC Patches CC: nd Subject: [COMMITTED][GCC8] Backport PR85711 Date: Mon, 15 Jul 2019 11:04:53 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-oob-tlc-oobclassifiers: OLM:3513; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wilco.Dijkstra@arm.com Backport PR85711 to GCC8 to fix failing testcases. AArch64 bootstrap & regtest OK. 2019-01-23 Bin Cheng Steve Ellcey PR target/85711 * recog.c (address_operand): Return false on wrong mode for address. (constrain_operands): Check for mode with 'p' constraint. diff --git a/gcc/recog.c b/gcc/recog.c index 0a8fa2ce46cf617a2372e7996e2492d1589a3ded..28dbd09e615c19a43284d7c1414457bbbf04a3db 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1070,6 +1070,11 @@ general_operand (rtx op, machine_mode mode) int address_operand (rtx op, machine_mode mode) { + /* Wrong mode for an address expr. */ + if (GET_MODE (op) != VOIDmode + && ! SCALAR_INT_MODE_P (GET_MODE (op))) + return false; + return memory_address_p (mode, op); } @@ -2695,10 +2700,13 @@ constrain_operands (int strict, alternative_mask alternatives) /* p is used for address_operands. When we are called by gen_reload, no one will have checked that the address is strictly valid, i.e., that all pseudos requiring hard regs - have gotten them. */ - if (strict <= 0 - || (strict_memory_address_p (recog_data.operand_mode[opno], - op))) + have gotten them. We also want to make sure we have a + valid mode. */ + if ((GET_MODE (op) == VOIDmode + || SCALAR_INT_MODE_P (GET_MODE (op))) + && (strict <= 0 + || (strict_memory_address_p + (recog_data.operand_mode[opno], op)))) win = 1; break;