From patchwork Mon May 1 14:28:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 757198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wGmxj09Bcz9sN9 for ; Tue, 2 May 2017 00:28:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="HqBfuaHk"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=oMWSFrKw94zBwy1kUihQvezfy6DCg2H5Swg4rVyhQY9M0+MGlR iqGiT3qlLR0/klvi+nvJj/R4Aimu3Hgu3LBKZXupmgtEZVDx5MRiZNxCzqTBQdLx sOLTOLx0axBAVjlotZ2APl9m+GBXSUpRoazOtMmOeCNy2r2hFLO/7Fx0o= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=xYAwU3LsqwUK31f/KREjvqNpnqw=; b=HqBfuaHkY4wae+pXf7dv MNdgCPGVlH52ABUsXsxAL5rcLEQS3BSXXD3PVYTWNWCPVgjgV6jHG3nof7XYQV1b 20MNmXU0YFc6I9bh827q/XBERbPBXfFxWKI4/3w/Hti+SxNBIqKZ5b9ToxsujV79 1Q4ZvHP5NQLHz/fE9w7fhhE= Received: (qmail 14239 invoked by alias); 1 May 2017 14:28:26 -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 14211 invoked by uid 89); 1 May 2017 14:28:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:2101, atm X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 May 2017 14:28:22 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1d5CJJ-0003dD-Ko from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Mon, 01 May 2017 07:28:21 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 1 May 2017 15:28:18 +0100 To: GCC Patches From: Tom de Vries Subject: [testsuite, committed, PR65941] Add and use effective target rdrand Message-ID: Date: Mon, 1 May 2017 16:28:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, atm I get these failures for x86_64 -m32: ... FAIL: g++.dg/other/pr59492.C -std=gnu++11 (test for excess errors) FAIL: g++.dg/other/pr59492.C -std=gnu++14 (test for excess errors) FAIL: g++.dg/other/pr59492.C -std=gnu++98 (test for excess errors) ... More specifically: ... /tmp/ccSwV0hl.s: Assembler messages: /tmp/ccSwV0hl.s:24: Error: no such instruction: `rdrand %edx' compiler exited with status 1 ... This patch turns the FAIL into an UNSUPPORTED. Committed as obvious. Thanks, - Tom Add and use effective target rdrand 2017-05-01 Tom de Vries PR testsuite/65941 * lib/target-supports.exp (check_effective_target_rdrand): New proc. * g++.dg/other/pr59492.C: Require effective target rdrand. --- gcc/testsuite/g++.dg/other/pr59492.C | 1 + gcc/testsuite/lib/target-supports.exp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/testsuite/g++.dg/other/pr59492.C b/gcc/testsuite/g++.dg/other/pr59492.C index 84bd255..92694ae 100644 --- a/gcc/testsuite/g++.dg/other/pr59492.C +++ b/gcc/testsuite/g++.dg/other/pr59492.C @@ -2,6 +2,7 @@ // { dg-options "-mx32 -fPIC" } // { dg-require-ifunc "" } // { dg-require-effective-target maybe_x32 } +// { dg-require-effective-target rdrand } void __throw_runtime_error(const char*) __attribute__((__noreturn__)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 342af27..83e7f26 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8296,6 +8296,20 @@ proc check_effective_target_store_merge { } { return 0 } +# Return 1 if we're able to assemble rdrand + +proc check_effective_target_rdrand { } { + return [check_no_compiler_messages_nocache rdrand object { + unsigned int + __foo(void) + { + unsigned int val; + __builtin_ia32_rdrand32_step(&val); + return val; + } + } "-mrdrnd" ] +} + # Return 1 if the target supports coprocessor instructions: cdp, ldc, stc, mcr and # mrc. proc check_effective_target_arm_coproc1_ok_nocache { } {