From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2042.outbound.protection.outlook.com [40.107.14.42]) by sourceware.org (Postfix) with ESMTPS id 26F4E3858C66 for ; Thu, 12 Jan 2023 13:38:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26F4E3858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=udPMweaO9QojTCEnj0ClhAACRxyy3SEPqDS+C9yGGKg=; b=3Jru9LbVj1SxqI0bIg6NJ+g3JRDHx5zd402zm2V4ZedpYhCbhkZ2E2vQEwODNVyA6AVt+oaSlQizKWsfbi05IZh0ZP3hqRLTuYJMJiOOVdMjOPIlGGLpOCcMaXckTAGFNZsVvoKF1sp8uhQm13BjoSSanRd7euXtJWHLEX7v5Ak= Received: from DB6P191CA0017.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::27) by DU2PR08MB10230.eurprd08.prod.outlook.com (2603:10a6:10:46e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Thu, 12 Jan 2023 13:38:51 +0000 Received: from DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::3a) by DB6P191CA0017.outlook.office365.com (2603:10a6:6:28::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 12 Jan 2023 13:38:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass 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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT022.mail.protection.outlook.com (100.127.142.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Thu, 12 Jan 2023 13:38:51 +0000 Received: ("Tessian outbound 0d7b2ab0f13d:v132"); Thu, 12 Jan 2023 13:38:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7d0def52df36d141 X-CR-MTA-TID: 64aa7808 Received: from a38ca8e51472.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 86D8434C-5DBF-492E-9278-BA99DB62D93B.1; Thu, 12 Jan 2023 13:38:45 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a38ca8e51472.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 12 Jan 2023 13:38:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbzsmGHNA6z5j4O6cZVBh/s0ndcrOy2EDsiNyHrkAcH+nFlnMLXnXq2p9aKamXxQV0sNt/5csMviQEBkkeoauf6qdDQ7mXSGzWZNXyzXlH+so5yR2WRU89r7C4EouzQAZ2o54mYvP3VgBNbHC1RPrgU+HRdlBqz1if6G8WVtLst1viCDFGi2yo6dST7QwuT6das1jx9Iqdh7aczyDdj3VYBmXO77sS+mUPS+gpzIB3I8fPNes78aj4lscoalmh03wXAD+QUx2lYeBpfYSbhwypNO2iJLdCuCaikAr+hQYTW6VGFBY/faE16vEvyKzV7gfdAYiO0psvROoK6Gd44smg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=udPMweaO9QojTCEnj0ClhAACRxyy3SEPqDS+C9yGGKg=; b=GdPc5lg8yhF0gCiYSrIVWqSGfUInBSa6EnsLAATkHUQtqpTPF3zxtE3ndwVNcq3rWY/I0Z3/JlO3uQSGviZWDmze4xrrEXouOoLeRH3KqlHBypqzTPikUgdaYMQLK7v2m6E+aEPlOxriwXgQMr3//49s8LLkdFfJQTJB5oO6xw9nZDNxOhPt7EJZj7kQBE7bAztVtMuo2+HohQCYtLjzX+MnaYovpRaueVLDgqv44KnGAzELIIDlcIWa2GQZC2piBxs/YdqltWVWYRnPogrMfT9HPUtDsd5SGxE368y6anjUT9BUkpTXBG0zB2e5E2v5l8Bj9j0nmpCDsZ3Ig8o4fA== 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=udPMweaO9QojTCEnj0ClhAACRxyy3SEPqDS+C9yGGKg=; b=3Jru9LbVj1SxqI0bIg6NJ+g3JRDHx5zd402zm2V4ZedpYhCbhkZ2E2vQEwODNVyA6AVt+oaSlQizKWsfbi05IZh0ZP3hqRLTuYJMJiOOVdMjOPIlGGLpOCcMaXckTAGFNZsVvoKF1sp8uhQm13BjoSSanRd7euXtJWHLEX7v5Ak= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) by PAXPR08MB7366.eurprd08.prod.outlook.com (2603:10a6:102:227::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Thu, 12 Jan 2023 13:38:43 +0000 Received: from VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::d034:a319:3a2a:7897]) by VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::d034:a319:3a2a:7897%6]) with mapi id 15.20.5986.018; Thu, 12 Jan 2023 13:38:42 +0000 Message-ID: Date: Thu, 12 Jan 2023 14:38:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 2/2] aarch64: Fix bit-field alignment in param passing [PR105549] To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: <20230111141806.258233-1-christophe.lyon@arm.com> <20230111141806.258233-2-christophe.lyon@arm.com> Content-Language: en-US From: Christophe Lyon In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0409.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::13) To VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3390:EE_|PAXPR08MB7366:EE_|DBAEUR03FT022:EE_|DU2PR08MB10230:EE_ X-MS-Office365-Filtering-Correlation-Id: 741429a6-9c6c-434b-9147-08daf4a257a2 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: I0uuBTlb/TSqFh4qzNzbLib8ZCNnVBJdmxNWpym6HQ0NjQlPTRqFIoaIGhjnpJRfzvziI705XctSQqOMrfxflsNSGeJGEIvBH92DNLI6vGomu9262ckRPkToPndgZWIgRAt7g48JGS5RUALbbd94O2RB8NUp4BkxUHsQWgEa89dsTA9LEjL/0JIQ1eNfm8pK4GnsxWUSFGd6UOlHAp6JJmslaGa0bQkMQjKKZIXKlsyDAsedrQgMjypuVwTQqxCLSCppMU/bTxRECu+8chqaFEr7vXkFy0XU4VGPWUUxT8pgfbvPsMrDm+Q53RcDm4YlZE6OwpMzvFFFXfKzTFfLWvmixkiGv+iQwPBX6x8tkpgV3zGkK0tA21MdzcXs/VniY6mJUMyh57bfP/tYYLI9UGoQj4WJ2L2f1gTlUpm8m7vTdN7bwqhnvbKFOfxnIH/34hqgR5BXXaWu0sxW4ida0GQgerkjNr40mIj4TsKZtmeBE4WDl6STXf1NRWth6jtTc9+aQsLMyvKenRHbgSpcqWAzwjvgY1rMuDmVn4LekB3U4mJe0T+wazKjHXavEAiz4CIYqsu3xpdZQxqtsr+n8HzbOrG+F17RSy+lcz24UB9X3Wusr5E+7PX22wZBjxn4ylPPWFC4489UDqF5MrwbZqN2ztS+lC9JVb/RI6UoxQNUPSEfySfVDNjccjZj+do+sGK4wTcfXeTVm90Xraw9UL5qLBxnovUr1Zuz+YGT/GrrpZaKByhmju4asX2SSLg5MQoPpjdL2pIemrXXltbumXo0XnBspGzKRsvyP1QNcIA= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3390.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(366004)(376002)(346002)(39860400002)(451199015)(38100700002)(86362001)(6636002)(31696002)(66476007)(66946007)(66556008)(8676002)(41300700001)(8936002)(44832011)(2906002)(316002)(5660300002)(6512007)(2616005)(4001150100001)(83380400001)(6486002)(186003)(53546011)(19627235002)(6506007)(26005)(84970400001)(478600001)(36756003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7366 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9a4bd2b7-2462-465a-1d62-08daf4a251a8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PyUmwpX0HNFLA9HFs+T14d4sMGh9EuGtMx2uvStBO0lnAWEfYfCuA3nakPj9tW6XxwcIAvhOdVL0dzjVwq5JFJDXgeYPDBQJbz+XZi9Unf7Y641nDHaCz3CJq2SrP+TLsG0OvdpYcwIKjJ0CmCYl011UrOIS7ehEbD4goSaiK5IICP1pM86tE19x/NJkIBLqZv/Isbhyo/QQMrmri73Pq82os/CmEatcX22IlT61SH2ydvuWjYR2gHllc/+pxAXrZLid1FSPikMkif1mTMJQ9jk7PVRG/AHOqmka41wgptoVf9HAPvHn7LfiLwE+ejPuYsEWsR+f5T5Qb8+neLdSQEyODECAO8CwA40elWlwtTntez34JfyL5Ur5QMpvCbO27SKDCyoFHzoC1uwHGlwQK4EL5NMpwaLBvRuE7esTuyZfrfHW6j+IHIPGjk/mBxTugZ7PcabiecU8GLy6+0Ia+QOfN8r/yAJLdRCeXKmLZeslRD79v8vBNSemovpxlTMVG17qHXAjGqDIA6bSKVlBsy2PmNVTE1oZ49Ev3uD1JzLjS0pSV08NsbQFZBFtHxqoQL16QoFkG6RvO8fZiwAPJSpKcavV7dXWqcSfoccTJwTjy9dOwz5kYOJzFhmqWBZR7/OILEGibloySgf/HMLi75AM6Nj4+ssR8X2nSEfGMJVtKLu95GYhYnSA0gKP5lloSu2z4vmT5oft4ibOF+oi7sZwOaq/jwpw7DUmrlkRiQkjxSr/ojGjrs1aJPiD7Wxb6L2jjQqPKARNhXj7ibnlv+zIn8r2ioXUyCl/U/dZ8IDtNbAGvX0g0onB236mLF6w 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;SFS:(13230022)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199015)(46966006)(36840700001)(40470700004)(82740400003)(8936002)(36860700001)(26005)(478600001)(6512007)(82310400005)(6486002)(186003)(19627235002)(4001150100001)(44832011)(70206006)(6636002)(40460700003)(2906002)(2616005)(316002)(40480700001)(5660300002)(336012)(70586007)(8676002)(36756003)(356005)(81166007)(31686004)(84970400001)(6506007)(86362001)(41300700001)(47076005)(53546011)(31696002)(83380400001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2023 13:38:51.8341 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 741429a6-9c6c-434b-9147-08daf4a257a2 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-AuthSource: DBAEUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10230 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/12/23 14:19, Richard Sandiford wrote: > Christophe Lyon writes: >> While working on enabling DFP for AArch64, I noticed new failures in >> gcc.dg/compat/struct-layout-1.exp (t028) which were not actually >> caused by DFP types handling. These tests are generated during 'make >> check' and enabling DFP made generation different (not sure if new >> non-DFP tests are generated, or if existing ones are generated >> differently, the tests in question are huge and difficult to compare). >> >> Anyway, I reduced the problem to what I attach at the end of the new >> gcc.target/aarch64/aapcs64/va_arg-17.c test and rewrote it in the same >> scheme as other va_arg* AArch64 tests. Richard Sandiford further >> reduced this to a non-vararg function, added as a second testcase. >> >> This is a tough case mixing bit-fields and alignment, where >> aarch64_function_arg_alignment did not follow what its descriptive >> comment says: we want to use the natural alignment of the bit-field >> type only if the user didn't reduce the alignment for the bit-field >> itself. >> >> The patch also adds a comment and assert that would help someone who >> has to look at this area again. >> >> The fix would be very small, except that this introduces a new ABI >> break, and we have to warn about that. Since this actually fixes a >> problem introduced in GCC 9.1, we keep the old computation to detect >> when we now behave differently. >> >> This patch adds two new tests (va_arg-17.c and >> pr105549.c). va_arg-17.c contains the reduced offending testcase from >> struct-layout-1.exp for reference. We update some tests introduced by >> the previous patch, where parameters with bit-fields and packed >> attribute now emit a different warning. >> >> v2->v3: testcase update >> >> 2022-11-28 Christophe Lyon >> Richard Sandiford >> >> gcc/ >> PR target/105549 >> * config/aarch64/aarch64.cc (aarch64_function_arg_alignment): >> Check DECL_PACKED for bitfield. >> (aarch64_layout_arg): Warn when parameter passing ABI changes. >> (aarch64_function_arg_boundary): Do not warn here. >> (aarch64_gimplify_va_arg_expr): Warn when parameter passing ABI >> changes. >> >> gcc/testsuite/ >> PR target/105549 >> * gcc.target/aarch64/bitfield-abi-warning-align16-O2.c: Update. >> * gcc.target/aarch64/bitfield-abi-warning-align16-O2-extra.c: Update. >> * gcc.target/aarch64/bitfield-abi-warning-align32-O2.c: Update. >> * gcc.target/aarch64/bitfield-abi-warning-align32-O2-extra.c: Update. >> * gcc.target/aarch64/aapcs64/va_arg-17.c: New test. >> * gcc.target/aarch64/pr105549.c: New test. >> * g++.target/aarch64/bitfield-abi-warning-align16-O2.C: Update. >> * g++.target/aarch64/bitfield-abi-warning-align16-O2-extra.C: Update. >> * g++.target/aarch64/bitfield-abi-warning-align32-O2.C: Update. >> * g++.target/aarch64/bitfield-abi-warning-align32-O2-extra.C: Update. >> --- >> gcc/config/aarch64/aarch64.cc | 148 ++++++++++++++---- >> .../bitfield-abi-warning-align16-O2-extra.C | 64 ++++---- >> .../aarch64/bitfield-abi-warning-align16-O2.C | 48 +++--- >> .../bitfield-abi-warning-align32-O2-extra.C | 131 +++++++--------- >> .../aarch64/bitfield-abi-warning-align32-O2.C | 132 ++++++++-------- >> .../gcc.target/aarch64/aapcs64/va_arg-17.c | 105 +++++++++++++ >> .../bitfield-abi-warning-align16-O2-extra.c | 64 ++++---- >> .../aarch64/bitfield-abi-warning-align16-O2.c | 48 +++--- >> .../bitfield-abi-warning-align32-O2-extra.c | 131 +++++++--------- >> .../aarch64/bitfield-abi-warning-align32-O2.c | 132 ++++++++-------- >> gcc/testsuite/gcc.target/aarch64/pr105549.c | 12 ++ >> 11 files changed, 587 insertions(+), 428 deletions(-) >> create mode 100644 gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c >> create mode 100644 gcc/testsuite/gcc.target/aarch64/pr105549.c >> [...] >> @@ -68,14 +62,14 @@ >> /* { dg-note {parameter passing for argument of type 'S4' changed in GCC 9.1} "" { target *-*-* } 103 } f4_stdarg */ >> /* { dg-note {parameter passing for argument of type 'S8' changed in GCC 9.1} "" { target *-*-* } 104 } f8_stdarg */ >> >> -/* Parameter passing for these should not have changed in GCC 9.1 (PR 105549). >> +/* FIXME Parameter passing for these should not have changed in GCC 9.1 (PR 105549). >> Fortunately we warn. Note the discrepancy with lines 120-124 below: we warn >> in the callee, but not in the caller. */ > > Looks like a stray change. Same for the C test. Ha yes, thanks for catching this! > > OK otherwise, thanks. > > Richard