Message ID | AS8PR08MB66781F579B4CE1794C246CB3F4BA9@AS8PR08MB6678.eurprd08.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B17723841894 for <patchwork@sourceware.org>; Thu, 30 Jun 2022 16:04:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B17723841894 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656605065; bh=ml3/2HPtW/VGgkUqPNSrqhbM5n5s2V3TyMIAoHT1Zrc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=K/pFqIbLg0TSvimHXGLLtgvZYiwXymOhLBhT68F+BaF+Q2rYXEegYzrJhVz/2xcbP rgjANgncoCZnEwGT4LrrFAoH5xG5pkvIN1pZTCNJeRObPDMtrc4ztSf7q/LeMVzcWn fx/oGvq+HQc7UUT+e0R0ynGzFNGDFDeEaTdmaEHU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2085.outbound.protection.outlook.com [40.107.104.85]) by sourceware.org (Postfix) with ESMTPS id B3D8D38460AE for <gcc-patches@gcc.gnu.org>; Thu, 30 Jun 2022 16:03:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B3D8D38460AE ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=QUjAfXaZDpmyRJ8WAYGUqlxP+2L90nwFSI7mJutbZv5M44kfY6vKpm8eJF6a0elKIW8C3a8C5cRtwfkUwjrIHvYZmM5NXMg36pOyKMIEyTnO4QsTs6w398bpYh2OEO6ew3cjaLVyf75onSoKeevsTopTHt8rY1pv5YDZTybmnXaC4v3t667L8bEJqmtjA0DZwRGL+91Szim6CZGmi/LsT7KNB+BBMGHIH6feHzFjgWR7pdmNbsIR3fVVw8Tamo5PO2SmPagCprjPWo1d7sgawazVjDUqX0HjL6zRi+SqojCavLmobXDSZILo+f/LsBNrxHnDcrNbi6KXoLGSnNVqwQ== ARC-Message-Signature: i=2; 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=ml3/2HPtW/VGgkUqPNSrqhbM5n5s2V3TyMIAoHT1Zrc=; b=d/J5x5Ib97vWJ1lSa+oxigIQcMSYbJAAbg2iNSvokcR8DjIKtSSb2FsxQDZy2EzvRQDS3THCBOJhT51OYkwsKlY4WW93O6m2a0CGHvJBGE3B4gXgsPqDle6b7yA9ZjHg6RRFfbkNUmvUodVTsIbqAjF48eDfYf1PvjUWMnCoIVLIC7KbfnKtiHbq96YDjLHd09XvApavRyBx5Gqz1kVbiygGd+LAEYfW4DE60InkDnI0y0KRGzyVRp9vVtnBL2EXjs44XixgHgc3BeUMzz3p2VD1dj5WVfiIYbt/zkU+djQPl1Xe2Ws8zxJcyFPJjhQBsTid8xaSDFr9oIc43LO9Jw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from DU2PR04CA0196.eurprd04.prod.outlook.com (2603:10a6:10:28d::21) by DB7PR08MB3337.eurprd08.prod.outlook.com (2603:10a6:5:26::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16; Thu, 30 Jun 2022 16:03:50 +0000 Received: from DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28d:cafe::ef) by DU2PR04CA0196.outlook.office365.com (2603:10a6:10:28d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Thu, 30 Jun 2022 16:03:50 +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 DBAEUR03FT039.mail.protection.outlook.com (100.127.142.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Thu, 30 Jun 2022 16:03:50 +0000 Received: ("Tessian outbound 514db98d9a19:v121"); Thu, 30 Jun 2022 16:03:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 44932e7cdca40fd0 X-CR-MTA-TID: 64aa7808 Received: from c16d68f32178.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F676DD3D-1A09-4CD3-8B72-868FCF6DFB74.1; Thu, 30 Jun 2022 16:03:43 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c16d68f32178.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 30 Jun 2022 16:03:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQ0zA7zZSHoPor84TniflxuJ2fc3PUjgWXkWaniUrXPczykk9WT0t2l49F9Wwge1qzVT00Z/HkRkgxq2nrCbOhP/gwZDN6c1etptFcL8QRuRFsznT+um3rYV59eZkSedc5gORUOa+DjV1knGyE6T00J9yVqd0PYYyvjiLS73bNDLcz7b9SKFXevK0ZFbGRXVfaRG0d8hXUze3wcr+7q9TaCPfcfXHPJZMbbBTbN4X2gfkP43pUanVUDNp2L2/aS0osfydEUlFp8qwo+BSsogAKX3qxzYAZrSYehqBAxNU+cDBptozVYlrLkotNxTD/acR3PxhpaW4ZiUzYMW2X/5vw== 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=ml3/2HPtW/VGgkUqPNSrqhbM5n5s2V3TyMIAoHT1Zrc=; b=lgeuDtBcur31E4sVh+fWHbziUaq2MMuI0v49yzR/bM4OwkLXw7DGVmBvCZsyUDQwTStV6n47EYTTs1j4xJZUYolgZUQgKiHKBJjD93xtECiJaIVPeMkFPel/Bh8G5hnpZ0u85FVKF88o+VIw6HoQYCSJu1PmRxmxiZbkXz9YQBmXhpJrRSe9yFQJJry75LiuwSijTh0GCI/WL3dI6ogOx16EmpxGTsNtalbKTnA+53TyKaACyu/GdFeQr4Cz4HSyxsgDCz21H9p80WCArz66MAngqnZvBLVCMAnZERxDA95tZ30dQ/fweAK0PoinbKmEOgbbsE5JtiEMkTY17A1O1Q== 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 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by AM0PR08MB4178.eurprd08.prod.outlook.com (2603:10a6:208:133::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Thu, 30 Jun 2022 16:03:34 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::90e1:2317:2ab:bd1e]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::90e1:2317:2ab:bd1e%8]) with mapi id 15.20.5395.014; Thu, 30 Jun 2022 16:03:34 +0000 To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> Subject: [PATCH] aarch64: Fix pure/const function attributes for intrinsics Thread-Topic: [PATCH] aarch64: Fix pure/const function attributes for intrinsics Thread-Index: AQHYjJrDxPed3V6PXEqq8pmz6sh+2A== Date: Thu, 30 Jun 2022 16:03:34 +0000 Message-ID: <AS8PR08MB66781F579B4CE1794C246CB3F4BA9@AS8PR08MB6678.eurprd08.prod.outlook.com> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 02c05d92-8eed-ab8b-3515-798d2a09d24c Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 676a3f81-69c0-4ea5-df9a-08da5ab21f48 x-ms-traffictypediagnostic: AM0PR08MB4178:EE_|DBAEUR03FT039:EE_|DB7PR08MB3337:EE_ 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: 61I1iX3X3ykwGB2whDm0FDKf5393N/31kbLcAZupyiMzkuNmwAvckwcvBD/IGlyGxzHfBTASpRCJ+iKgd2Ei8UemYpd3PA9yczKr4pN9P5GKQ/VGqTzCrdXYv23jqys5PNIyVe7yMVwPocGH3sdK6VWlj5Ay8jCI9dutK4kLDWJfoAfQhph4YAPGeoA458KosoeEr/11zIC7V0XCdiTZtV0phTdgHhxZNYCExy1UoO9TaamsVHFo+rZbDLGcd1/4NEDEwmMylv7hROzjOvrAVT/iP5zBnEuTG9+TtnqeQSYR93dL85lTCVDHikDzzZZD5JdkGsbAqVNkslSnRhHrP3y3mmiv+8b0Gsf8abBEesiuYflZKtL5gxREq2vE9Tawx3JOY77IJjRJM/R2G1gb3sB+g/XEjEUgcZcj0gvhl6h1qk0teWRtAgm+ZSma3d2S4CYND1+ppDY0waeIytGDk/xZTR0fhQ71ql0p1A5C79Uv5gVY9tLr4KccYgXQ6kYEhdDTJ5EGvzC4Cm8NlfONffW2MptL+rH5oXVxHT/q6lTF1hfoaCPjbMdNfs8l4jNM8Ve9Fxj0/ltHqN8bQbYzD13uukbG1ibdLNzg/6O7JbTeFq4RS8ceYuv/Bzw+u4hdTfmZGxcodVMinUKx7zTGNGZDz+llV1Ma80/QVxJfSRwZQ7hJysu9PLNVtjpNq9/SN5lZcLTwrU4DS9RK4tdMCqxxKuMJa4fHPnd15+rG/hsI2gofPzjoENGnaHjinV4dT4q9zKTyFWo/SDJxiYBWhG93XGvODzoof3wTkvM9TwTYoimOtbSNTYKjgJgmjs7O X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(376002)(346002)(366004)(136003)(38070700005)(122000001)(26005)(66946007)(6506007)(7696005)(5660300002)(66476007)(38100700002)(9686003)(76116006)(64756008)(66556008)(8676002)(33656002)(86362001)(55016003)(8936002)(316002)(66446008)(2906002)(186003)(4744005)(52536014)(6916009)(71200400001)(478600001)(91956017)(41300700001); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4178 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: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 72e55aa7-3936-4000-f53d-08da5ab21617 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5v+VD6QHHO2UI0JZkQAPyu4wHOBuDTQPysGwFyIoFgxqCmzNDqZ9Ic17zLv3AiupZpeSaag+FObdJc4a+A2AGzAPZI3aUJSmmvbaRGoU7mgHXow+Gz7nMvgkK4doO1joqs9Dpr1szF6ruBxwR3qpX/F7vGtMDwXXT8EM+0EKtuaWceJsl6JD0MeFxS4u0ruckUvyGSV84YS5a4EwFliBkeZt2adNvfdpd/zaNasQMa7EKd2f8wMgQZrTwxa97L2zvFGAgeqaxoeQ6/ZouUU2q7KhDySlH2oNP+d6vh8hfcihPQSwjkwfnbKk9EjL4FIAfU6wzXSq41sTodh1Xcuxp1cmRYlmKIlcXwktr1+SsJsKiK+zMGVFPj8wEOciUwzZItiYhodsXiooOkUeltWTsi5r7qyvnxYpJDa5rNktsc8dc+b1KwPJ82So4tWvwv5jQkkifgwE2PznHX4fEiH10MwdLeZGIZ+iUAngCH8/MkLtnk02MOlBF+5viKBUpjDMs081IAGxEH8ACBdhnDTEOpBMRT9/u3VJo/XSnxaXUeTH6sIHS7B/YqnWGbLFXatMjxIPKTUUUm+4QwzKalFJKHNDYidR2Kl35GKCKlag7mwYeUe+wFLuHuo4KUeGEvmN3Ust+yghlMwRe5vtitdLssIpX9Q105tNDi8+290vOtP9QLK5ORU+XByh7hpvGrKzOIGcUOaEqGzGu8wKtFwtc0rxQJw3l9Ui887sJ74v38n+Xx4IQnhMSuNokSfCCGB8obQwtpfS63vdDjKkOOgfD10F77OHNqx29OSza77NJ8maMFV5y8+vr+HQkHIKxSHa 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:(13230016)(4636009)(39860400002)(136003)(396003)(376002)(346002)(36840700001)(40470700004)(46966006)(26005)(336012)(40460700003)(82740400003)(9686003)(81166007)(86362001)(47076005)(356005)(186003)(4744005)(6506007)(52536014)(8936002)(41300700001)(7696005)(5660300002)(6916009)(36860700001)(478600001)(2906002)(316002)(8676002)(55016003)(40480700001)(33656002)(70586007)(82310400005)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 16:03:50.1738 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 676a3f81-69c0-4ea5-df9a-08da5ab21f48 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: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3337 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Andrew Carlotti via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Andrew Carlotti <Andrew.Carlotti@arm.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
aarch64: Fix pure/const function attributes for intrinsics
|
|
Commit Message
Andrew Carlotti
June 30, 2022, 4:03 p.m. UTC
No testcase for this, since I haven't found a way to turn the incorrect attribute into incorrect codegen. Bootstrapped and tested on aarch64-none-linux gnu. gcc/ * config/aarch64/aarch64-builtins.c (aarch64_get_attributes): Fix choice of pure/const attributes. ---
Comments
On Thu, Jun 30, 2022 at 6:04 PM Andrew Carlotti via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > No testcase for this, since I haven't found a way to turn the incorrect > attribute into incorrect codegen. > > Bootstrapped and tested on aarch64-none-linux gnu. > > gcc/ > > * config/aarch64/aarch64-builtins.c > (aarch64_get_attributes): Fix choice of pure/const attributes. > > --- > > diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc > index e0a741ac663188713e21f457affa57217d074783..877f54aab787862794413259cd36ca0fb7bd49c5 100644 > --- a/gcc/config/aarch64/aarch64-builtins.cc > +++ b/gcc/config/aarch64/aarch64-builtins.cc > @@ -1085,9 +1085,9 @@ aarch64_get_attributes (unsigned int f, machine_mode mode) > if (!aarch64_modifies_global_state_p (f, mode)) > { > if (aarch64_reads_global_state_p (f, mode)) > - attrs = aarch64_add_attribute ("pure", attrs); > - else > attrs = aarch64_add_attribute ("const", attrs); > + else > + attrs = aarch64_add_attribute ("pure", attrs); that looks backwards. 'pure' allows read of global memory while 'const' does not. Is aarch64_reads_global_state_p really backwards? > } > > if (!flag_non_call_exceptions || !aarch64_could_trap_p (f, mode))
On Fri, Jul 01, 2022 at 08:42:15AM +0200, Richard Biener wrote: > On Thu, Jun 30, 2022 at 6:04 PM Andrew Carlotti via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc > > index e0a741ac663188713e21f457affa57217d074783..877f54aab787862794413259cd36ca0fb7bd49c5 100644 > > --- a/gcc/config/aarch64/aarch64-builtins.cc > > +++ b/gcc/config/aarch64/aarch64-builtins.cc > > @@ -1085,9 +1085,9 @@ aarch64_get_attributes (unsigned int f, machine_mode mode) > > if (!aarch64_modifies_global_state_p (f, mode)) > > { > > if (aarch64_reads_global_state_p (f, mode)) > > - attrs = aarch64_add_attribute ("pure", attrs); > > - else > > attrs = aarch64_add_attribute ("const", attrs); > > + else > > + attrs = aarch64_add_attribute ("pure", attrs); > > that looks backwards. 'pure' allows read of global memory while > 'const' does not. Is > aarch64_reads_global_state_p really backwards? Oh - the thing that's backwards is my understanding of what "pure" and "const" mean. Their meanings as GCC function attributes seem to be approximately the opposite way round to their meanings in general usage.
On Fri, Jul 1, 2022 at 5:59 PM Andrew Carlotti <andrew.carlotti@arm.com> wrote: > > On Fri, Jul 01, 2022 at 08:42:15AM +0200, Richard Biener wrote: > > On Thu, Jun 30, 2022 at 6:04 PM Andrew Carlotti via Gcc-patches > > <gcc-patches@gcc.gnu.org> wrote: > > > diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc > > > index e0a741ac663188713e21f457affa57217d074783..877f54aab787862794413259cd36ca0fb7bd49c5 100644 > > > --- a/gcc/config/aarch64/aarch64-builtins.cc > > > +++ b/gcc/config/aarch64/aarch64-builtins.cc > > > @@ -1085,9 +1085,9 @@ aarch64_get_attributes (unsigned int f, machine_mode mode) > > > if (!aarch64_modifies_global_state_p (f, mode)) > > > { > > > if (aarch64_reads_global_state_p (f, mode)) > > > - attrs = aarch64_add_attribute ("pure", attrs); > > > - else > > > attrs = aarch64_add_attribute ("const", attrs); > > > + else > > > + attrs = aarch64_add_attribute ("pure", attrs); > > > > that looks backwards. 'pure' allows read of global memory while > > 'const' does not. Is > > aarch64_reads_global_state_p really backwards? > > Oh - the thing that's backwards is my understanding of what "pure" and > "const" mean. Their meanings as GCC function attributes seem to be > approximately the opposite way round to their meanings in general usage. I bet GCCs reading is older ;) Richard.
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index e0a741ac663188713e21f457affa57217d074783..877f54aab787862794413259cd36ca0fb7bd49c5 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -1085,9 +1085,9 @@ aarch64_get_attributes (unsigned int f, machine_mode mode) if (!aarch64_modifies_global_state_p (f, mode)) { if (aarch64_reads_global_state_p (f, mode)) - attrs = aarch64_add_attribute ("pure", attrs); - else attrs = aarch64_add_attribute ("const", attrs); + else + attrs = aarch64_add_attribute ("pure", attrs); } if (!flag_non_call_exceptions || !aarch64_could_trap_p (f, mode))