From: Arthur Cohen <[email protected]>

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.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/1802a910670dbde3560853f0a61f68b9d9f5a9b6

The commit has NOT been mentioned in any issue.

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/5011

 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 3daef6185..2495de0a5 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

base-commit: 6b289249b51331e1640080ca90518ed85426a0d5
-- 
2.55.0

Reply via email to