https://gcc.gnu.org/g:be6aec966bde3f63c4093dc53ed200a4a661fbbd
commit r17-5703-gbe6aec966bde3f63c4093dc53ed200a4a661fbbd Author: Arthur Cohen <[email protected]> Date: Thu Oct 22 15:48:32 2026 +0200 gccrs: intrinsics: Fix invalid error check after improvements to builtin lookup Since types are apparently just for fun, don't compare a tl::optional<tree> and a tree and first check if the returned value is a valid option. gcc/rust/ChangeLog: * backend/rust-intrinsic-handlers.cc (ctlz_handler): Fix assertion after builtin lookup. Diff: --- gcc/rust/backend/rust-intrinsic-handlers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/backend/rust-intrinsic-handlers.cc b/gcc/rust/backend/rust-intrinsic-handlers.cc index 3daef61859b8..2495de0a5d38 100644 --- a/gcc/rust/backend/rust-intrinsic-handlers.cc +++ b/gcc/rust/backend/rust-intrinsic-handlers.cc @@ -700,7 +700,7 @@ ctlz_handler (IntrinsicCtx &ctx, bool nonzero) auto builtin_decl = BuiltinsContext::get ().lookup_simple_builtin (builtin_name); - rust_assert (builtin_decl != error_mark_node); + rust_assert (builtin_decl); tree builtin_fn = build_fold_addr_expr_loc (locus, *builtin_decl); tree clz_expr
