From patchwork Thu Jun 4 15:32:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 1303618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@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=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=1gDZ3qOE; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=1gDZ3qOE; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49d8sw4jwYz9sSf for ; Fri, 5 Jun 2020 01:32:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 917783890417; Thu, 4 Jun 2020 15:32:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) by sourceware.org (Postfix) with ESMTPS id 61E33388E817 for ; Thu, 4 Jun 2020 15:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 61E33388E817 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Alex.Coplan@arm.com 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=xNEX967g59DnGSiPFKUddh7tPfWyFJxXgbOd+UCo0AE=; b=1gDZ3qOEw6R8tPRrZAPxgadN1BeTgmYO4iz2S0NZ4B6peokOiezuPit4SQPbUIRka73d4ZxilLI47LnkkTnW3jas5338kWcVyAT/WiIBuo74f662V6xCV1iu1MYSxxHMQFPFYhIxfjK0sXJ6qikmSULdjYt3MrWW6hn70R+1cQA= Received: from AM6P192CA0095.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::36) by DB7PR08MB3724.eurprd08.prod.outlook.com (2603:10a6:10:30::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Thu, 4 Jun 2020 15:32:29 +0000 Received: from AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::16) by AM6P192CA0095.outlook.office365.com (2603:10a6:209:8d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 15:32:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT019.mail.protection.outlook.com (10.152.16.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 15:32:28 +0000 Received: ("Tessian outbound 3e82c366635e:v59"); Thu, 04 Jun 2020 15:32:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 768dcaeda289fe89 X-CR-MTA-TID: 64aa7808 Received: from 14365524d7e6.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F030532-2F89-4129-95DB-317A3F4D21B7.1; Thu, 04 Jun 2020 15:32:23 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 14365524d7e6.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Jun 2020 15:32:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TIhsU5pfLbR8Fn9KdOYXjb6WfxW7CIeL4VM9VaKOKNfZLYLBcsbrr4ZUP5wFY/I9xbKnrVO4a22sY8PTSXEOQ5687UUvajbnR9egk4DgzrnPOcoAItKUl1utgnif7KgvPrmLP18DNzCPH7KJSW5YW1Cx0l+ZU2svlQHxWT4AWa2rEnXrCKH9kYjU4k8iZmGbeenlhflZxCu4XclaGCfuc2lI2qcejzzQMgKndAl/DC9brUAKqI/fYHI3OK0R3LtlQ8rQ4R2mRcznzeFaoRCAJLOJnTfyZDhGiQod+tkEoCjTNeUVn+xNd3CIJG+5Qv6rD5i/Rskivkvof8rUaYGynA== 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=xNEX967g59DnGSiPFKUddh7tPfWyFJxXgbOd+UCo0AE=; b=nCAhz3EzkGnSr1Vh92QKWz2ttmtD99/c5mnGn3S+SlOMIzofPKNjedHSbBXM8v+Pw8QYd01E4oS2lGmLY0XGOCTaJkIUVrrZQp0bLF9IgB1LAKOl8rSo1MxOOnVAI9lGU1L2zzwgvZd+Ejeh2932RnAQ4DxKzrlxertiqW2nMHd59nftiCAaZ7OxoF+vh4t22/CgcMO1VCzOranDAO2+jGZGF/xuVjlrJx18OG9FaX4599uxf6w1C3JFZArZyw6zVCvE5mElpS4zzO5Mb5RfFsS49Yv00kLO8Qf9U9g/Qq3wS0u+VO3gZbY1p4id9c3q/E2q1b/W13KiRXQbsN2KyQ== 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=xNEX967g59DnGSiPFKUddh7tPfWyFJxXgbOd+UCo0AE=; b=1gDZ3qOEw6R8tPRrZAPxgadN1BeTgmYO4iz2S0NZ4B6peokOiezuPit4SQPbUIRka73d4ZxilLI47LnkkTnW3jas5338kWcVyAT/WiIBuo74f662V6xCV1iu1MYSxxHMQFPFYhIxfjK0sXJ6qikmSULdjYt3MrWW6hn70R+1cQA= Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB4029.eurprd08.prod.outlook.com (2603:10a6:803:ec::14) by VI1PR08MB4527.eurprd08.prod.outlook.com (2603:10a6:803:f8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Thu, 4 Jun 2020 15:32:22 +0000 Received: from VI1PR08MB4029.eurprd08.prod.outlook.com ([fe80::88b4:476f:5960:5ae4]) by VI1PR08MB4029.eurprd08.prod.outlook.com ([fe80::88b4:476f:5960:5ae4%6]) with mapi id 15.20.3066.019; Thu, 4 Jun 2020 15:32:22 +0000 Date: Thu, 4 Jun 2020 16:32:19 +0100 From: Alex Coplan To: gcc-patches@gcc.gnu.org Subject: aarch64: PR target/95526: Fix gimplification of varargs Message-ID: <20200604153218.34awo57dspk3nnj5@arm.com> Content-Disposition: inline User-Agent: NeoMutt/20171215 X-ClientProxiedBy: LO2P265CA0046.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::34) To VI1PR08MB4029.eurprd08.prod.outlook.com (2603:10a6:803:ec::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.53) by LO2P265CA0046.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20 via Frontend Transport; Thu, 4 Jun 2020 15:32:21 +0000 X-Originating-IP: [217.140.106.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1101176c-d522-46e6-97b1-08d8089c7db2 X-MS-TrafficTypeDiagnostic: VI1PR08MB4527:|DB7PR08MB3724: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vf0CgoHy61aS4AkE7zCV5enoGIpYee34FDeVLe8Xzl4WRdJntu/xk0iwPAsrgORvGPp1hzl4APV7TMW1FKdEhg67beOVA0wSKzVShphQOlMdhbM2cHsMl4wJBaoNS8S66FzFLUpqd6hqU1cKADbUPv8eTEZYw9XOoChdy4ExEhqnaBPvSfjl66Sxit8B7uGLeZoRdiVguEL643yJRUkAfU7LWhOc4vyxdHPxHFSn8ARqaGbKatwbQ+yHvv1CEZIcMxuGBVUkpElZCifKGuEAYnDWbruXhAE//5hEY3nLKWe8nn8fUfMmxW5BA+ZUNKkR1ytE8rnCd8wo7eFQputrTQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB4029.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(6916009)(83380400001)(16526019)(8676002)(36756003)(186003)(8936002)(86362001)(66476007)(8886007)(316002)(2906002)(4326008)(66556008)(7696005)(52116002)(1076003)(66946007)(26005)(2616005)(55016002)(956004)(5660300002)(478600001)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VNXyC5qIAzdOeFNpRnJl1st9np6GqyB1cLuHoKSxcYOsiFe8DrJyjXfg8tKTQsKAyR4EaklhQPX2H88zkLfV3DsBHvt+sqCggA278Cm7VpXn6AketNQ/hBmeCfdyhROUZlwCwpYvc4LhRi7GWTsNgBm3ULGNbIdavje6+w/95f8iLa8I0FRTVKkDmqw4/VajZyAih6Fqz819oqnK7yrJQAlbgtiUVjTF4BExrPS/4prcqrFVnPGpsge7AIAHQOlo5p5KF6fNm8WpJnESvlylMLW3wIusv0CKFPuGwHMih1lTp1FPxJoD/YPZyoDwZJv3kHmATkLIgQt+blr0pyemQjRMJJ1ggbSHyh9C5uH1DhwrojI6mYfodvRm8loN0Dof9cGQDoVl3qES4nNIpHFtCWww7BaC6TdeafVn/J7J0uUrqmFVAa2eoLCLesEb4UaavRbfTDIAEXRf1yvZnF3B2gfemHJEyKmSJBoKmSPJOnbe2IgDjMwgwT/4dHJ2W1Ve X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4527 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(46966005)(8676002)(336012)(55016002)(86362001)(36756003)(82310400002)(26005)(47076004)(356005)(186003)(1076003)(316002)(16526019)(7696005)(5660300002)(82740400003)(70586007)(956004)(478600001)(83380400001)(2906002)(44832011)(81166007)(8886007)(36906005)(8936002)(70206006)(2616005)(4326008)(6916009); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 564dc0a8-56bc-4b3e-13d8-08d8089c796f X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h+05F3iGs/MWTrjE/deaydFDF6KZaaACAHbPHxXlriZXpfG4S/mks46EzyWgXzva3PaQO+uPXQd3SMApOIhWogGxlNIOqqKhqZ9rFapP3uSD7+r6bHx9vwEmN1rr4GimIxOc6JmPvnr7T8ieDrSfr4DxFXmm9n9wWFrHPIUq4TYzLHS5lhbpxYIpyBZVM83bUtygKCRK71ro4DWEdhChmlhrhgwGk1hka237e4gaYqmwYjEgGoXCqKJGTXIFd7vaIrZAydU/8bZvqY0hf+HN2uBF3652zkx9KTGXyQqlYZ2pQK9AGtsqYUjmyriW/+PrM5Vopx/Wx3LkN9NgexSOae84bzIokCZhqmQmieQ+u+ng+AtCB6p9pVbeV1HYQ+AstuM+wmbkAPGeQ4Q1TzG2eA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 15:32:28.8892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1101176c-d522-46e6-97b1-08d8089c7db2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3724 X-Spam-Status: No, score=-18.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard.earnshaw@arm.com, marcus.shawcroft@arm.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This patch fixes a latent bug exposed by eb72dc663e9070b281be83a80f6f838a3a878822 in the aarch64 backend that was causing wrong codegen and several testsuite failures. See the discussion on the bug for details. Bootstrapped and regtested on aarch64-linux-gnu. Cleaned up several failing tests and no new fails introduced: +PASS: gcc.dg/compat/scalar-by-value-3 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/compat/scalar-by-value-4 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/compat/scalar-by-value-5 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/compat/scalar-by-value-6 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/compat/scalar-return-3 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/compat/scalar-return-4 c_compat_x_tst.o-c_compat_y_tst.o execute +PASS: gcc.dg/complex-1.c execution test +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -O0 +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -O1 +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -O2 +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -O3 -g +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -Og -g +PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution, -Os Pre-approved on bugzilla: committing to master. Thanks, Alex --- 2020-06-04 Richard Biener gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr): Ensure that tmp_ha is marked TREE_ADDRESSABLE. --- diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 6352d4f..97da607 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -16370,6 +16370,7 @@ aarch64_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, } /* *(field_ptr_t)&ha = *((field_ptr_t)vr_saved_area */ + TREE_ADDRESSABLE (tmp_ha) = 1; tmp_ha = build1 (ADDR_EXPR, field_ptr_t, tmp_ha); addr = t; t = fold_convert (field_ptr_t, addr);