{"id":2215804,"url":"http://patchwork.ozlabs.org/api/patches/2215804/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/20260325110008.3125-1-gerris.rs@gmail.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260325110008.3125-1-gerris.rs@gmail.com>","list_archive_url":null,"date":"2026-03-25T11:00:07","name":"[gccrs,COMMIT,1/2] Accepts \"compiler_builtins\" attribute","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"240cffd8d7f0f41adda161e1337eae22686916c3","submitter":{"id":92092,"url":"http://patchwork.ozlabs.org/api/people/92092/?format=json","name":null,"email":"gerris.rs@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/20260325110008.3125-1-gerris.rs@gmail.com/mbox/","series":[{"id":497420,"url":"http://patchwork.ozlabs.org/api/series/497420/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=497420","date":"2026-03-25T11:00:07","name":"[gccrs,COMMIT,1/2] Accepts \"compiler_builtins\" attribute","version":1,"mbox":"http://patchwork.ozlabs.org/series/497420/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215804/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215804/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=k8h/Owlo;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=k8h/Owlo","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.222.181"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgkVx2X8Lz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 22:01:45 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 1B6A74BA2E1A\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 11:01:43 +0000 (GMT)","from mail-qk1-f181.google.com (mail-qk1-f181.google.com\n [209.85.222.181])\n by sourceware.org (Postfix) with ESMTPS id 8D4114BB5919\n for <gcc-patches@gcc.gnu.org>; Wed, 25 Mar 2026 11:00:10 +0000 (GMT)","by mail-qk1-f181.google.com with SMTP id\n af79cd13be357-8cfd44fa075so301260785a.0\n for <gcc-patches@gcc.gnu.org>; Wed, 25 Mar 2026 04:00:10 -0700 (PDT)","from\n runnervm46oaq.zzosww5kenvepmod4gf1ivnhag.bx.internal.cloudapp.net\n ([40.76.191.135]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-89cc42e67a7sm26312856d6.10.2026.03.25.04.00.08\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 04:00:09 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 1B6A74BA2E1A","OpenDKIM Filter v2.11.0 sourceware.org 8D4114BB5919"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 8D4114BB5919","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 8D4114BB5919","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774436410; cv=none;\n b=uZ6Oqb4lFh56wD8Rn6ZV46WrnhI6rsE2mqQHdvrezUmq5gB0ur1BWWa1eRaH5flZiC8pMP2vqFzvasXEPwNP7n3CLOHbEtpCiXlImtMGfwzKrQwa0cnG+c+noVamklaJaTB2A75rM04I4KsPdfTlHizZsNH5sWoPGzTB87MNLDU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774436410; c=relaxed/simple;\n bh=gDrNQQga5uj3YA8RoOGqEOkDGNYToW/p19gZjKohspw=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=UMnaUd8ZCqXrZQ3uvzjUYwTnRkZTWNDNlHN5VAe5DMDvuwvcMNe04pZLR9ZLnigntAKm3vhoxNhXdW5eKeYfN0LTYkvhCMO0Yk3S8IoCXVR2zFix4Zf+tERbMIxVoq4gO/4BV5QHLNKcHAHog4iTd21JOk4GzKc+6eq6zEtRs7g=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1774436410; x=1775041210; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=+FoVVaUqxpzWFBsky13E8Hyka73IWinY8wHg+Q0hLdw=;\n b=k8h/OwloZl3+5+Jz7JuRVPyXfzJJOe+81SKDULE3cn+I7yBD5L/xUSB15nd/I53gGK\n NGx4eh2B1Za/zPdQNDxqJv7IF/7Wrpv4wJs1isYHstxIkQropRk6RSrBk7V1hLFDiCAz\n Eszn/C1xUdK08P0VV717VEy4YbydbMMpAjn1rlci8dmnQJGNzPREHlzEsWtl8eMfdcUB\n 10tXYrQgsYcGl3l09D/tiJmL8AKhmxDMW3iHXBGILsHTotqR/Kf246kLHQegxh8NF6gf\n H6mQeVRoyBcOwGvejBgUbcz4tx1mOLNh28jBaEMYFLciiANXt9bVkf+RR4xgBeYmrHbQ\n AikQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774436410; x=1775041210;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=+FoVVaUqxpzWFBsky13E8Hyka73IWinY8wHg+Q0hLdw=;\n b=ljj5GKm0eHED4CDEvfdFSKATW72c4Su2sD7kHLbgSUqaqO3rJAYAMmArKhmyKYgiKL\n JQgpjbpf2Qq/RJ1/Zhgz3ndeLmiMxvKi1mdIeqZ7l3Pva7zcBuVbNBm0vb/Z2/R6zpBQ\n 71i7Ctbt1CwH1NU0vZ3myjavGj0DqPQ1N4dJEo6MLxwnVEg/LfjpQ0U8q+uPj1GsFfNX\n +2RTgZjLphc/uK/iEyMWD61Y3R/JdcC6IhWajkH/qn6EukV4+7qowcQ28L1PEOBV+3I6\n 83DK0z8KOhdmhvnM6aSELp7Twrz3mPxLXQD0DeJpRK8tjhTVhxDSuI4Ux/ZkTsE0YMKi\n elQg==","X-Gm-Message-State":"AOJu0YycS8L2ObClCrECp5dxj6UD0hSBMeq2qPX7hmYHkqpm5dcSSqWx\n a+4nymeaXhX1qPQ12PRo+opUGLr1vF5siDssY8bIBIOAK2ZstEfaikKlAhUb5Q==","X-Gm-Gg":"ATEYQzz19UQFoEY7eQvr6JCxF/WsyaQ8oK6h2Be8oMVP5w2t+uCxBkFq1EpFG3HZpBa\n T+h1vTNBVM+IO651dDR4ZJ3wbqeYAn5uZEUwpclg8NxdJQA+EPGnEKe9m0fBGn0lRc2xRJGwjEK\n gaNDd7ihqpdQaS0ew7ivAT8CkNJ+z/eDfmMIg7Ia+RSHsmko83mogYS9Hzh6yB5mhYoZiRxqMsc\n cKpYxeD9hVcF1nSF4HPjC/wAGdnBK22e4XH97JkvMijH0zloGt6iC5cE7Zia+FdYlc7aVICBRP0\n kngWB7HSgX7V5+UgfrvsErhrsxVdAyHTt2jZ9jEcG7c7IMSJF48S8R1SfaPzxpsHxI5O9yk+UWw\n B0/Cc389LY+7QSS/pXrjGMGoAMWn3OvKRMDWSwox1ZYjfxiAQI9UzetiemrXgGVqU5AIFBk4mG9\n vhl3+kRso8Mo/E0Lijn2bgCWLZtGMkmEBmv5Di58HdalyjN1U08t/G2BkmQZ9ZgYcqsWdJHij4x\n LZxBg98nOu9RtX+BxkR","X-Received":"by 2002:a05:620a:4403:b0:8cd:9653:61d8 with SMTP id\n af79cd13be357-8d001039552mr393199885a.55.1774436409595;\n Wed, 25 Mar 2026 04:00:09 -0700 (PDT)","From":"gerris.rs@gmail.com","To":"gcc-patches@gcc.gnu.org,\n\tgcc-rust@gcc.gnu.org","Cc":"pierre-emmanuel.patry@embecosm.com, arthur.cohen@embecosm.com,\n dkm+gccrs@kataplop.net","Subject":"[gccrs COMMIT 1/2] Accepts \"compiler_builtins\" attribute","Date":"Wed, 25 Mar 2026 11:00:07 +0000","Message-ID":"<20260325110008.3125-1-gerris.rs@gmail.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <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>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>\n\nThis attribute shall be accepted/rejected depending on the feature\nactivation status.\n\ngcc/rust/ChangeLog:\n\n\t* checks/errors/feature/rust-feature-gate.cc (FeatureGate::visit):\n\tRework visit to avoid multiple iterations. Add check for\n\t\"compiler_builtins\" attribute.\n\t(FeatureGate::check_no_core_attribute): Remove loop.\n\t* checks/errors/feature/rust-feature-gate.h: Update function prototype.\n\t* util/rust-attribute-values.h: Add \"compiler_builtins\" attribute\n\tvalue.\n\t* util/rust-attributes.cc: Add \"compiler_builtins\" to the list of\n\tbuiltin attributes.\n\ngcc/testsuite/ChangeLog:\n\n\t* rust/compile/compiler_builtins_gate.rs: New test.\n\nSigned-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>\n---\nThis change was merged into the gccrs repository and is posted here for\nupstream visibility and potential drive-by review, as requested by GCC\nrelease managers.\nEach commit email contains a link to its details on github from where you can\nfind the Pull-Request and associated discussions.\n\n\nCommit on github: https://github.com/Rust-GCC/gccrs/commit/2ab0ae2496f87eb3b09af94e944a464e1c3cf083\n\nThe commit has been mentioned in the following pull-request(s):\n - https://github.com/Rust-GCC/gccrs/pull/4488\n\n .../errors/feature/rust-feature-gate.cc       | 24 ++++++++++++-------\n .../checks/errors/feature/rust-feature-gate.h |  2 +-\n gcc/rust/util/rust-attribute-values.h         |  2 ++\n gcc/rust/util/rust-attributes.cc              |  1 +\n .../rust/compile/compiler_builtins_gate.rs    |  3 +++\n 5 files changed, 22 insertions(+), 10 deletions(-)\n create mode 100644 gcc/testsuite/rust/compile/compiler_builtins_gate.rs\n\n\nbase-commit: 2889c50e2031a865b5704ef60f3463d0f8b05c31","diff":"diff --git a/gcc/rust/checks/errors/feature/rust-feature-gate.cc b/gcc/rust/checks/errors/feature/rust-feature-gate.cc\nindex 7e2105977..8c6d5ba2f 100644\n--- a/gcc/rust/checks/errors/feature/rust-feature-gate.cc\n+++ b/gcc/rust/checks/errors/feature/rust-feature-gate.cc\n@@ -63,7 +63,17 @@ FeatureGate::visit (AST::Crate &crate)\n       rust_error_at (locus, ErrorCode::E0635, \"unknown feature %qs\",\n \t\t     feature.c_str ());\n     }\n-  check_no_core_attribute (crate.inner_attrs);\n+  for (const auto &attribute : crate.inner_attrs)\n+    {\n+      check_no_core_attribute (attribute);\n+\n+      if (attribute.get_path ().as_string ()\n+\t  == Values::Attributes::COMPILER_BUILTINS)\n+\tgate (Feature::Name::COMPILER_BUILTINS, attribute.get_locus (),\n+\t      \"the #[compiler_builtins] attribute is used to identify the \"\n+\t      \"compiler_builtins crate which contains compiler-rt intrinsics \"\n+\t      \"and will never be stable\");\n+    }\n }\n \n void\n@@ -110,15 +120,11 @@ FeatureGate::visit (AST::ExternBlock &block)\n }\n \n void\n-FeatureGate::check_no_core_attribute (\n-  const std::vector<AST::Attribute> &attributes)\n+FeatureGate::check_no_core_attribute (const AST::Attribute &attribute)\n {\n-  for (const AST::Attribute &attr : attributes)\n-    {\n-      if (attr.get_path ().as_string () == Values::Attributes::NO_CORE)\n-\tgate (Feature::Name::NO_CORE, attr.get_locus (),\n-\t      \"no_core is experimental\");\n-    }\n+  if (attribute.get_path ().as_string () == Values::Attributes::NO_CORE)\n+    gate (Feature::Name::NO_CORE, attribute.get_locus (),\n+\t  \"no_core is experimental\");\n }\n \n void\ndiff --git a/gcc/rust/checks/errors/feature/rust-feature-gate.h b/gcc/rust/checks/errors/feature/rust-feature-gate.h\nindex 0675777e0..e8bb61b1f 100644\n--- a/gcc/rust/checks/errors/feature/rust-feature-gate.h\n+++ b/gcc/rust/checks/errors/feature/rust-feature-gate.h\n@@ -54,7 +54,7 @@ public:\n \n private:\n   void gate (Feature::Name name, location_t loc, const std::string &error_msg);\n-  void check_no_core_attribute (const std::vector<AST::Attribute> &attributes);\n+  void check_no_core_attribute (const AST::Attribute &attribute);\n   void check_rustc_attri (const std::vector<AST::Attribute> &attributes);\n   void\n   check_may_dangle_attribute (const std::vector<AST::Attribute> &attributes);\ndiff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h\nindex 7f0b5ca78..7743d9091 100644\n--- a/gcc/rust/util/rust-attribute-values.h\n+++ b/gcc/rust/util/rust-attribute-values.h\n@@ -82,6 +82,8 @@ public:\n   static constexpr auto &RUSTC_LAYOUT_SCALAR_VALID_RANGE_START\n     = \"rustc_layout_scalar_valid_range_start\";\n \n+  static constexpr auto &COMPILER_BUILTINS = \"compiler_builtins\";\n+\n   static constexpr auto &MAY_DANGLE = \"may_dangle\";\n   static constexpr auto &PRELUDE_IMPORT = \"prelude_import\";\n   static constexpr auto &TRACK_CALLER = \"track_caller\";\ndiff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc\nindex 93d71a490..cc898971e 100644\n--- a/gcc/rust/util/rust-attributes.cc\n+++ b/gcc/rust/util/rust-attributes.cc\n@@ -122,6 +122,7 @@ static const BuiltinAttrDefinition __definitions[]\n      {Attrs::RUSTC_LAYOUT_SCALAR_VALID_RANGE_START, CODE_GENERATION},\n      // TODO: be careful about calling functions marked with this?\n      {Attrs::RUSTC_ARGS_REQUIRED_CONST, CODE_GENERATION},\n+     {Attrs::COMPILER_BUILTINS, CODE_GENERATION},\n      {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},\n      {Attrs::RUSTC_DIAGNOSTIC_ITEM, STATIC_ANALYSIS},\n      {Attrs::RUSTC_ON_UNIMPLEMENTED, STATIC_ANALYSIS},\ndiff --git a/gcc/testsuite/rust/compile/compiler_builtins_gate.rs b/gcc/testsuite/rust/compile/compiler_builtins_gate.rs\nnew file mode 100644\nindex 000000000..3417be025\n--- /dev/null\n+++ b/gcc/testsuite/rust/compile/compiler_builtins_gate.rs\n@@ -0,0 +1,3 @@\n+#![feature(no_core)]\n+#![no_core]\n+#![compiler_builtins] // { dg-error \"the ..compiler_builtins. attribute is used to identify the compiler_builtins\" }\n","prefixes":["gccrs","COMMIT","1/2"]}