From patchwork Mon Nov 6 16:50:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 834850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-466044-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="e7ZKWwYS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVz7K3k6zz9s5L for ; Tue, 7 Nov 2017 03:49:49 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ENEZA4qI86m8Y81USsH5/T0MB0eG/+9i+rMSTPlVcj9QCBx2db +5EGBk5x67dmiRYXmpuaXc80+6M79e1udttMaqaKzoUwLHXu9MOC5yOlrEOwQYlA bUyf2AYkluqVwealSli4UuwS156rlEVwutXbIxfHTMQRFv/haxz8ZTEZ4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=9z2IXvYfHWQ19Kij79VeuR7F+FY=; b=e7ZKWwYSPTHWo5VA49S3 pWUGjxGTTy7De8C4oF0HkFbcFMpOvLEQgvAxYhjIXFV+rbaUc17dAKnzNNlq3dRG DjqNzsBqOsyNFlUk/ASH3y8SLXQ6ZnD4EqzExpCngeqX1WV9pdIiAZiLvTxQxchv jvLyA4I8tEDcYOEtyVtUNns= Received: (qmail 95289 invoked by alias); 6 Nov 2017 16:49:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 95274 invoked by uid 89); 6 Nov 2017 16:49:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=dgaddoptions, dg-add-options X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20070.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Nov 2017 16:49:38 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tamar.Christina@arm.com; Received: from arm.com (217.140.96.140) by HE1PR0802MB2313.eurprd08.prod.outlook.com (2603:10a6:3:c4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Mon, 6 Nov 2017 16:49:34 +0000 Date: Mon, 6 Nov 2017 16:50:00 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, Ramana.Radhakrishnan@arm.com, Richard.Earnshaw@arm.com, nickc@redhat.com, Kyrylo.Tkachov@arm.com Subject: [PATCH][GCC][ARM] Implement "arch" GCC pragma and "+" attributes [Patch (2/3)] Message-ID: <20171106164957.GA11814@arm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-ClientProxiedBy: DB6PR07CA0169.eurprd07.prod.outlook.com (2603:10a6:6:43::23) To HE1PR0802MB2313.eurprd08.prod.outlook.com (2603:10a6:3:c4::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45dbaaee-4ceb-41ec-a608-08d525365c2b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199)(49563074); SRVR:HE1PR0802MB2313; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2313; 3:HsQY2TY27dlKleoFjYo5/5P5hvO8YSPshTREwuwWprMOYgIvl/GjImYk3ZHmXSqKlm0wBp8XUPrWjY0Hd+GOfRQtqFgC2KzVvvV3NcaY3yl0JSldm/Pmu6rzC2y4jlyaSlFavvdn9ZgJTwXuLDb04l8R69tThMQhQZKCSEVvnim73K+xSOE4mcE1hq0/lp6OtwUzPQKotmw1OzVGYoVlnrEzqCeIA4EiPxY7dMpQRvNQLP9T3eOeUTyBTB0wC3j/; 25:L4WX2cT8qOgN0lpm8dEeuh13AIyQeTAUn+eWQN/k3vsHOqJguX4fTLwtMAWjGXpnU74PbFsR8fIVaRe1BTRJm6DPWEc7qwrMO8+kEkYcEqD0xE+7GX5BYMjXbFf0VJZZy+LT1s+mxt5fvDUj2+HEmURuPT308UIbJxO++pv1ns68YQwPd8+eKj43e4s0/CEZ8BadN1OHFXITI7UOtdupT2sZe8Q/5Y0PKvuobCxf8KJ85WTlUyw0PLDn/6ffZqpuhiIc5U/DPZn0Eqc6w9WO/uUlC/fXg955yTShOCeD3EU7lwUb8iH2VE9jfORvC3SYXIjCmDFtDmiKPY/C0GqmyQ==; 31:tSQic7BqmZ9FDSDLg23qi3fdGldTG2QpN2/0ZWCJt2OWnuW7O+8oKBLrlnqN8JPBrGHtYGcYbjSVj7rwwiB3p4Pi3PFOhvTLZ1OJnKgKMvRF9K322ljHI2l2VD93zyZoBsN86g0L5cEcEX9k0YNpigpCXJ52B/lAgFubnL2wiwiWAJ9u4i0nrXzPHwyOSPYLEH10D3TXkIG9QCdeqNKan/8Y8Mbi9PP3Yysea1a18K4= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2313: X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2313; 20:6LjLvzeMU/11MKqthKI8FQOjehRUFL5L4ambdOcUyP1MalLnndpXRblB6/q7LLBx4PT94PWggeX0b2lFSC5BjLIJjKmQ2m5K2zWgn6r+RcSg5DME03tidRDzlvx+Y49JPc5qUbJ15k4WotJuSagO/3DQub1ZdxR5WYSpS82kfOM=; 4:gcSvzsToNWzoVrL9ZCxXxVaFdHEmbZD/PcVFVHjijVE6bTSaIIFCJd8aSKBcG0958T6oRiZipwFsn/6B92fXliFtOx1U4buo0xb2fBnUiecFZYIMynVb/nvfVbKpul/JMujoxtheKKyL2VwucmIHpqpJdCLgzMbMCeCLoMGBI8rbNBiLnZJ0bApXfdT6zzXl0d/sHtFLS55StGpJLwaxHSrLU/gf4cIKzdxruo8JNnNhnS1zwxjKtXtNdTyhTULcMyk2GjKBzGjfjCTK1S16x4JUI/ZBBoK5Fj76F143SA45q/un4i8TCUPr0iYaerrm+iUgKr8jQShoGI0a8TtGdQ== X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3231021)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0802MB2313; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0802MB2313; X-Forefront-PRVS: 048396AFA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(189002)(377424004)(199003)(53754006)(97736004)(36756003)(25786009)(83506002)(21086003)(81166006)(81156014)(8936002)(16526018)(84326002)(189998001)(4610100001)(478600001)(66066001)(106356001)(2361001)(72206003)(2351001)(105586002)(5660300001)(16586007)(7736002)(55016002)(53936002)(6916009)(2906002)(68736007)(5890100001)(58126008)(568964002)(33656002)(3846002)(6116002)(305945005)(4326008)(1076002)(86362001)(8676002)(6666003)(101416001)(316002)(50986999)(54356999)(2476003)(18370500001)(2700100001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2313; H:arm.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2313; 23:Pn3Mqhbzayjds/0MYPWz5xAajxuWW24HK792hQvEH+8Xq1wj9uOcB2/xkedw4/5Hs4YvhCnxlvavlhF0Vf9DgxkSGOk8sT1A3X7BCdaCJvqU1i4SMi3XWVgy7j2AoCc4dqmLdu4wJRCdOOIkvcv2/sM4dlX/29a7CgeJUS4EynnXZk0WeYj6VSYhcPQELZ8NsdwrR/FRVbpNFTg2oPMQ9dtEQJkR3pNypQ935j4r0eY5DWBby9d0xdDYeUcMxHSdERiPolOP/mvdfBjIpTObtFNxC18n+TkWKi5/1As62vv/H9ucPBeORKJLxcfC53M/0o1SfNLpWYFIWmqbKHQ1zCDzIFD0BolmAeoRfRh+BDAPwuLkBthsQ+XuYGT+Ag2MrynowRXb5b0ZE2QLOPo08bTw/nBuulAhVaYbQULdHEoU1g7SyPU3zJqopi977v8lUzDaKz1qE3b9YjlgciIjczOjyhjfUnuGAaLAoSFyiLjwRPiNvW+eBBbOaBAbxQ2kdvQiZ9KzvVtR3hwJNmeI/R2yGmMGFj5OesBcB68uWSnYquCqZ2e00qeQuzj5NwE5O/RM7fao3GOmCAxFf9ERVFCneuiJRVzs7Zf9Xj1r+0PoTryMGi/gCPDag2NOEiJIWEAkwesFHf5ihtYhNlbu4BgXWMLORC9WSxQnT2DrfgLHR8Fu2vz+uEqRoVFpTNVZymFIDgi+I4XKKGsLoQC5CyA/3OAbCeY8n0ICU7dxKt2QNId8rVlCH7AU393j0DpQuTngmYLjqczTIW8bO5PX5y/nrkAucHAXIou0RT01JYILdxFxeOzv7PC9KXArI376fik9yBj/AkAElvhZvjiAgoaeKNO4/UW6Av4ahtO0GFGBxxQUXHIhTrzisRWj7I8aRzgrwikTTUMrZ2YEHyK6SAb9uL3oh/fl0SDiraQFPeTxQOvGF3gs3uePUnQMmzUddS7lT0EornUOiM/mBOJ+fjJBE6wYwAEfxvhDgIkYp56u9LCiycSQgHJr48F4B4pu7yZ2/UTvyp4gSPmMfx/pdEVkVvh5PY3HMzdNW8A1UXBDQdbKZm8cnaTmq1OZ/vGd6Xd/hBt3SWHOjLZwxeD1G8o8oQ3Do8mKmIHWrau0qBga3e238EqM/J+1vl9ftavzguQGxs5Sdlzb2mSdyYV+1moR8GCv2EMTFYB8k7PbQ49R+/3jEoFt5sM4uaLCwXUaL4sLG9c9NJvqnayyc4Vuwb5Ny6NQZCbUmvvpOQG+Fyxh3lvwCzvkImVsKFxA+w0C X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2313; 6:MULAnmzJ0nyr16d/09QaMbarB9EiBZYeFMYDfEs/akdqv/SJAUjaMM7PKstycOXCni4txsnM0AO2XoRgNvuCteWko6tXJANLThv/V4AQUDjqddKVJ8+pzt3UPq+KCRGYwIaa99Shk9shJzIC5tORMhzrKMjyXyEIJTXUnbeMn9OojGuKxlgu7R8NZEth+qM1Tiq+hviNT04RJw+lI2XjufA1+BdxhreoLPJilNBOpBRJExkEpELRK3MHFiFe48sABiJ0vmPejXMxAyIHFwNyPnC2Shy0IxQNdRry6BQpIl2+esJKpaG17wFXJC7fkwtH0OfQhD440oeGgkPXVmbd141pM6RJAQVIpMTgZa0IVjc=; 5:l7O9wyO3sSHa6xoK/it9KINqHugs1os8/Es4ohp983qsM1E6ywTLyqN7qbhsxCsYJ6T3N0PLVYYcmogJEo7Vf4WR1OdGQ1wb9KO5scPO7FACXCxjrl9gQ6eHCRaMWq52BuSune5Ok4aFyIHiJfrf2RjoVKtxfKk7bHyfDtYQyP0=; 24:n4BE+lNYaYz2+pFH+jhMngZ0I7m3pEXkm7rFLCvLisCivRauGIU6/a/LXszV9HjHsXnb9v6Pm/FwSgl1Mxa8c4yOyQ15tgMLWWyzIQpD+lg=; 7:NtVrUoUUdgz881US0xPJSq/0X8hpVjGYqtaBAKekAt1pblVRqsJEuhiu/+7y/zuX/evBbTgL5XgsqlGBqlqZSV1o7csxoNxLk4y/0xIQ03mAxINHOpXxxwZdlI5Zq2dOVpkgFI5TcvvmHUyVEEdEfjrcYSCRdJH4VZHV6hkt7yT0kTqGxPLFuPFn6g5LvDtED38pjWskAawkRHNwaalT9OKw8ktNTy1B6PBpACCx/bfrfEVUMTxb7CEe6mcJId0V SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2017 16:49:34.1838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45dbaaee-4ceb-41ec-a608-08d525365c2b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2313 X-IsSubscribed: yes Hi All, This patch adds support for the setting the architecture and extensions using the target GCC pragma. #pragma GCC target ("arch=armv8-a+crc") It also supports a short hand where an extension is just added to the current architecture without changing it #pragma GCC target ("+crc") Popping and pushing options also correctly reconfigure the global state as expected. Also supported is using the __attribute__((target("..."))) attributes on functions to change the architecture or extension. Regtested on arm-none-eabi and no regressions. Ok for trunk? gcc/ 2017-11-06 Tamar Christina PR target/82641 * config/arm/arm.c (arm_valid_target_attribute_rec): Parse "arch=" and "+". (arm_valid_target_attribute_tree): Re-init global options. (arm_option_override): Make non-static. (arm_options_perform_arch_sanity_checks): Make errors fatal. * gcc/config/arm/arm-c.c (__ARM_FEATURE_CMSE): Support undef. (__ARM_FEATURE_CRC32): Support undef. * config/arm/arm_acle.h (__ARM_FEATURE_CRC32): Replace with pragma. * doc/extend.texi (ARM Function Attributes): Add pragma and target. gcc/testsuite/ 2017-11-06 Tamar Christina PR target/82641 * gcc.target/arm/pragma_arch_attribute.c: New. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index ea47d1746fefb8dfb7981e1817edbf942d37be55..2b308fa2e3d5274682cc32dd9b91712c5604267e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3297,6 +3297,7 @@ arm_configure_build_target (struct arm_build_target *target, target->tune_flags = tune_data->tune_flags; target->tune = tune_data->tune; target->tune_core = tune_data->scheduler; + arm_option_reconfigure_globals (); } /* Fix up any incompatible options that the user has specified. */ @@ -30642,7 +30643,7 @@ arm_valid_target_attribute_rec (tree args, struct gcc_options *opts) if (! opt_enum_arg_to_value (OPT_mfpu_, q+4, &fpu_index, CL_TARGET)) { - error ("invalid fpu for attribute(target(\"%s\"))", q); + error ("invalid fpu for target attribute or pragma %qs", q); return false; } if (fpu_index == TARGET_FPU_auto) @@ -30655,9 +30656,29 @@ arm_valid_target_attribute_rec (tree args, struct gcc_options *opts) } opts->x_arm_fpu_index = (enum fpu_type) fpu_index; } + else if (!strncmp (q, "arch=", 5)) + { + char* arch = q+5; + const arch_option *arm_selected_arch + = arm_parse_arch_option_name (all_architectures, "arch", arch); + + if (!arm_selected_arch) + { + error ("invalid architecture for target attribute or pragma %qs", + q); + return false; + } + + opts->x_arm_arch_string = xstrndup (arch, strlen (arch)); + } + else if (q[0] == '+') + { + opts->x_arm_arch_string + = xasprintf ("%s%s", opts->x_arm_arch_string, q); + } else { - error ("attribute(target(\"%s\")) is unknown", q); + error ("unknown target attribute or pragma %qs", q); return false; } } @@ -30679,7 +30700,10 @@ arm_valid_target_attribute_tree (tree args, struct gcc_options *opts, cl_target_option_save (&cl_opts, opts); arm_configure_build_target (&arm_active_target, &cl_opts, opts_set, false); arm_option_check_internal (opts); - /* Do any overrides, such as global options arch=xxx. */ + /* Do any overrides, such as global options arch=xxx. + We do this since arm_active_target was overridden. */ + arm_option_reconfigure_globals (); + arm_options_perform_arch_sanity_checks (); arm_option_override_internal (opts, opts_set); return build_target_option_node (opts); diff --git a/gcc/config/arm/arm_acle.h b/gcc/config/arm/arm_acle.h index 972e28edb86c1f137e16982acc6f346e0eac04fb..ad28a45866df8dadd7d4c830efc7e8494f41716a 100644 --- a/gcc/config/arm/arm_acle.h +++ b/gcc/config/arm/arm_acle.h @@ -173,7 +173,10 @@ __arm_mrrc2 (const unsigned int __coproc, const unsigned int __opc1, #endif /* __ARM_ARCH >= 5. */ #endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */ -#ifdef __ARM_FEATURE_CRC32 +#pragma GCC push_options +#if __ARM_ARCH >= 8 +#pragma GCC target ("arch=armv8-a+crc") + __extension__ static __inline uint32_t __attribute__ ((__always_inline__)) __crc32b (uint32_t __a, uint8_t __b) { @@ -232,7 +235,8 @@ __crc32cd (uint32_t __a, uint64_t __b) } #endif -#endif +#endif /* __ARM_ARCH >= 8. */ +#pragma GCC pop_options #ifdef __cplusplus } diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 8aa443f87fb700f7a723d736bdbd53b6c839656d..18d0ffa6820326ce7badf33001b1c6a467c95883 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -3858,6 +3858,42 @@ Specifies the fpu for which to tune the performance of this function. The behavior and permissible arguments are the same as for the @option{-mfpu=} command-line option. +@item arch= +@cindex @code{arch=} function attribute, ARM +Specifies the architecture version and architectural extensions to use +for this function. The behavior and permissible arguments are the same as +for the @option{-march=} command-line option. + +The above target attributes can be specified as follows: + +@smallexample +__attribute__((target("@var{attr-string}"))) +int +f (int a) +@{ + return a + 5; +@} +@end smallexample + +where @code{@var{attr-string}} is one of the attribute strings. + +Additionally, the architectural extension string may be specified on its +own. This can be used to turn on and off particular architectural extensions +without having to specify a particular architecture version or core. Example: + +@smallexample +__attribute__((target("+crc+nocrypto"))) +int +foo (int a) +@{ + return a + 5; +@} +@end smallexample + +In this example @code{target("+crc+nocrypto")} enables the @code{crc} +extension and disables the @code{crypto} extension for the function @code{foo} +without modifying an existing @option{-march=} or @option{-mcpu} option. + @end table @end table diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c new file mode 100644 index 0000000000000000000000000000000000000000..a06dbf04037384e98b6b9eaf5ab90b04a09a6d07 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_attribute.c @@ -0,0 +1,54 @@ +/* Test for #pragma target macros. */ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v8a_ok } */ +/* { dg-add-options arm_arch_v8a } */ + +#include + +#ifdef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is already defined." +#endif + +#pragma GCC push_options +#pragma GCC target ("arch=armv8-a+crc") +#ifndef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is not defined in push 1." +#endif +#pragma GCC pop_options + +#ifdef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is defined after pop 1." +#endif + +#pragma GCC push_options +#pragma GCC target ("+crc") +#ifndef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is not defined in push 2." +#endif +#pragma GCC pop_options + +#ifdef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is defined after pop 2." +#endif + +__attribute__((target("+crc"))) +void test_crc_unknown_ok_attr_1 () +{ + __crc32b (0, 0); +} + +#ifdef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is defined after attribute set 1." +#endif + +__attribute__((target("arch=armv8-a+crc"))) +void test_crc_unknown_ok_attr_2 () +{ + __crc32b (0, 0); +} + +#ifdef __ARM_FEATURE_CRC32 +# error "__ARM_FEATURE_CRC32 is defined after attribute set 2." +#endif + +#pragma GCC reset_options \ No newline at end of file