From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2048.outbound.protection.outlook.com [40.107.21.48]) by sourceware.org (Postfix) with ESMTPS id CF1CB397241F for ; Thu, 3 Dec 2020 23:00:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CF1CB397241F Received: from DBBPR09CA0017.eurprd09.prod.outlook.com (2603:10a6:10:c0::29) by DBBPR08MB4872.eurprd08.prod.outlook.com (2603:10a6:10:d9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21; Thu, 3 Dec 2020 23:00:47 +0000 Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:c0:cafe::aa) by DBBPR09CA0017.outlook.office365.com (2603:10a6:10:c0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 23:00:47 +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=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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT022.mail.protection.outlook.com (10.152.20.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 23:00:47 +0000 Received: ("Tessian outbound 39646a0fd094:v71"); Thu, 03 Dec 2020 23:00:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c91174a2d8dfac4a X-CR-MTA-TID: 64aa7808 Received: from cce2985e9e6c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 936184AE-B96A-4ED6-93C5-FA6D8E72479F.1; Thu, 03 Dec 2020 23:00:31 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cce2985e9e6c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 03 Dec 2020 23:00:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KqHpLKYomsnXjrQLPQnQgnhdDXIRKQC3WtohiJCuks7pY5Qv3wqKe2+eiN9fPMRqkTZTh8zjG060AuEraZN8/PaGnn4s1QerCUtkGBuqzu62FgxsmsOudHwsYzZvG8fP58WOCai6Aawj8ia8JirEND+06xU4eSdxU+4HmHmA4A86b5p3CERNJj0rPhKg4UEdgiqBR9lJ4qL79hG3GgUYGoDD13dEhGEMgsGmYorsZ+yu4DonLdXWYMq2dIV0hv5HJdYS5e7D8DT1+gPgrKBxtNiaJ90R6dfqW/ZEO1Nt+3TC7hZl5c61b7IgLiCo+D7juVoWNQvPrzPM446wm1Himw== 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=Rri/zkhrBVpX4KN7xsAXoU29iKLcxf+c6hmh6Cxn9Q4=; b=dX6PpZ5yggU7VuoJWPIsDzD++6vE2oPVbdOPup9Vqp/zMu9nLsiK2SZmnq2NEU497xz5jaZenxRLtat887khkRwCJhAdZOIrVx6/0MsDnNB7xlpICsB7RaW/+9CPEmSpA5CA+gNfg7s+56Pq/5YKFPNYxHp9qGQv7HnUJVF4WdBUVYVS7zRA2zjF8OZSH3rOVp8udVytDwDgD7j8o9KQyI/H+WtKl/c8SzkeD23rW0j9q/Lzl7xcJMPc58OvNr9tYkQAekl8xtSagM1F/F956JtqDnpHNFWN33wnMUQg4MM/8V9Hr5tjt+Tc0kOkY1pNIbDLYMVkDnCMbZNEEnoffA== 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 Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB4900.eurprd08.prod.outlook.com (2603:10a6:20b:cc::10) by AM5PR0801MB1634.eurprd08.prod.outlook.com (2603:10a6:203:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Thu, 3 Dec 2020 23:00:30 +0000 Received: from AM6PR08MB4900.eurprd08.prod.outlook.com ([fe80::5805:be9:d66d:7b65]) by AM6PR08MB4900.eurprd08.prod.outlook.com ([fe80::5805:be9:d66d:7b65%7]) with mapi id 15.20.3632.019; Thu, 3 Dec 2020 23:00:29 +0000 From: Andrea Corallo To: David Brown Cc: gcc-help@gcc.gnu.org, nd@arm.com Subject: Re: Correct way to express to the compiler "this does not get clobbered"? References: <32b3c0a3-9917-2b92-de59-1d6a14ecd8f8@hesbynett.no> Date: Fri, 04 Dec 2020 00:00:28 +0100 In-Reply-To: <32b3c0a3-9917-2b92-de59-1d6a14ecd8f8@hesbynett.no> (David Brown's message of "Thu, 3 Dec 2020 19:24:47 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-Originating-IP: [217.140.106.37] X-ClientProxiedBy: LO2P265CA0270.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::18) To AM6PR08MB4900.eurprd08.prod.outlook.com (2603:10a6:20b:cc::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from e124257 (217.140.106.37) by LO2P265CA0270.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 23:00:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 32aa17df-5995-47bb-6c50-08d897df4582 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1634:|DBBPR08MB4872: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: F8aLuDwaWWMMApPq2os+PKV/79hVVxmajkdne/R5wVHfp6ateqd16+YrTl3C5St35vrGXi2IWxtGDaJrOybJjJFUiqVQG/Y/2KtiLwop+VG/z3l0pjuD4XE0up1BrwGwyUx4v9QSDQfh3vERvyeFnc7I/W4xopaSzLdfTAhzsLDd6DetNtZ1c/fn68LAFXkSgxEF0ZXJ644JMpALoWanhchNFF4loG8I4y7seTmlzYpq4ycFT+hxOJ0d9RaiRNV5mL4GyyUGVHmJf4qqDW+ZBKRAlyewKTmumO4e76woQiV3SeWNVNQAG07we+8M0KV6u3+6hq/Ww0e4jpwU8eXrVQngIF96yYE26GjVIfRdK+PnyRCp7khFLmqoaCYscZiy X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB4900.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(396003)(346002)(366004)(376002)(6916009)(5660300002)(44832011)(2616005)(956004)(52116002)(4744005)(66946007)(36756003)(66556008)(2906002)(186003)(6486002)(16526019)(26005)(478600001)(86362001)(316002)(66476007)(8936002)(4326008)(8676002)(6496006)(43043002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?KRIgN5GxSSF0rzbMVNcrzQ6aDGKu8ysgxq229UQdslLi75ka9iPg5wExjtuT?= =?us-ascii?Q?gUaiEWMHdxYcWIbY/GBFw8bgW/1vEmL7W00ZHxXQeqzNSeXlo0UXAjzDJGzE?= =?us-ascii?Q?LcN60S1TnmoXaAJZTXc37z8wELfcXsG8S/kH1Qg283KYTHtEJocnScax778Z?= =?us-ascii?Q?aFk93kcU8UzX6YC/q/wfAkB9I/lqKGmLSqkTOTPO66fH1FWbnguGzrBjz1nA?= =?us-ascii?Q?ljYU2cz/sMJQm6rq5J0Hk/znQ5vJRU//FKKLUjIMgbgYiVL3ugFuWYvFxuYq?= =?us-ascii?Q?YNd80SL+qyfmBCfegMGeIdC70UyN0gENKBr7Z6weh0X3LMjUGyUXMFd79Mby?= =?us-ascii?Q?SE7z5yEUyqeW1mxrrkHCiCADqMNLwLYpPADOeB3WKZ66PX/m5SermEzQGNbU?= =?us-ascii?Q?lfwdFnKZ8CEr/h9VqTIiAWottJ+fMbhuz7HgeveW6AimsyidHiHahqCFvmBe?= =?us-ascii?Q?VsDNpSfgBJnj0rtiTfYrfjWEnepItO3HwqV8KuCalj0dECcW0ldsqYF/3PNI?= =?us-ascii?Q?REMgX7YEQUdo4QTj4LHVWsX9dg5hMSj/d4ow3ufTBwA07nOa2Y7nzIZ7VANL?= =?us-ascii?Q?cfQuNLvhuElUjhgkxeQxAUUuSXqo7vQcPMCQ6EcMhVY+iGLC23AYX184/qXh?= =?us-ascii?Q?+q8lQamcJfyBJN5w0uPVYRiEX4eknWxMIqtuvVj5awXCgO6VKDg1coYfgHQL?= =?us-ascii?Q?no5EKMGc9QWASk7es8eIxwwMHtlcHQn87cTAMBTaBI9pxqSKyaYcnmD8AHae?= =?us-ascii?Q?EOkJ3ipRm+FPaY/zUF5jxFQJhwQyM6LJ2sLO52mt9sUjzDHEC8xr5lGGZJoT?= =?us-ascii?Q?mgb38KR8IKe4sdL0j8ys1t5ZRlDCBq7AcVq9fYbG9y8mrlLl4ox6ZzJYROle?= =?us-ascii?Q?UkPfi6yFkZbCpILFadXkUXg3xPMz1QcljuNWUi7gg0uvrEzcRWhMTcpo6tbl?= =?us-ascii?Q?Q2aCRQN4koykT6uZGysn9/ahrw89a7VnfMp8oP07FZ9JkYJQ3qZQWza8bk/a?= =?us-ascii?Q?U1pa?= X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1634 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e5e65125-d7f3-4131-9a53-08d897df3af2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1W/lNaSRJ3FDJJ4YGw6hcS3S4/QSftWtnG4oPnlLWgoOJcXluwp6vp0g/n76WGEtQQeKCWPFW7rgj4nHR3ng28LtLaMBP5QthC1xbEatR6ABp6KgVXdGzGSZ8YnnvC5E6e0kwUFN5lmGKGWGFyXltv06CyqNE2a4EjZnbghhMxf8w5l7uSbMebULQiybuPP/h4o55XlFMJcVAu36Z4XpNv00OLOi4i3BpzonV9iJw5VQOGuCQUF+bycdLkHMulPIjcIYFIrOgE62P9yhJdKesfJaZ6zL/cZQTghycqj+QHnzydtjF5KQTMNOUsDnZQctfmNGLnYJ/abTpMPhxf77qoiS4o1+tNQzMxKrP5SLmsyi6GKlScgotFDh/aJUd0Rbl7lRvglNXzpeM8oMMo3lsseL+K47IGcBLdcotCQvHc= 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:(4636009)(39860400002)(346002)(136003)(396003)(376002)(46966005)(4326008)(47076004)(956004)(478600001)(82740400003)(70586007)(186003)(8676002)(16526019)(26005)(2906002)(8936002)(36756003)(70206006)(86362001)(356005)(2616005)(5660300002)(316002)(44832011)(4744005)(6862004)(82310400003)(336012)(81166007)(6496006)(6486002)(43043002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2020 23:00:47.2506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32aa17df-5995-47bb-6c50-08d897df4582 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: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4872 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, 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-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 23:00:52 -0000 David Brown writes: Hi David, > As "f()" runs, the value of "y->fun_ptr" changes with each step as you > get alternating "foo1", "foo2" outputs. Thus it is clear (I hope) that > the compiler cannot assume that "y->fun_ptr" is not clobbered by the > function call. Indeed that's clear. The question is more if there's some way to express this to the compiler qualifying the variables in discussion without changing the structure of the code. This because as I wrote may be not trivial to modify the code generator for optimal results. I understand this is probably not possible and there's no magic attribute or qualifier to express this. Thanks Andrea