From patchwork Mon Oct 28 14:55:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 2003373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IZk/R7lF; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=IZk/R7lF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xcc0x1S5Cz1xw0 for ; Tue, 29 Oct 2024 01:56:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 397543858D37 for ; Mon, 28 Oct 2024 14:56:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f403:260e::62d]) by sourceware.org (Postfix) with ESMTPS id ED6103858D26 for ; Mon, 28 Oct 2024 14:56:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED6103858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED6103858D26 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260e::62d ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1730127380; cv=pass; b=p187YklSGTRMrEcz3wBf9r6Y7o7/InSgKYutUQ54WQBWTqXNmCNT0krud2NuZf7+x6xJW+CjriuR65ybfJ0miR4uqvyyTjinmz4MqeC+dWMZhSHBYjiw0jenQJOYF1NqPNot95eGzmXO1e11bNti7dFKrhDROjHjkjo1NunRGzg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1730127380; c=relaxed/simple; bh=zJNYFa794huk/9Jp/aFJIOd34UPgSDzfKqJtHZmhrJw=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=csYjdTQLt0haFQg5Z4/t8E+sYbyfSVnBtChJxiV4U1wbkU56xsJy9c+cOTF62Xenqlq5VQ5sKXuOuytUhryPBgGhIvmEl+o/ek2kfeU4LI4GsaqS228JMqgx7ul1iiD2SAXRqnNsW1KqgPthLGjswSBVcrlZqARrtZGXCQg0If0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=P2K1V/y0vO+wg9Xccp1SrRB3ttZGRSHZmEs07aYkaVNHAPcrmhbJ00EL4hDBpGSh05AsU4UnCyf8QZ29uIWdY0jNThWoso0RT/jvbjBA5vRxnJgDpmhB0LRAI3DsPB2eOdCn/16zzhzuwL3fxJtQCJz6qBE76JZPJdij126nPQHXe6RZDM67bhzTUVY85CR999TGUQFatYRlYp58urZGtuwVVkDGQsiP8VqyFybB14LhIN17/zIUB2tIXnXnGM4nya0a+oeeSCYfSTL6NGt9OkJLMYwPCOopi10/+4tvFeVz0DmGYWDWX71sy5zofhNFnTYu+zz7Lsl+gdBQmBXJzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ZJrBEvjQOvqNj1Z0KnpLpX6Ud7O6PRTKTq3wwWtcnr4=; b=y1PSZmAQPqBRHBew8ZREwQyFYhctvzP7CTcuWdkiI+WLUJn08Wy/95vaV+iESyANBZS7A95MsH4x/48fN0KVS1XM2uuLAlvXuibnoLbecLMlUp2HaRFAtksOngeMN0bMf+SUu2SezM6uGYIblDtqUtcoFyRpwUJpBneLqCkVpCxFnWdmTMCj0BQlKX15Y/dfAycAwVm7yC/7LbADhJFILLypFob/T7SahxsZq1MhqQ9vHK6vNSUMEo01kf2xg9al1m33G05QS5n8vZ5lEQcYauikht7EiSm2B0Z3x0CPv5ZFnfpuJjnczXcBZc6PWEIpw9e49xoNzxSsMT7rGzMOFA== 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=arm.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]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZJrBEvjQOvqNj1Z0KnpLpX6Ud7O6PRTKTq3wwWtcnr4=; b=IZk/R7lF6EC+/4Mvv8kpvq+s1wNH+lcDLiNYMlXu/pZRo//+YwDm02WasoxZvozsd3C9ukxGdsCkQ79nKh6bkY14bFrmmH6vXj7WV0qB1FSwbNYDH2AUVcfRkx+7VwEeWVpIc7eLdWk+cMBfPiiYSQ18iJn+9r+dUiYFuswWcv4= Received: from AS9PR06CA0351.eurprd06.prod.outlook.com (2603:10a6:20b:466::17) by AS8PR08MB9313.eurprd08.prod.outlook.com (2603:10a6:20b:5a4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.24; Mon, 28 Oct 2024 14:56:02 +0000 Received: from AM4PEPF00027A67.eurprd04.prod.outlook.com (2603:10a6:20b:466:cafe::46) by AS9PR06CA0351.outlook.office365.com (2603:10a6:20b:466::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25 via Frontend Transport; Mon, 28 Oct 2024 14:56:02 +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=arm.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 AM4PEPF00027A67.mail.protection.outlook.com (10.167.16.84) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Mon, 28 Oct 2024 14:56:01 +0000 Received: ("Tessian outbound 8223600b7a9c:v490"); Mon, 28 Oct 2024 14:56:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7cbd9006e8870350 X-TessianGatewayMetadata: Y5BbFq3o8Jx/KC9jRD6b4W4A7gTW/gvONsfCX9Nw6D3xofuUPQCuQund3hp6eo8dta4oP4mx8S9TSq7mmStAc37AH7xMbGayVfwXY2KHP8smRbocDCtanWNEhYN4CuxSgj0W/smisNiNdt+E0SnGJg== X-CR-MTA-TID: 64aa7808 Received: from L0198322de558.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7F70711F-D512-4042-B605-72D9C9472476.1; Mon, 28 Oct 2024 14:55:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L0198322de558.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 28 Oct 2024 14:55:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H1k/dOuj7NfTk0gl9KUUIZqDdYpD6+UcVF3ZY+6pT9febw3pCFNt24dHXg59yJaYwrfhJJzBJjM+3SVOvgere+n2ETMaO8/rf/cj2+euKHbXtWPNZJJhMy3v5BRD7q7CkToBDc+igH2lHijPxbLjPwj2BOTt+liOGvfFO5EP1op/ClzGV/aRUpFZPWt8KdZER7Z0TjtGX2ypNs6/vfk6i+hLqs4lJN7mei77F7N94Z2/94UgdZ7z5oTUcX7rDDCa6wRhsEe7+fx5RFCE/lwj7kkrozAN4ZsPM0ILp+RGdl3x+F72hMTLON+KpfdovJF53s196zkLuS3l8srbR2yrPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ZJrBEvjQOvqNj1Z0KnpLpX6Ud7O6PRTKTq3wwWtcnr4=; b=rdaeXlqZfXy2eBYMLZ61YqCnQ+hFVYA93IrixaKZ8vO84MhcgYLJxwJ7GsBj9a4F2+wgptm2bjVFc9qpyjvbbDilLSX8eV4ntIr6QCu5nh1Pk+40BYLfYQHRfUjKufKrbCq1gbJVQ8pP9qZlZJkM15JeLTZIRCdBf0pn4ZnV7WIKCo4awx2VZMslx0vXPn/rQypIR+UdlQhRJgtaw7xBLD/yEAz82Un3k4TDIRoh2X31rsPMAL36RSlg44kbUg6HNMDFIemLtbWS0tX0c3f+0onGNJ230Uy85DMnj8dDM5+/MiOs793DsSe4klxSVPpJC9ZgsQUp4GaicqHTgk5NXw== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZJrBEvjQOvqNj1Z0KnpLpX6Ud7O6PRTKTq3wwWtcnr4=; b=IZk/R7lF6EC+/4Mvv8kpvq+s1wNH+lcDLiNYMlXu/pZRo//+YwDm02WasoxZvozsd3C9ukxGdsCkQ79nKh6bkY14bFrmmH6vXj7WV0qB1FSwbNYDH2AUVcfRkx+7VwEeWVpIc7eLdWk+cMBfPiiYSQ18iJn+9r+dUiYFuswWcv4= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by DBAPR08MB5558.eurprd08.prod.outlook.com (2603:10a6:10:1b3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.24; Mon, 28 Oct 2024 14:55:45 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::9f32:dc2a:5bec:aeac]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::9f32:dc2a:5bec:aeac%4]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 14:55:45 +0000 Date: Mon, 28 Oct 2024 14:55:43 +0000 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Biener , Richard Sandiford , Tamar Christina Subject: [RFC PATCH 4/5] vect: Ensure we add vector skip guard even when versioning for aliasing Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0090.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::23) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|DBAPR08MB5558:EE_|AM4PEPF00027A67:EE_|AS8PR08MB9313:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f15437a-1959-4c3e-bfb0-08dcf760a3b9 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info-Original: lak/858mzGkiqIulbcBF6tkwU6nT6NkL1ME69dtNe8calaKO7nAl5WW7tpo6KuQiGmHN71GzmveAmi+Nte8q2iSkADr/1xvDG6fBdyW9FcDOHDHYgFht481KGNm6drGkDr+4KwUyDjtZJdT4sTI7tYYsOEKRRtGqozi3PIxEZNWXBVgx/etqK8ve5Z7ljWZQJpmKXmPlZWH9GRDEll9yaDRaW0mEIRYhSJtlcD8FFY2ovcFAAC1zJZ2r+QsnjyXVGKD9MahrMtcpuoCVEwgtH1f0rZouG622cY/qNJdcsSbTuR1fNOk9FWyUKL851QMF0WIOspm79CuO+YCF2eeTgoxg6g6QwNPW4lbdbrK7Lizt+ngnaEpleic53e8B4zRq7xOk1s3AkGzeRRFbGB61hdtsVLM0mq644/fABzQTxS1AMLaKr37XgHrXdWbnFaQ2pNPnYkc8NkHnlDXNYkeVCF95yatN+zxwA+MwQFXJxJVcaL17nYeVD5X7RbcWWrNkgQ+wpfY0tyY56UcNI5G+F/OR0ibMOOOh1A27jsw8C55VBoZMH4cpzMPWnyMCWfJnMhmFeDVp9QyBeRuJ74h33awwq08oODvOV/S5kim4Jbjh9aULg+EXsszWgVBOWzwIxJmCUTaaAc4z2mVMWt3A8SaRv7HM3zhFm5b3JON3Ng55ZwQjqydF3T/SYE/0f1gByAN0dt1wWj/9NYuxkoGaXtZeYvayxyadHrJp5iUu8xYNac7uUcEnkMyq2Kbo5HvVJJtHqrKHIedPbTeOTMjCHKxM1nGQh7+innT9qQWB5lb4396g494kVxKSxCoT+89aVwb3oPVAFY9cY5xfgNB4uy+8L+h3jvKHQdT8o9pjsKr0g1yL6BSZ70sxPjnr/bpxwPFSdd/3kA6nripkd2nzrVviC50CangRuvdvlDUGgirkT56HAFKs8+1nsR/UzIrRiHReNTG2ldJe8ydKvJV54n6An9jb6ZbCY8IaBGhrn3YfOy5UM83XV7OM97vMm5lvUK8s1qvWUlXuYlpx0TFCdYCc4OZl3GTQNrYYm8PYonIOcIw0GHACvHigB4AHQHKeiHktqs9tXQxR5zsaOO3p6XOd1VweFKvg+HqW2SjbmPuFR+F0SwfOZRofM35/o5RnAHPDc4jH0bOGwSEpynS2SfQJO3wz2xjQxVh5Ux4mCcP4rfy4kZNh1hYJ6OdM77MiidmHLk6m7y/QIAjQZlp9CRL8+25gdxdGWVw0si7nlKqhvgg9QeQV3gLNMZaXH1kiW2StUM5ieCzKbnL4P1a7XA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8958.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5558 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-SkipListedInternetSender: ip=[2603:10a6:102:33e::15]; domain=PAWPR08MB8958.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f8d17a39-bffa-4686-8205-08dcf7609a1b X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014|35042699022; X-Microsoft-Antispam-Message-Info: =?utf-8?q?FaUIOQg2V3905TBl/G4pdrY7LShiBE0?= =?utf-8?q?BjSI6aw6+XRJOpQN6QFcr+vIGumDdDI3yWH30KJSexCAzdhDjM0M9rY2xoHH730PT?= =?utf-8?q?lflspnouP+J88aB/hSOWbW6lkH+CKJwGDTLXLCavwVCo+73m+RKRhcyMhV2mKI76t?= =?utf-8?q?ZMgU36AHaGWbkZ5w6o386sUD0MJucIHZHFqjjv2RABt8yLr7jj+Y+n9XPZ97tjlE4?= =?utf-8?q?iXaOi9Av6tJjsT34xW38hXheyDq2moj5wS7WbUmyYRD8eFbclLPcG4l42Ve1WvTwz?= =?utf-8?q?kLAV4x4pCXEjdZG+OYsYq2vmDICqmUndBx6IagdygGSpxo1zW4CJIhQIXA4Fjsaz+?= =?utf-8?q?WVhInktD5/BBz98j33kfcI9KSUtcF5xMpW6ueOXc7BN9nUUADd/vU/+JdGW2/K8fF?= =?utf-8?q?8L7SY+qYkHnPzHhLPplzvtq2XSdX7/sECvJPJPvNMH+lMqaOebt0OBCo3Zv/+nVD6?= =?utf-8?q?Fbau1GGouK4SI+1bAdY9TO/YhbXbI3DUVQ1zH7ftHVCnSJFH7rRVMFH9VIu603gwP?= =?utf-8?q?/HPx5rjQtS0pPnAEVZHikavhQ8PXop1895+WSXXyhsuiyQWP9TnO1FPqeqcFNuWuE?= =?utf-8?q?a3h8sLgDC0EbFRPhJBo3kEP+zherzuMdyZlPTFPCWRZu5e6F/wGZwXSxudytNEiva?= =?utf-8?q?bO4ca6WXP7IQ3V9q/LrgtZ+/VPy+Z2IzSGGbhBf3scVEfHSll6Ce8zROvoCB5/yr1?= =?utf-8?q?bZ1kHV2G5Lvc903VwX/PNN1YMqjDbC6salvarjReicnXvLrdYKD6Uo9sXbyCYRcok?= =?utf-8?q?ycQpoA5mATCziS8a6+CI6faM7H+6daxlZUyoxYBB19g82+0dHwRdNB5KG0HdQVDkJ?= =?utf-8?q?svELdckjmyd20ygyJBuHBVnopF4RE1tQdRUAsfNPQFk/KKroTnJ/c5QGnYGkUz4/2?= =?utf-8?q?UPwiAudf6cUlUpJVBhLwOkf2kzn99EgBEPGV6AfQ+PsQ7UuYDp/pwXR6zeWU7DDFl?= =?utf-8?q?k2iHYX3qrpFle93iplW+zSARm6l/8SYTnyM4GgTD2Btu9DN7V9Jrds/D8aYBC64mn?= =?utf-8?q?CuBTei9WZGqjQB+Jbe2wc6wcvSNzh/8a5fPlkKU/bRqJ+y2lATXUmfqzOGvcXQDer?= =?utf-8?q?D1Nr/YVCC66TCQ6r7HZn9E1/P7dJqmQ8b7SB50FLImKwJIPAEx5Zkfc594xYWSXx6?= =?utf-8?q?Hr3G3O5uKnbyAWlbWTIoKDlBdK4LPTwaxZIBgHoRpp7C/vt0W2C+qkXQDz2C7J+gY?= =?utf-8?q?U7mzqsVPuy1uQ7fAVE6s+VYSwZCs7Y7C13IdNkAxgFU0ZYOx8gk6QdToql38xLMlc?= =?utf-8?q?UfPdg4BJWqo48boV+UXfW2ElmI/5fR5wgMypC//4ZBkp/GSZ4+oHc1qw=3D?= 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:(13230040)(1800799024)(82310400026)(36860700013)(376014)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 14:56:01.4923 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f15437a-1959-4c3e-bfb0-08dcf760a3b9 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: AM4PEPF00027A67.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9313 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This fixes a latent wrong code issue whereby vect_do_peeling determined the wrong condition for inserting the vector skip guard. Specifically in the case where the loop niters are unknown at compile time we used to check: !LOOP_REQUIRES_VERSIONING (loop_vinfo) but LOOP_REQUIRES_VERSIONING is true for loops which we have versioned for aliasing, and that has nothing to do with prolog peeling. I think this condition should instead be checking specifically if we aren't versioning for alignment. As it stands, when we version for alignment, we don't peel, so the vector skip guard is indeed redundant in that case. With the testcase added (reduced from the Fortran frontend) we would version for aliasing, omit the vector skip guard, and then at runtime we would peel sufficient iterations for alignment that there wasn't a full vector iteration left when we entered the vector body, thus overflowing the output buffer. gcc/ChangeLog: * tree-vect-loop-manip.cc (vect_do_peeling): Adjust skip_vector condition to only omit the edge if we're versioning for alignment. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-early-break_130.c: New test. --- .../gcc.dg/vect/vect-early-break_130.c | 91 +++++++++++++++++++ gcc/tree-vect-loop-manip.cc | 2 +- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/vect/vect-early-break_130.c diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_130.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_130.c new file mode 100644 index 00000000000..ce43fcd5681 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_130.c @@ -0,0 +1,91 @@ +/* { dg-require-effective-target mmap } */ +/* { dg-add-options vect_early_break } */ + +#include +#include +#include +#include +#include + +/* This was reduced from gcc/fortran/scanner.cc:gfc_widechar_to_char. + The problem was that we omitted adding the vector skip guard when + versioning for aliasing. When invoked on a string that is 28 bytes + long, that caused us to enter the vector body after having peeled 15 + iterations, leaving only 13 iterations to be performed as vector, but + the vector body performs 16 (thus overflowing the res buffer by three + bytes). */ +__attribute__((noipa)) +void f (const uint32_t *s, char *res, int length) +{ + unsigned long i; + + for (i = 0; i < length; i++) + { + if (s[i] > 255) + __builtin_abort (); + res[i] = (char)s[i]; + } +} + +int main(void) +{ + long pgsz = sysconf (_SC_PAGESIZE); + if (pgsz == -1) { + fprintf (stderr, "sysconf failed: %m\n"); + return 0; + } + + void *p = mmap (NULL, + pgsz * 2, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (p == MAP_FAILED) { + fprintf (stderr, "mmap failed: %m\n"); + return 0; + } + + if (mprotect (p + pgsz, pgsz, PROT_NONE)) { + fprintf (stderr, "mprotect failed: %m\n"); + return 0; + } + + uint32_t in[128]; + memset (in, 0, sizeof(in)); + + uintptr_t x = (uintptr_t)in; + + /* We want to make our input pointer maximally misaligned (so we have + to peel the greatest possible number of iterations for alignment). + We need two bits of alignment for our uint32_t pointer to be + aligned. Assuming we process 16 chars per vector iteration, we + will need to load 16 uint32_ts, thus we need a further 4 bits of + alignment. */ + const uintptr_t align_bits = 2 + 4; + const uintptr_t align_p2 = (1 << align_bits); + const uintptr_t align_p2m1 = align_p2 - 1; + + if (x & align_p2m1 <= 4) + x &= -align_p2; /* Round down. */ + else + x = (x + align_p2m1) & -align_p2; /* Round up. */ + + /* Add one uint32_t to get maximally misaligned. */ + uint32_t *inp = (uint32_t *)x + 1; + + const char *str = "dec-comparison-complex_1.f90"; + long n; +#pragma GCC novector + for (n = 0; str[n]; n++) + inp[n] = str[n]; + + if (n > pgsz) + __builtin_abort (); + + char *buf = p + pgsz - n; + f (inp, buf, n); + +#pragma GCC novector + for (int i = 0; i < n; i++) + if (buf[i] != str[i]) + __builtin_abort (); +} diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index cf3a90219b7..55761b61185 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -3278,7 +3278,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, bool skip_vector = (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) ? maybe_lt (LOOP_VINFO_INT_NITERS (loop_vinfo), bound_prolog + bound_epilog) - : (!LOOP_REQUIRES_VERSIONING (loop_vinfo) + : (!LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo) || vect_epilogues)); /* Epilog loop must be executed if the number of iterations for epilog