Skip to content

Accepts compiler_builtins and no_builtins attribute.#4488

Open
P-E-P wants to merge 2 commits intoRust-GCC:masterfrom
P-E-P:rfl-compiler-builtins-attributes
Open

Accepts compiler_builtins and no_builtins attribute.#4488
P-E-P wants to merge 2 commits intoRust-GCC:masterfrom
P-E-P:rfl-compiler-builtins-attributes

Conversation

@P-E-P
Copy link
Member

@P-E-P P-E-P commented Mar 13, 2026

Accepts those two attributes as internal builtins. Do not use/lower them.

P-E-P added 2 commits March 12, 2026 16:52
This attribute shall be accepted/rejected depending on the feature
activation status.

gcc/rust/ChangeLog:

	* checks/errors/feature/rust-feature-gate.cc (FeatureGate::visit):
	Rework visit to avoid multiple iterations. Add check for
	"compiler_builtins" attribute.
	(FeatureGate::check_no_core_attribute): Remove loop.
	* checks/errors/feature/rust-feature-gate.h: Update function prototype.
	* util/rust-attribute-values.h: Add "compiler_builtins" attribute
	value.
	* util/rust-attributes.cc: Add "compiler_builtins" to the list of
	builtin attributes.

gcc/testsuite/ChangeLog:

	* rust/compile/compiler_builtins_gate.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:

	* util/rust-attribute-values.h: Add "no_builtins"
	attribute value.
	* util/rust-attributes.cc: Add "no_builtins" to
	the list of builtin attributes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant