Message ID | 20230221120230.596966-59-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1836416wrn; Tue, 21 Feb 2023 04:35:57 -0800 (PST) X-Google-Smtp-Source: AK7set+KWfEUoLCFS+XwwRDqjQNPqWGomb9hWXyMHx6ATcDuYbq4EHDccWgAOvMsyFL3jEy+oWIG X-Received: by 2002:aa7:d515:0:b0:4ab:db9e:9682 with SMTP id y21-20020aa7d515000000b004abdb9e9682mr4520829edq.34.1676982957582; Tue, 21 Feb 2023 04:35:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676982957; cv=none; d=google.com; s=arc-20160816; b=N9bKkDrFSqvov0/Q/zmfvlWN+fBdKYiPf5OuO8cIUN7wx6tCOtTRGUaKApouX7dzLS ys8MnOD+Br9zDqDNzjx0f35cbe4Xad3VNDq38vSLDbROPLbVyNcmAIB0EZ0bQMUoXFvd qxt80tKvmh7IxBFCNaoms5iuclSjQF3fl0Q9J1c9zYeKjGF31JIFSVrhtW9p/jG0hpc5 qgN2xi3AQeQrqvpQc7P7c2uaED+PWWlLVLQFDTmyM8vPHfWYN4vR1OpXW3AkE9j2mR8T ij+BiHJKM3eQ5T0PHn2BdOMVfC97u6EnomlbWoiuqe7VHdbNr8f/mBkpCKMEfYq0Ywt7 rPIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=cS4jfXy0zd9Z4iDHTUS/X0Jl6KbAr7Z+iQWYT2shEVc=; b=D1f6gJF5t/omlGA1SGlPNl3njSgs/OGM7xzOPoaNiQvvcv8RVGPrJsxByG5k6M1I+o cJ1FXYJkUS5SetSF7DtNfdk22J60cmM6AEOcz0mH4yuWAZNXzoob1c0tg5+ECjQ1Ddi8 ttum2e5NmPMcjcqg8+9CAKHMssLGjJ6f2Cedg6Xbme0OQX16ADCmhhVj4oe0v14rMffq oKR/1t78eOfUls5mfb7WV5vgwkN1vOlsl/9W/pPA8m7PUmt9UuQB0Hu8dMogaOS35fA5 ggI1BPS8ilJwPJYwHijF2SlM+TF00DCPkgJFGcfQWimCWC8YYEZU0qag2UpmI/X9B98R 6LwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=D3GHJglk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u24-20020a056402065800b004ace603c65csi3793506edx.247.2023.02.21.04.35.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:35:57 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=D3GHJglk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15A5C3932E03 for <ouuuleilei@gmail.com>; Tue, 21 Feb 2023 12:12:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 1683638493E8 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 12:04:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1683638493E8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42a.google.com with SMTP id t15so4268473wrz.7 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 04:04:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=cS4jfXy0zd9Z4iDHTUS/X0Jl6KbAr7Z+iQWYT2shEVc=; b=D3GHJglkZt4pN+lNvQgmKAzjnmyISuOyvQwdvNgeaBbj7f1QWwsgnNGzyfBVLhrfWl ydoj02vn19T5N7RgG1Ed1Ch3cLWe3mI0Y33ITO9v5u9WxQm0w15Ll7FYr3+MS26NZ3e1 3gO/tNVcsGCLbHiqCo4EQAUSzRnNeY/Ts5erS4J+oBUBC8xgS228kJ4k0xnuHmXI3FkY J3KRLFEA8wzK31mhSCwmpeomHm4479qkBn17ST1e+/0iy34AK68cCeSkyXj7g+pJntXq PbpACiMmFU3MyhGMgQ5svumljQiw4O+4VBfRWMXlDio4n1CuP59D4DP2NwFktY8b9EI4 qvAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cS4jfXy0zd9Z4iDHTUS/X0Jl6KbAr7Z+iQWYT2shEVc=; b=FFcD/HbjOlJS5wPDnpKwLRWPIILt69vw9ODy22Ea6nurk5sCZsoTn0NtJey1z+sABp tJJEQqPJF4MvIXQf8lUYaJcTc7AdFIk/qUY9fPGEmNw4k2RBbqZhW/JwTBUAcxhyhQIu T1I5UAlK1/egPTy0m2ZnIUajVXdxiQO0VStfUOx3WVc7M3Goug5h1efrqnr1wJdb5d/Y MgSa3EJWsxqQj6XsBjdzT5DU+ZQhbyoNgkP6mC0xsLt895qHOnFlvit62JUTa32i4D21 AwCcT6RczfOit0sn9mwWA1hIThyOp+NYYoqKumAIovnXMEcmry9HlgFwApw9LEzXilOz usFA== X-Gm-Message-State: AO0yUKV8PbId2Cxd1NIVxJbW58BMnVwlU7Rgi5guYDTpq82nal5zlKtd zJoW0Fd/2yvKKAH/kOJZGwAIj3vJ7S7dbi8PSA== X-Received: by 2002:a5d:62c7:0:b0:2c5:55cf:b1ab with SMTP id o7-20020a5d62c7000000b002c555cfb1abmr2463146wrv.48.1676981049324; Tue, 21 Feb 2023 04:04:09 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:09 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen <arthur.cohen@embecosm.com> Subject: [committed 058/103] gccrs: intrinsics: Add `sorry_handler` intrinsic handler Date: Tue, 21 Feb 2023 13:01:48 +0100 Message-Id: <20230221120230.596966-59-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758444082244810075?= X-GMAIL-MSGID: =?utf-8?q?1758444082244810075?= |
Series |
[committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 21, 2023, 12:01 p.m. UTC
From: Arthur Cohen <arthur.cohen@embecosm.com>
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler.
gcc/testsuite/ChangeLog:
* rust/compile/torture/intrinsics-3.rs: New test.
---
gcc/rust/backend/rust-compile-intrinsic.cc | 10 ++++++++++
gcc/testsuite/rust/compile/torture/intrinsics-3.rs | 9 +++++++++
2 files changed, 19 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/torture/intrinsics-3.rs
diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index a418b863210..2a2091ccc25 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -93,6 +93,15 @@ prefetch_write_data (Context *ctx, TyTy::FnType *fntype) return prefetch_data_handler (ctx, fntype, Prefetch::Write); } +static inline tree +sorry_handler (Context *ctx, TyTy::FnType *fntype) +{ + rust_sorry_at (fntype->get_locus (), "intrinsic %qs is not yet implemented", + fntype->get_identifier ().c_str ()); + + return error_mark_node; +} + static const std::map<std::string, std::function<tree (Context *, TyTy::FnType *)>> generic_intrinsics = { @@ -107,6 +116,7 @@ static const std::map<std::string, {"copy_nonoverlapping", ©_nonoverlapping_handler}, {"prefetch_read_data", &prefetch_read_data}, {"prefetch_write_data", &prefetch_write_data}, + {"atomic_load", &sorry_handler}, }; Intrinsics::Intrinsics (Context *ctx) : ctx (ctx) {} diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-3.rs b/gcc/testsuite/rust/compile/torture/intrinsics-3.rs new file mode 100644 index 00000000000..1acb3533c08 --- /dev/null +++ b/gcc/testsuite/rust/compile/torture/intrinsics-3.rs @@ -0,0 +1,9 @@ +extern "rust-intrinsic" { + fn not_an_intrinsic(); + fn atomic_load(); // { dg-message "sorry, unimplemented: intrinsic .atomic_load. is not yet implemented" } +} + +fn main() { + unsafe { not_an_intrinsic() }; // { dg-error "unknown builtin intrinsic: not_an_intrinsic" } + unsafe { atomic_load() }; +}