aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-21d: Merge upstream dmd, druntime 09faa4eacd, phobos 13ef27a56.Iain Buclaw253-999/+2627
D front-end changes: - Import dmd v2.102.0-beta.1 - `static assert' now supports multiple message arguments. D runtime changes: - Import druntime v2.102.0-beta.1 - The default `Throwable.TraceInfo' generation now is `@nogc'. - `Object.factory' method has now been deprecated. Phobos changes: - Import phobos v2.102.0-beta.1 - Added float- and double-precision implementations for log function families in std.math. - `std.typecons.Unique' now calls `destroy` on struct types gcc/d/ChangeLog: * Make-lang.in (D_FRONTEND_OBJS): Add d/location.o. * d-lang.cc (d_init_options): Update for new front-end interface. (d_post_options): Call Loc::set after handling options. * dmd/MERGE: Merge upstream dmd 09faa4eacd. * dmd/VERSION: Bump version to v2.102.0-beta.1. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 09faa4eacd. * src/MERGE: Merge upstream phobos 13ef27a56. * testsuite/libphobos.exceptions/refcounted.d: Add test for chained reference counted exceptions. * testsuite/libphobos.shared/finalize.d: Add dg-warning for deprecated factory interfaces. * testsuite/libphobos.gc/issue22843.d: New test. gcc/testsuite/ChangeLog: * gdc.dg/simd2a.d: Update. * gdc.dg/simd2b.d: Update. * gdc.dg/simd2c.d: Update. * gdc.dg/simd2d.d: Update. * gdc.dg/simd2e.d: Update. * gdc.dg/simd2f.d: Update. * gdc.dg/simd2g.d: Update. * gdc.dg/simd2h.d: Update. * gdc.dg/simd2i.d: Update. * gdc.dg/simd2j.d: Update.
2023-02-21d: Only handle the left-to-right evaluation of a call expression during gimplifyIain Buclaw2-26/+12
Removes an unnecessary rewriting of the front-end AST during lowering. gcc/d/ChangeLog: * d-codegen.cc (d_build_call): Remove front-end expansion of side-effects in a call expression. * d-gimplify.cc (d_gimplify_call_expr): Gimplify the callee before its arguments.
2023-02-21d: Set doing_semantic_analysis_p before calling functionSemantic3Iain Buclaw2-0/+57
As functions which have semantic analysis ran late may still require the use of CTFE built-ins to be evaluated. gcc/d/ChangeLog: * decl.cc (DeclVisitor::visit (FuncDeclaration *)): Set doing_semantic_analysis_p before calling functionSemantic3. gcc/testsuite/ChangeLog: * gdc.dg/ctfeintrinsics.d: New test.
2023-02-21libphobos: Add @nogc to gcc.backtrace and gcc.libbacktrace modules.Iain Buclaw2-12/+12
libphobos/ChangeLog: * libdruntime/gcc/backtrace.d (simpleErrorCallback): Add @nogc. (LibBacktrace.initLibBacktrace): Likewise. (LibBacktrace.this): Likewise. (UnwindBacktrace.this): Likewise. (getBacktrace): Likewise. (getBacktraceSymbols): Likewise. * libdruntime/gcc/libbacktrace.d.in (backtrace_create_state): Likewise. (backtrace_full): Likewise. (backtrace_simple): Likewise. (backtrace_print): Likewise. (backtrace_pcinfo): Likewise. (backtrace_syminfo): Likewise.
2023-02-21tree-optimization/108691 - remove trigger-happy assertRichard Biener2-3/+14
The following gets rid of the idea that we should prevent setjmp like calls from popping up in uncontrolled way in the IL for now. The solution is probably to handle it similar as noreturn has the ctrl-altering flag on stmts, but use another flag, for example ctrl-receiving which would also make sure the stmt is first. PR tree-optimization/108691 * tree-ssa-dce.cc (eliminate_unnecessary_stmts): Remove assert about calls_setjmp not becoming true when it was false. * gcc.dg/pr108691.c: New testcase.
2023-02-21tree-optimization/108793 - niter compute type mismatchRichard Biener2-5/+16
When computing the number of iterations until wrap types are mixed up, eventually leading to checking ICEs with a pointer bitwise inversion. The following uses niter_type for the calculation. PR tree-optimization/108793 * tree-ssa-loop-niter.cc (number_of_iterations_until_wrap): Use convert operands to niter_type when computing num. * gcc.dg/torture/pr108793.c: New testcase.
2023-02-21Update copyright years.Thomas Schwinge2-2/+2
... which accidentally had gotten reverted in recent commit r13-6156-g1e8eb102200902e12c1b00e867e338be0a92c292 "gccrs: dump: Emit visibility when dumping items".
2023-02-21gccrs: add math intrinsicsRaiki Tamura2-4/+291
gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup_math_fns): New functions. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-math.rs: New test.
2023-02-21gccrs: const evaluator: Remove get_nth_callargArthur Cohen1-16/+3
We only used one path of the C++ folder's get_nth_callarg function: CALL_EXPR_ARG. Replace all calls to get_nth_callarg by macro calls to CALL_EXPR_ARG gcc/rust/ChangeLog: * backend/rust-constexpr.cc (get_nth_callarg): Remove function. (rs_bind_parameters_in_call): Use CALL_EXPR_ARG instead. (potential_constant_expression_1): Likewise.
2023-02-21gccrs: Repair 'gcc/rust/lang.opt' commentThomas Schwinge1-3/+1
... lost in #1527 commit 138a6260124740208b8f3aff2e38617f43b05fe8 "rust: Add -frust-compile-until option". gcc/rust/ChangeLog: * lang.opt: Fix ordering of file.
2023-02-21gccrs: Cleanup unused parameters to fix the bootstrap buildPhilip Herron26-695/+661
gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Remove unused parameters. * backend/rust-constexpr.cc (constant_value_1): Likewise. (fold_non_dependent_init): Likewise. * backend/rust-tree.cc (publicly_uniquely_derived_p): Likewise. (instantiation_dependent_expression_p): Likewise. (type_has_nontrivial_copy_init): Likewise. (is_normal_capture_proxy): Likewise. (resolve_nondeduced_context): Likewise. (undeduced_auto_decl): Likewise. (require_deduced_type): Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-reachability.cc (ReachabilityVisitor::visit): Likewise. * checks/errors/privacy/rust-visibility-resolver.cc (VisibilityResolver::visit): Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise. * checks/lints/rust-lint-unused-var.cc (unused_var_walk_fn): Likewise. * expand/rust-macro-builtins.cc (try_expand_single_string_literal): Likewise. (try_expand_many_expr): Likewise. (parse_single_string_literal): Likewise. (MacroBuiltin::assert_handler): Likewise. (MacroBuiltin::file_handler): Likewise. (MacroBuiltin::column_handler): Likewise. (MacroBuiltin::concat_handler): Likewise. (MacroBuiltin::env_handler): Likewise. (MacroBuiltin::line_handler): Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise. (ASTLoweringBase::handle_doc_item_attribute): Likewise. * hir/rust-hir-dump.cc (Dump::visit): Likewise. * hir/tree/rust-hir-full-test.cc (ConstGenericParam::accept_vis): Likewise. * lex/rust-lex.cc (Lexer::parse_utf8_escape): Likewise. (Lexer::parse_string): Likewise. (Lexer::parse_char_or_lifetime): Likewise. * lex/rust-lex.h: Likewise. * metadata/rust-export-metadata.cc: Likewise. * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise. * resolve/rust-ast-resolve-type.cc (ResolveType::visit): Likewise. (ResolveTypeToCanonicalPath::visit): Likewise. * resolve/rust-ast-verify-assignee.h: Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise. * typecheck/rust-hir-type-check-expr.h: Likewise. * typecheck/rust-hir-type-check-item.h: Likewise. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise. * typecheck/rust-tyty-rules.h: Likewise. * util/rust-attributes.cc (AttributeChecker::visit): Likewise.
2023-02-21gccrs: Skip this debug test case which is failing on the latest mac-os ↵Philip Herron1-7/+8
devtools and its only for debug info gcc/testsuite/ChangeLog: * rust/debug/chartype.rs: Skip testcases on Darwin architectures.
2023-02-21gccrs: Fix undefined behaviour issues on macosPhilip Herron5-13/+38
This adds missing copy constructors to HIR::PathExprSegment which were wrongly defaulting to empty vectors when apply specified generic arguments to method calls. gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: Add const `get_method_name`. * hir/tree/rust-hir-full-decls.h (struct GenericArgs): Move from `struct`... (class GenericArgs): ...to `class`. * hir/tree/rust-hir-path.h (struct GenericArgs): Likewise. (class GenericArgs): Clear `type_args` in copy constructor. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Reorder debug print. * typecheck/rust-tyty.h: Add default constructors for `SubstitutionArgumentMappings`.
2023-02-21gccrs: Add initial support for argument capture of closuresPhilip Herron6-6/+172
When we have a closure expression that captures a parent function's variable we must setup the closure data to contain this. Ignoring moveability and mutability requires for now, this patch creates the closure structure with fields for each of the captured variables. When it comes to compilation of the closure expression in order to support nested closures we must setup a context of implicit mappings so that for all path resolution we hit this implicit closure mappings lookups code before any lookup_var_decl as this decl will not exist so the order here is important during path resolution which is a similar problem to match expression destructuring. Fixes #195 gcc/rust/ChangeLog: * backend/rust-compile-context.cc (Context::push_closure_context): New function. (Context::pop_closure_context): Likewise. (Context::insert_closure_binding): Likewise. (Context::lookup_closure_binding): Likewise. * backend/rust-compile-context.h: Declare new functions and closure mappings. * backend/rust-compile-expr.cc (CompileExpr::visit): Visit captures properly. (CompileExpr::generate_closure_function): Compile captures properly. * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Check for closure bindings. * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Compile capture list's types as well. gcc/testsuite/ChangeLog: * rust/execute/torture/closure3.rs: New test.
2023-02-21gccrs: Add capture tracking to the type info for closuresPhilip Herron3-6/+14
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Pass captures properly to `TyTy::ClosureType` constructor. * typecheck/rust-tyty.cc (ClosureType::as_string): Fix string representation. (ClosureType::clone): Pass `captures` argument. * typecheck/rust-tyty.h: Add `captures` field.
2023-02-21gccrs: Add closure binding's tracking to name resolutionPhilip Herron3-0/+159
When we have a closure block referencing variables in a parent function, we must track what these are. We do this by having a context of closures so if we have a variable reference and its declared in a rib whose node id is less than the node id of the closure's node id we know it must be a captured variable. We also need to iterate all possible closure contexts as we might be in the case of a nested closure. Addresses #195 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Use proper closure contexts. * resolve/rust-name-resolver.cc (Scope::lookup_decl_type): New function. (Scope::lookup_rib_for_decl): Likewise. (Resolver::insert_resolved_name): Insert captured items. (Resolver::push_closure_context): New function. (Resolver::pop_closure_context): Likewise. (Resolver::insert_captured_item): Likewise. (Resolver::decl_needs_capture): Likewise. (Resolver::get_captures): Likewise. * resolve/rust-name-resolver.h: Declare new functions.
2023-02-21gccrs: Refactor name resolver to take a Rib::ItemTypePhilip Herron10-41/+108
This allows us to track the type of declaration that is stored within a Rib. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add Rib argument. (ResolveExpr::resolve_closure_param): Likewise. * resolve/rust-ast-resolve-implitem.h: Likewise. * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise. (ResolveItem::visit): Likewise. * resolve/rust-ast-resolve-pattern.cc (PatternDeclaration::visit): Likewise. * resolve/rust-ast-resolve-pattern.h: Likewise. * resolve/rust-ast-resolve-stmt.h: Likewise. * resolve/rust-ast-resolve-toplevel.h: Likewise. * resolve/rust-ast-resolve-type.h: Likewise. * resolve/rust-name-resolver.cc (Rib::lookup_decl_type): Likewise. (Scope::insert): Likewise. (Resolver::insert_builtin_types): Likewise. * resolve/rust-name-resolver.h: Likewise.
2023-02-21gccrs: Get rid of make builtin macroPhilip Herron2-48/+46
This macro is a mess and a helper method is much better for this case. gcc/rust/ChangeLog: * resolve/rust-name-resolver.cc (MKBUILTIN_TYPE): Remove macro. (Rib::Rib): Remove `mappings` field. (Resolver::generate_builtins): Use `setup_builtin` instead of macro. (Resolver::setup_builtin): New function. * resolve/rust-name-resolver.h: Declare `setup_builtin`, add FIXME comment.
2023-02-21gccrs: Improve lexer dumpRaiki Tamura6-72/+72
gcc/rust/ChangeLog: * lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag. (Lexer::skip_token): Dump tokens if flag is enabled. (Lexer::dump_and_skip): New function. * lex/rust-lex.h: Include optional.h and declare functions. * parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old unused function. * parse/rust-parse.h: Likewise. * rust-session-manager.cc (Session::compile_crate): Pass lexer dump option to lexer. (Session::dump_lex): New function. * util/rust-optional.h: Add missing constructor. Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
2023-02-21gccrs: Remove default location. Add visibility location to create_* functionsDave2-19/+25
gcc/rust/ChangeLog: * ast/rust-item.h: Remoe default location for Visibility class. * parse/rust-parse-impl.h (Parser::parse_visibility): Pass proper location when instantiating visibilities.
2023-02-21gccrs: ast: Dump no comma after self in fn params if it is the last oneJakub Dupak1-4/+12
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix dumping of fn params. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump remove /* stmp */ comment to not clutter the dumpJakub Dupak1-2/+1
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Remove extraneous string when dumping statements. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Remove unused include in rust-ast-dump.ccJakub Dupak1-1/+0
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc: Remove unused include. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump generic parametersJakub Dupak2-9/+123
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. * ast/rust-ast-dump.h: Likewise. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump type param typeJakub Dupak1-1/+13
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump trait object type one boundJakub Dupak1-2/+9
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump parenthesised typeJakub Dupak1-2/+9
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump trait object typeJakub Dupak1-4/+13
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump impl trait typeJakub Dupak1-2/+10
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump impl trait type one boundJakub Dupak1-2/+8
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump bare function typeJakub Dupak4-9/+111
+ Return FunctionQualifiers as ref to work in ast dump gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. * ast/rust-ast-dump.h: Add missing getter declaration. * ast/rust-ast-full-test.cc (BareFunctionType::as_string): Fix bare function string representation. * ast/rust-type.h (class BareFunctionType): Declare said getter. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump inferred typeJakub Dupak1-0/+3
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump tuple typeJakub Dupak1-5/+13
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump never typeJakub Dupak1-1/+6
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing never type visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump raw pointer typeJakub Dupak1-88/+112
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing RawPointer visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump array typeJakub Dupak1-0/+7
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing array visitor Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump slice typeJakub Dupak1-0/+5
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing slice visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: Dump where clause and recursively needed nodesJakub Dupak5-17/+131
This is currently needed for lifetimes to use the existing infrastructure. gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitors. * ast/rust-ast-dump.h: Likewise. * ast/rust-ast.h: Add `get_lifetime_bounds` method. * ast/rust-item.h: Add missing getter for lifetimes. * ast/rust-type.h: Likewise. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: add visit overload for referencesJakub Dupak3-7/+23
This is currently needed for lifetimes to use the existing infrastructure. gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add new reference visitor wrapper. * ast/rust-ast-dump.h: Declare it. * ast/rust-item.h: Add mutable visibility getters. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: typecheck: Fix overzealous `delete` callArthur Cohen1-1/+0
gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Fix extra call to `delete`.
2023-02-21gccrs: add Location to AST::VisibilityDave3-9/+19
gcc/rust/ChangeLog: * ast/rust-item.h: Add location member. * hir/rust-ast-lower.cc (translate_visibility): Pass location argument. * hir/tree/rust-hir-item.h: Fix constructor to accept Location argument.
2023-02-21gccrs: add lang item "phantom_data"Raiki Tamura2-0/+20
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add handling for `phantom_data` lang item. gcc/testsuite/ChangeLog: * rust/compile/torture/phantom_data.rs: New test.
2023-02-21gccrs: ast: Dump unit structJakub Dupak1-1/+4
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add handling for unit structures. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: refer correctly to arguments in docs-stringsJakub Dupak1-3/+3
gcc/rust/ChangeLog: * ast/rust-ast-dump.h: Fix documentation. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: transform helper methods to visits and add methods to simplify ↵Jakub Dupak2-387/+235
repeated patterns gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::go): Use new API. (Dump::format_function_param): Refactor. (Dump::visit_items_joined_by_separator): New function. (Dump::emit_attrib): Refactor. (Dump::visit_as_line): New function. (Dump::visit_items_as_lines): Likewise. (Dump::visit_items_as_block): Likewise. (Dump::visit): Use new API. (Dump::emit_visibility): Likewise. (Dump::emit_indented_string): Likewise. (Dump::emit_generic_params): Likewise. (Dump::format_tuple_field): Likewise. (Dump::format_struct_field): Likewise. (Dump::format_function_common): Likewise. (Dump::visit_function_common): Likewise. * ast/rust-ast-dump.h: Declare new functions and add documentation. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: ast: visitor pattern -> overload syntax compatibility layerJakub Dupak2-0/+15
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add new visit function for overloading. * ast/rust-ast-dump.h: Add documentation for layer. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
2023-02-21gccrs: intrinsics: Implement atomic_load intrinsicsArthur Cohen4-33/+144
gcc/rust/ChangeLog: * backend/rust-builtins.cc (BuiltinsContext::setup_atomic_fns): Declare atomic load intrinsics. * backend/rust-compile-intrinsic.cc (atomic_load_handler_inner): New handler. (atomic_load_handler): Likewise. (unchecked_op_handler): Remove `static` function qualifier. (build_atomic_builtin_name): Handle load intrinsics. (atomic_store_handler_inner): New handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: * rust/execute/torture/atomic_load.rs: New test.
2023-02-21gccrs: intrinsics: Cleanup error handling around atomic_store_*Arthur Cohen2-24/+30
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (check_for_basic_integer_type): New function. (build_atomic_builtin_name): Use HIR Type instead of `tree`. (atomic_store_handler_inner): Cleanup error handling. (unchecked_op_inner): Likewise. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-5.rs: Fix error message.
2023-02-21gccrs: intrinsics: Use lambdas for wrapping_<op> intrinsicsArthur Cohen1-18/+11
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (wrapping_op_handler): Refactor to return an `std::function`. (wrapping_op_handler_inner): Rename. (wrapping_add_handler): Remove function. (wrapping_sub_handler): Likewise. (wrapping_mul_handler): Likewise.
2023-02-21gccrs: intrinsics: Add unchecked operation intrinsicsArthur Cohen3-0/+111
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (is_basic_integer_type): New function. (unchecked_op_inner): New handler. (unchecked_op_handler): New handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-6.rs: New test. * rust/compile/torture/intrinsics-7.rs: New test.