From patchwork Thu Nov 7 16:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Torbjorn SVENSSON X-Patchwork-Id: 2008082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=VfrG7pKM; 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 4XkpPC3HfHz1xxq for ; Fri, 8 Nov 2024 04:05:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98DCF3858C60 for ; Thu, 7 Nov 2024 17:05:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 509473858D20 for ; Thu, 7 Nov 2024 17:05:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 509473858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 509473858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.132.182.106 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730999127; cv=none; b=Nnnq+lUWRO4FhnWUZrHAu6dr2s10JWWSB1565lL+bLJGNJY8uf+2FbxR5mtb8zYJ1lJDcDpIXxt6yHCVcO5DQafgZjeYjnuLU97AzLbXICW0+7pHwjJVKBuZ2FDXxOc54nvGiuxQgcWF007Qbj9nwPQ71Vs5VdTuPuTVsl26xLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730999127; c=relaxed/simple; bh=CAb55V3CY8LNQCVbIlIFLK7CMzm8A8qmERXg3P+/zTo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=t10w7PAFBIsvVQ7DHEDPkOcXi36EpVkighQpHXktWVWGNd6QxcTFdjJeOyusxPJdzwyw9u/XcGu0VoAqa+DUYT8saCmraJB8MS1EzKvJ1oTQsOvoIl1GOc4/l8db80Mk0mMewm6BAV3zFdWQ/KLTgNXVrjmNdTPJ+/MsZO6cbEU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7B7nmt005010; Thu, 7 Nov 2024 18:05:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= Gp6PC4anlDIAwp6CAu7daGnLU5GUDekt+ydpEfSQycI=; b=VfrG7pKMREu+Mg2j uV/lKB56FWt6FT22vCWyHjFKFjSXcz8JQ/MbO2xMp4nS1D5C+wT8PILdqzb5d9d2 hZlXFWrSSvwBCqprHvEs7+4sDd9AXFr7mN5/jitS4APyYKdy+nrpJOMoyaiv8y+S pAPNl0Uup7a4TMtbulZ/NNk2/g+ynezYi+dvBi4J3ps2Ss5xHQzLeuEGFKgmskQA Mo7qTI+zjxbRnmNbfDggvM3QuPW3CRbZnlvN740wJ5h42Wqzi+dsFewi8KR7avZg o3HyJCqXf6meEX8Nvc7BCroR4MhyNu3DLvZG8XIz4n3Kex4tovHj37yj9DBVAntf mVYaVQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 42nxh45dj8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Nov 2024 18:05:21 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 4EA2B40077; Thu, 7 Nov 2024 18:04:12 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 46F9C2C7E9E; Thu, 7 Nov 2024 18:02:13 +0100 (CET) Received: from jkgcxl0004.jkg.st.com (10.74.22.255) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Thu, 7 Nov 2024 18:02:12 +0100 From: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= To: CC: , , =?utf-8?q?Torb?= =?utf-8?q?j=C3=B6rn_SVENSSON?= Subject: [PATCH v2] arm: Don't ICE on arm_mve.h pragma without MVE types [PR117408] Date: Thu, 7 Nov 2024 17:58:04 +0100 Message-ID: <20241107165803.1896195-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.74.22.255] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 Changes since v1: - Updated the error message to mention that arm_mve_types.h needs to be included. - Corrected some spelling errors in commit message. As the warning for pure functions returning void is not related to this patch, I'll leave it for you Christophe to look into. :) Ok for trunk and releases/gcc-14? --- Starting with r14-435-g00d97bf3b5a, doing `#pragma arm "arm_mve.h" false` or `#pragma arm "arm_mve.h" true` without first doing `#pragma arm "arm_mve_types.h"` causes GCC to ICE. gcc/ChangeLog: PR target/117408 * config/arm/arm-mve-builtins.cc(handle_arm_mve_h): Detect if MVE types are missing and if so, return error. gcc/testsuite/ChangeLog: PR target/117408 * gcc.target/arm/mve/pr117408-1.c: New test. * gcc.target/arm/mve/pr117408-2.c: Likewise. Signed-off-by: Torbjörn SVENSSON --- gcc/config/arm/arm-mve-builtins.cc | 7 +++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-1.c | 7 +++++++ gcc/testsuite/gcc.target/arm/mve/pr117408-2.c | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/mve/pr117408-1.c create mode 100644 gcc/testsuite/gcc.target/arm/mve/pr117408-2.c diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc index af1908691b6..ed3d6000641 100644 --- a/gcc/config/arm/arm-mve-builtins.cc +++ b/gcc/config/arm/arm-mve-builtins.cc @@ -535,6 +535,13 @@ handle_arm_mve_h (bool preserve_user_namespace) return; } + if (!handle_arm_mve_types_p) + { + error ("this definition requires MVE types, please include %qs", + "arm_mve_types.h"); + return; + } + /* Define MVE functions. */ function_table = new hash_table (1023); function_builder builder; diff --git a/gcc/testsuite/gcc.target/arm/mve/pr117408-1.c b/gcc/testsuite/gcc.target/arm/mve/pr117408-1.c new file mode 100644 index 00000000000..25eaf67e297 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/pr117408-1.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +/* It doesn't really matter if this produces errors missing types, + but it mustn't trigger an ICE. */ +#pragma GCC arm "arm_mve.h" false /* { dg-error "this definition requires MVE types, please include 'arm_mve_types.h'" } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/pr117408-2.c b/gcc/testsuite/gcc.target/arm/mve/pr117408-2.c new file mode 100644 index 00000000000..c3a0af25f77 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/pr117408-2.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +/* It doesn't really matter if this produces errors missing types, + but it mustn't trigger an ICE. */ +#pragma GCC arm "arm_mve.h" true /* { dg-error "this definition requires MVE types, please include 'arm_mve_types.h'" } */