liushuyu [Wed, 7 Sep 2022 04:41:17 +0000 (22:41 -0600)]
gccrs: testsuite: add loop condition execution test
gcc/testsuite/ChangeLog:
* rust/execute/torture/loop-condition-eval.rs: New test.
Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
Faisal Abbas [Tue, 6 Sep 2022 21:24:52 +0000 (22:24 +0100)]
gccrs: add testcase with struct to test component_ref and constructor codes..
..in eval_constant_expression()
gcc/testsuite/ChangeLog:
* rust/compile/const8.rs: New test.
Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com>
liushuyu [Mon, 5 Sep 2022 23:56:03 +0000 (17:56 -0600)]
gccrs: backend: correctly formulate the exit condition ...
... previously the exit condition was treated the same as the loop
condition (which is the inverse condition of the exit condition). Now
this is corrected.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate
exit condition when compiling while loops.
Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
Faisal Abbas [Sun, 4 Sep 2022 15:18:40 +0000 (16:18 +0100)]
gccrs: add testcase to test component_ref and constructor codes in eval_constant_expression()
gcc/testsuite/ChangeLog:
* rust/compile/const7.rs: New test.
Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com>
Faisal Abbas [Sun, 4 Sep 2022 15:07:43 +0000 (16:07 +0100)]
gccrs: bugfix: initialize slice from array in const context
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn
constant item typechecking into a coercion site instead of a unify
site.
gcc/testsuite/ChangeLog:
* rust/compile/const6.rs: New test.
Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com>
Philip Herron [Wed, 31 Aug 2022 16:16:13 +0000 (17:16 +0100)]
gccrs: Unit structs are not concrete when they need substitutions
Fixes #1518
gcc/rust/ChangeLog:
* typecheck/rust-tyty.h: Fix `is_concrete` for unit types with
substitutions.
Philip Herron [Wed, 31 Aug 2022 16:07:51 +0000 (17:07 +0100)]
gccrs: Add new check for contains_associated_types
We don't need to setup associated types when a trait does not contain any
associated types.
gcc/rust/ChangeLog:
* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types):
Check if a type bound predicate contains assocated types.
* typecheck/rust-tyty.h: Declare the above mentioned function.
* typecheck/rust-hir-trait-resolve.cc: Use `contains_associated_types`
function.
Philip Herron [Wed, 31 Aug 2022 16:07:09 +0000 (17:07 +0100)]
gccrs: Add extra debugging for method call expressions
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add
more calls to `rust_debug` for development.
Philip Herron [Thu, 25 Aug 2022 13:46:32 +0000 (14:46 +0100)]
gccrs: Create canonical process of compiling constant items
In order to compile a block expression constant, the simplest way for us
was to reuse what code we have and to generate an artifical function which
does not get added to the translation unit. The constant then becomes
a CALL_EXPR to this artifical function which we can pass to the constexpr
evaluator to resolve the result of this artifical 'CALL_EXPR'.
Before this patch we seperated the difference between block expressions
and non block expressions in constants. So for non block expressions we
simply compiled them as if it was a simple constant but this is not
guaranteed to be the case in rust, for example coercion sites can generate
temporaries during autoderef which we let the constant evaluator resolve
for us. This makes all constants handled in the same way to simplify the
logic here.
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc: Improve compilation pipeline and simplify
function.
Philip Herron [Wed, 31 Aug 2022 13:08:43 +0000 (14:08 +0100)]
gccrs: Remove param_use_canonical_types checks ported from c++ front-end
We are not fully setting TYPE_CANONICAL yet but we don't need to be as
strict as the C++ front-end yet. param_use_canonical_types is a command
line option we are not using either.
gcc/rust/ChangeLog:
* backend/rust-tree.cc (comptypes): Remove some C++ specific checks in
Rust const folder for now.
Philip Herron [Fri, 26 Aug 2022 14:09:55 +0000 (15:09 +0100)]
gccrs: Refactor unify to hit a unify_site
This allows us to enforce better error handling on unify sites
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add
better unification function with debug calls.
* typecheck/rust-autoderef.cc (AutoderefCycle::cycle): Add more debug
calls and use new unify API.
* typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise.
(TypeCoercionRules::coerce_borrowed_pointer): Likewise.
(TypeCoercionRules::select): Likewise.
* typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise.
* typecheck/rust-hir-trait-resolve.cc (TraitItemReference::resolve_item): Likewise.
(TypeCheckBase::coercion_site): Likewise.
(TypeCheckBase::cast_site): Likewise.
* typecheck/rust-hir-type-check-base.h: Likewise.
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
* typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelImplItem::visit): Likewise.
(TypeCheckImplItem::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise.
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Likewise.
* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
* typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise.
* typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
* typecheck/rust-hir-type-check.cc (TypeResolution::Resolve): Likewise.
* typecheck/rust-tyctx.cc (TypeCheckContext::peek_return_type): Likewise.
* typecheck/rust-tyty-call.cc (TypeCheckMethodCallExpr::visit): Likewise.
* typecheck/rust-tyty-cmp.h: Likewise.
* typecheck/rust-tyty-rules.h: Likewise.
* typecheck/rust-tyty.cc (BaseType::mappings_str): Likewise.
(BaseType::debug): Print type name more clearly.
(BaseType::debug_str): Add new function to print type pointer and name.
(TupleType::get_name): Improve type name fetching function.
(ReferenceType::get_name): Likewise.
(PointerType::get_name): Likewise.
* typecheck/rust-tyty.h: Refactor definitions outside of the header.
gcc/testsuite/ChangeLog:
* rust/compile/issue-1152.rs: Fix dejagnu assertion.
* rust/compile/tuple1.rs: Likewise.
* rust/compile/type-alias1.rs: Likewise.
* rust/execute/torture/operator_overload_9.rs: Likewise.
* rust/execute/torture/slice1.rs: Rework test to use new parsing
capability and stick to the original implementation.
Philip Herron [Fri, 26 Aug 2022 10:32:24 +0000 (11:32 +0100)]
gccrs: Add missing location info to coercions
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase):
Remove constructor.
(TypeCheckBase::coercion_site): Add `Location` argument to function.
* typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::coercion_site`
function with location argument.
* typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise.
* typecheck/rust-hir-type-check-expr.h (class TypeCheckExpr): Likewise.
* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Likewise.
* typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::visit): Likewise.
* typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Likewise.
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise.
(TypeCheckMethodCallExpr::visit): Likewise.
* typecheck/rust-tyty.h: Add missing locus field.
* typecheck/rust-tyty.cc (StructFieldType::clone): Use locus field.
(StructFieldType::monomorphized_clone): Likewise.
Philip Herron [Fri, 26 Aug 2022 19:52:35 +0000 (20:52 +0100)]
gccrs: Add guards against getting data from an empty vector
gcc/rust/ChangeLog:
* typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add
guards around `std::vector<T>.pop_back()`.
(TypeCheckContext::peek_context): Likewise for `std::vector<T>.back()`.
Arthur Cohen [Mon, 29 Aug 2022 12:59:18 +0000 (14:59 +0200)]
gccrs: ast: Add better assertion on AST fragments
gcc/rust/ChangeLog:
* ast/rust-ast.h: Improve assertions within ASTFragment API.
Co-authored-by: philberty <philip.herron@embecosm.com>
Arthur Cohen [Mon, 29 Aug 2022 11:37:13 +0000 (13:37 +0200)]
gccrs: ast: Only expand expressions and types if the kind is right
gcc/rust/ChangeLog:
* ast/rust-ast.h: Add assertions and accessors for fragment nodes.
* expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
context typo when visiting `InherentImpl` items.
(AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
properly typed node.
(AttrVisitor::maybe_expand_type): Likewise.
* expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
when trying to parse a type.
Arthur Cohen [Mon, 29 Aug 2022 11:37:00 +0000 (13:37 +0200)]
gccrs: dump: Add AST debugging using the AST::Dump class
gcc/rust/ChangeLog:
* ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to
dump an AST node on `stderr`.
Arthur Cohen [Mon, 29 Aug 2022 14:23:51 +0000 (16:23 +0200)]
gccrs: transcriber: Do not infinite loop if the current parsed node is an error
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (parse_many): Return early from parsing
loop if we encounter an error, and emit that error in the meantime.
Co-authored-by: philberty <philip.herron@embecosm.com>
Arthur Cohen [Mon, 29 Aug 2022 10:51:33 +0000 (12:51 +0200)]
gccrs: macros: Handle matchers properly in repetitions
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle
fragments differently based on whether or not we are currently trying
to match a matcher in a repetition context.
(MacroExpander::match_n_matches): Use new `in_repetition` argument
properly when calling `match_matcher`.
* expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow
passing extra `in_repetition` bool argument
gcc/testsuite/ChangeLog:
* rust/compile/macro43.rs: New test.
Arthur Cohen [Mon, 29 Aug 2022 14:37:16 +0000 (16:37 +0200)]
gccrs: parser: Parse RangeFullExpr without erroring out
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h: Allow parsing full range expressions without
erroring out.
gcc/testsuite/ChangeLog:
* rust/compile/parse_range.rs: New test.
Arthur Cohen [Fri, 26 Aug 2022 12:09:24 +0000 (14:09 +0200)]
gccrs: lint: Do not emit unused warnings for public items
gcc/rust/ChangeLog:
* checks/lints/rust-lint-scan-deadcode.h: Do not report public items
as dead code.
gcc/testsuite/ChangeLog:
* rust/compile/issue-1031.rs: Remove extraneous dead code warnings.
* rust/compile/issue-1289.rs: Likewise.
* rust/compile/test_mod.rs: Likewise.
* rust/compile/torture/raw_identifiers.rs: Likewise.
* rust/compile/torture/raw_identifiers_keywords.rs: Likewise.
* rust/compile/privacy7.rs: New test.
Arthur Cohen [Fri, 26 Aug 2022 12:06:23 +0000 (14:06 +0200)]
gccrs: rustc_attrs: Allow `rustc_inherit_overflow_checks` as a builtin..
..attribute. We cannot yet handle this attribute, but we should not reject it either
gcc/rust/ChangeLog:
* util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list
of builtin attributes.
gcc/testsuite/ChangeLog:
* rust/compile/rustc_attr1.rs: New test.
Arthur Cohen [Fri, 26 Aug 2022 06:44:02 +0000 (08:44 +0200)]
gccrs: backend: Add overflow checks to every arithmetic operation
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow
checks logic.
(CompileExpr::array_copied_expr): Insert overflow checks logic.
* backend/rust-compile-item.cc (CompileItem::visit): Insert overflow
checks logic.
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Insert
overflow checks logic.
* rust-gcc.cc (Gcc_backend::arithmetic_or_logical_expression): Differentiate
existing function from `arithmetic_or_logical_expression_checked`.
This function does insert perform overflow checks.
(Gcc_backend::arithmetic_or_logical_expression_checked): New
function.
(is_overflowing_expr): New function. Check if an expression is an
overflowing one (ADD, SUB, MUL).
(fetch_overflow_builtins): New function.
* rust-backend.h: Declare `arithmetic_or_logical_expression_checked` in
abstract `Backend` class.
gcc/testsuite/ChangeLog:
* rust/debug/win64-abi.rs: Fix assertion to take into account
overflow builtins
* rust/compile/torture/macro-issue1426.rs: Moved to...
* rust/execute/torture/macro-issue1426.rs: ...here.
* rust/execute/torture/overflow1.rs: New test.
Arthur Cohen [Wed, 24 Aug 2022 15:21:38 +0000 (17:21 +0200)]
gccrs: builtins: Add add_overflow builtin and refactor class
gcc/rust/ChangeLog:
* backend/rust-builtins.h: Refactor builtin context class and add
overflow builtins.
Arthur Cohen [Wed, 24 Aug 2022 15:20:57 +0000 (17:20 +0200)]
gccrs: backend: Expose Bvariable class through rust-gcc header
gcc/rust/ChangeLog:
* rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header.
* rust-gcc.h: New file.
Philip Herron [Thu, 25 Aug 2022 14:33:02 +0000 (15:33 +0100)]
gccrs: Desugar double borrows into two HIR:BorrowExpr's
We simply hit a gcc_unreachable() on double borrows but it seems reasonable
to just desugar the AST into a borrow of a borrow to foo. Instead of a
borrow expression with a flag to be respected.
Fixes #1506
gcc/rust/ChangeLog:
* hir/rust-ast-lower-expr.h: Lower double borrow expressions to two
`HIR::BorrowExpr`s.
* hir/tree/rust-hir-expr.h: Remove `is_double_borrow` field from
`HIR::BorrowExpr`.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Remove
call to `gcc_unreachable` on double borrow expressions.
gcc/testsuite/ChangeLog:
* rust/compile/torture/issue-1506.rs: New test.
Faisal Abbas [Mon, 27 Jun 2022 15:05:49 +0000 (16:05 +0100)]
gccrs: const folding port
This changeset ports cp_global_trees structure which is used throughout the
cp constexpr.cc code. I am not sure what it's purpose is but it seems it is used
to add and manipulate tree information during the c++ compilation process.
It is possible this is not needed in the Rust code and may be taken out later.
Also, the initialization function isn't being called from anywhere yet, so
we will need to find a suitable point for it.
gcc/rust/ChangeLog:
* backend/rust-tree.cc : Add new includes.
(scope_chain): New.
(maybe_add_global): New.
(init_modules): New (copied from cp)
(var_in_constexpr_fn): Likewise.
(member_vec_linear_search): Likewise.
(member_vec_binary_search): Likewise.
(is_overloaded_fn): Likewise.
(ovl_make): Likewise.
(lookup_add): Likewise.
(type_memfn_quals): Likewise.
(struct find_parameter_pack_data): Likewise.
(struct conv_type_hasher): Likewise.
(make_conv_op_name): Likewise.
(builtin_pack_fn_p): Likewise.
(builtin_pack_call_p): Likewise.
(has_extra_args_mechanism_p): Likewise.
(find_parameter_packs_r): Likewise.
(WALK_SUBTREE): Likewise.
(type_memfn_rqual): Likewise.
(maybe_add_lang_type_raw): Likewise.
(struct c_fileinfo): Likewise.
(get_fileinfo): Likewise.
(cxx_make_type): Likewise.
(build_min_array_type): Likewise.
(fields_linear_search): Likewise.
(nothrow_spec_p): Likewise.
(maybe_get_fns): Likewise.
(get_fns): Likewise.
(get_first_fn): Likewise.
(dependent_name): Likewise.
(called_fns_equal): Likewise.
(canonical_eh_spec): Likewise.
(rs_tree_code_length): Likewise.
(rs_tree_operand_length): Likewise.
(rs_tree_equal): Likewise.
(publicly_uniquely_derived_p): Likewise.
(comp_except_types): Likewise.
(comp_except_specs): Likewise.
(compparms): Likewise.
(set_array_type_canon): Likewise.
(struct cplus_array_info): Likewise.
(struct cplus_array_hasher): Likewise.
(cplus_array_hasher::hash): Likewise.
(cplus_array_hasher::equal): Likewise.
(is_byte_access_type): Likewise.
(build_cplus_array_type): Likewise.
(rs_build_qualified_type_real): Likewise.
(vector_targets_convertible_p): Likewise.
(comp_array_types): Likewise.
(same_type_ignoring_top_level_qualifiers_p): Likewise.
(comp_ptr_ttypes_const): Likewise.
(similar_type_p): Likewise.
(structural_comptypes): Likewise.
(comptypes): Likewise.
(next_initializable_field): Likewise.
(sufficient_parms_p): Likewise.
(default_ctor_p): Likewise.
(user_provided_p): Likewise.
(type_has_non_user_provided_default_constructor): Likewise.
(default_init_uninitialized_part): Likewise.
(extract_conversion_operator): Likewise.
(get_class_binding_direct): Likewise.
(lang_check_failed): Likewise.
(skip_artificial_parms_for): Likewise.
(in_class_defaulted_default_constructor): Likewise.
(is_instantiation_of_constexpr): Likewise.
(check_for_uninitialized_const_var): Likewise.
(cv_unqualified): Likewise.
(make_tree_vector): Likewise.
(release_tree_vector): Likewise.
(instantiation_dependent_expression_p): Likewise.
(cp_get_callee): Likewise.
(build_nop): Likewise.
(scalarish_type_p): Likewise.
(type_has_nontrivial_copy_init): Likewise.
(build_local_temp): Likewise.
(is_normal_capture_proxy): Likewise.
(reject_gcc_builtin): Likewise.
(is_bitfield_expr_with_lowered_type): Likewise.
(maybe_undo_parenthesized_ref): Likewise.
(fold_offsetof): Likewise.
(char_type_p): Likewise.
(resolve_nondeduced_context): Likewise.
(instantiate_non_dependent_or_null): Likewise.
(resolve_nondeduced_context_or_error): Likewise.
(really_overloaded_fn): Likewise.
(invalid_nonstatic_memfn_p): Likewise.
(strip_top_quals): Likewise.
(cxx_incomplete_type_inform): Likewise.
(cxx_incomplete_type_diagnostic): Likewise.
(decl_constant_var_p): Likewise.
(undeduced_auto_decl): Likewise.
(require_deduced_type): Likewise.
* backend/rust-tree.h (enum c_tree_index): Likewise.
(GTY): Likewise.
(enum cp_tree_index): Likewise.
(wchar_decl_node): Likewise.
(vtable_entry_type): Likewise.
(delta_type_node): Likewise.
(vtable_index_type): Likewise.
(class_type_node): Likewise.
(unknown_type_node): Likewise.
(init_list_type_node): Likewise.
(explicit_void_list_node): Likewise.
(vtbl_type_node): Likewise.
(vtbl_ptr_type_node): Likewise.
(std_node): Likewise.
(abi_node): Likewise.
(global_namespace): Likewise.
(const_type_info_type_node): Likewise.
(conv_op_marker): Likewise.
(abort_fndecl): Likewise.
(current_aggr): Likewise.
(nullptr_node): Likewise.
(nullptr_type_node): Likewise.
(align_type_node): Likewise.
(char8_type_node): Likewise.
(char16_type_node): Likewise.
(char32_type_node): Likewise.
(wchar_type_node): Likewise.
(underlying_wchar_type_node): Likewise.
(wint_type_node): Likewise.
(signed_size_type_node): Likewise.
(unsigned_ptrdiff_type_node): Likewise.
(intmax_type_node): Likewise.
(uintmax_type_node): Likewise.
(widest_integer_literal_type_node): Likewise.
(widest_unsigned_literal_type_node): Likewise.
(sig_atomic_type_node): Likewise.
(int8_type_node): Likewise.
(int16_type_node): Likewise.
(int32_type_node): Likewise.
(int64_type_node): Likewise.
(uint8_type_node): Likewise.
(c_uint16_type_node): Likewise.
(c_uint32_type_node): Likewise.
(c_uint64_type_node): Likewise.
(int_least8_type_node): Likewise.
(int_least16_type_node): Likewise.
(int_least32_type_node): Likewise.
(int_least64_type_node): Likewise.
(uint_least8_type_node): Likewise.
(uint_least16_type_node): Likewise.
(uint_least32_type_node): Likewise.
(uint_least64_type_node): Likewise.
(int_fast8_type_node): Likewise.
(int_fast16_type_node): Likewise.
(int_fast32_type_node): Likewise.
(int_fast64_type_node): Likewise.
(uint_fast8_type_node): Likewise.
(uint_fast16_type_node): Likewise.
(uint_fast32_type_node): Likewise.
(uint_fast64_type_node): Likewise.
(intptr_type_node): Likewise.
(uintptr_type_node): Likewise.
(truthvalue_type_node): Likewise.
(truthvalue_true_node): Likewise.
(truthvalue_false_node): Likewise.
(char_array_type_node): Likewise.
(char8_array_type_node): Likewise.
(char16_array_type_node): Likewise.
(char32_array_type_node): Likewise.
(wchar_array_type_node): Likewise.
(string_type_node): Likewise.
(const_string_type_node): Likewise.
(default_function_type): Likewise.
(function_name_decl_node): Likewise.
(pretty_function_name_decl_node): Likewise.
(c99_function_name_decl_node): Likewise.
(saved_function_name_decls): Likewise.
(null_node): Likewise.
(ctor_identifier): Likewise.
(complete_ctor_identifier): Likewise.
(base_ctor_identifier): Likewise.
(dtor_identifier): Likewise.
(complete_dtor_identifier): Likewise.
(base_dtor_identifier): Likewise.
(deleting_dtor_identifier): Likewise.
(conv_op_identifier): Likewise.
(delta_identifier): Likewise.
(in_charge_identifier): Likewise.
(vtt_parm_identifier): Likewise.
(as_base_identifier): Likewise.
(this_identifier): Likewise.
(pfn_identifier): Likewise.
(vptr_identifier): Likewise.
(global_identifier): Likewise.
(anon_identifier): Likewise.
(auto_identifier): Likewise.
(decltype_auto_identifier): Likewise.
(init_list_identifier): Likewise.
(for_range__identifier): Likewise.
(for_begin__identifier): Likewise.
(for_end__identifier): Likewise.
(for_range_identifier): Likewise.
(for_begin_identifier): Likewise.
(for_end_identifier): Likewise.
(abi_tag_identifier): Likewise.
(aligned_identifier): Likewise.
(begin_identifier): Likewise.
(end_identifier): Likewise.
(get__identifier): Likewise.
(gnu_identifier): Likewise.
(tuple_element_identifier): Likewise.
(tuple_size_identifier): Likewise.
(type_identifier): Likewise.
(value_identifier): Likewise.
(fun_identifier): Likewise.
(closure_identifier): Likewise.
(heap_uninit_identifier): Likewise.
(heap_identifier): Likewise.
(heap_deleted_identifier): Likewise.
(heap_vec_uninit_identifier): Likewise.
(heap_vec_identifier): Likewise.
(omp_identifier): Likewise.
(lang_name_c): Likewise.
(lang_name_cplusplus): Likewise.
(empty_except_spec): Likewise.
(noexcept_true_spec): Likewise.
(noexcept_false_spec): Likewise.
(noexcept_deferred_spec): Likewise.
(terminate_fn): Likewise.
(call_unexpected_fn): Likewise.
(get_exception_ptr_fn): Likewise.
(begin_catch_fn): Likewise.
(end_catch_fn): Likewise.
(allocate_exception_fn): Likewise.
(free_exception_fn): Likewise.
(throw_fn): Likewise.
(rethrow_fn): Likewise.
(atexit_fn_ptr_type_node): Likewise.
(atexit_node): Likewise.
(dso_handle_node): Likewise.
(dynamic_cast_node): Likewise.
(cleanup_type): Likewise.
(vtt_parm_type): Likewise.
(any_targ_node): Likewise.
(source_location_impl): Likewise.
(OVL_FUNCTION): Likewise.
(OVL_CHAIN): Likewise.
(OVL_DEDUP_P): Likewise.
(OVL_USING_P): Likewise.
(OVL_HIDDEN_P): Likewise.
(OVL_NESTED_P): Likewise.
(OVL_LOOKUP_P): Likewise.
(OVL_EXPORT_P): Likewise.
(OVL_FIRST): Likewise.
(OVL_NAME): Likewise.
(OVL_P): Likewise.
(OVL_SINGLE_P): Likewise.
(TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise.
(CLASSTYPE_LAZY_DEFAULT_CTOR): Likewise.
(CLASSTYPE_CONSTRUCTORS): Likewise.
(ATTR_IS_DEPENDENT): Likewise.
(ABI_TAG_IMPLICIT): Likewise.
(PARENTHESIZED_LIST_P): Likewise.
(DECL_DEPENDENT_P): Likewise.
(USING_DECL_SCOPE): Likewise.
(USING_DECL_DECLS): Likewise.
(USING_DECL_TYPENAME_P): Likewise.
(USING_DECL_UNRELATED_P): Likewise.
(DECL_DECLARES_FUNCTION_P): Likewise.
(DECL_DECLARES_TYPE_P): Likewise.
(IDENTIFIER_KIND_BIT_0): Likewise.
(IDENTIFIER_KIND_BIT_1): Likewise.
(IDENTIFIER_KIND_BIT_2): Likewise.
(IDENTIFIER_MARKED): Likewise.
(IDENTIFIER_VIRTUAL_P): Likewise.
(IDENTIFIER_KEYWORD_P): Likewise.
(IDENTIFIER_CDTOR_P): Likewise.
(IDENTIFIER_CTOR_P): Likewise.
(IDENTIFIER_DTOR_P): Likewise.
(IDENTIFIER_ANY_OP_P): Likewise.
(IDENTIFIER_OVL_OP_P): Likewise.
(IDENTIFIER_ASSIGN_OP_P): Likewise.
(IDENTIFIER_CONV_OP_P): Likewise.
(IDENTIFIER_NEWDEL_OP_P): Likewise.
(IDENTIFIER_NEW_OP_P): Likewise.
(CLASSTYPE_DIAMOND_SHAPED_P): Likewise.
(CLASSTYPE_REPEATED_BASE_P): Likewise.
(CLASSTYPE_KEY_METHOD): Likewise.
(CLASSTYPE_MEMBER_VEC): Likewise.
(CLASSTYPE_DECL_LIST): Likewise.
(CLASSTYPE_DESTRUCTOR): Likewise.
(CLASSTYPE_HAS_PRIMARY_BASE_P): Likewise.
(CLASSTYPE_PRIMARY_BINFO): Likewise.
(CLASSTYPE_VBASECLASSES): Likewise.
(CLASSTYPE_AS_BASE): Likewise.
(DECL_CONV_FN_P): Likewise.
(DECL_CONV_FN_TYPE): Likewise.
(same_type_p): Likewise.
(WILDCARD_TYPE_P): Likewise.
(MAYBE_CLASS_TYPE_P): Likewise.
(FUNCTION_REF_QUALIFIED): Likewise.
(FUNCTION_RVALUE_QUALIFIED): Likewise.
(TYPE_PTRMEMFUNC_FN_TYPE): Likewise.
(TYPE_PTRMEMFUNC_FN_TYPE_RAW): Likewise.
(TYPE_DEPENDENT_P): Likewise.
(TYPE_DEPENDENT_P_VALID): Likewise.
(TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise.
(TYPE_RAISES_EXCEPTIONS): Likewise.
(IDENTIFIER_BINDING): Likewise.
(LANG_IDENTIFIER_CAST): Likewise.
(IF_COND): Likewise.
(THEN_CLAUSE): Likewise.
(ELSE_CLAUSE): Likewise.
(IF_SCOPE): Likewise.
(IF_STMT_CONSTEXPR_P): Likewise.
(IF_STMT_CONSTEVAL_P): Likewise.
(DECLTYPE_TYPE_EXPR): Likewise.
(SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise.
(CLASSTYPE_INTERFACE_ONLY): Likewise.
(TYPE_NAME_STRING): Likewise.
(TYPE_NAME_LENGTH): Likewise.
(CONSTRAINT_VAR_P): Likewise.
(KOENIG_LOOKUP_P): Likewise.
(DECL_PARM_INDEX): Likewise.
(DECL_PARM_LEVEL): Likewise.
(CONV_IMPLICIT): Likewise.
(CONV_STATIC): Likewise.
(CONV_CONST): Likewise.
(CONV_REINTERPRET): Likewise.
(CONV_PRIVATE): Likewise.
(CONV_FORCE_TEMP): Likewise.
(CONV_FOLD): Likewise.
(CONV_OLD_CONVERT): Likewise.
(CONV_C_CAST): Likewise.
(CONV_BACKEND_CONVERT): Likewise.
(WANT_INT): Likewise.
(WANT_FLOAT): Likewise.
(WANT_ENUM): Likewise.
(WANT_POINTER): Likewise.
(WANT_NULL): Likewise.
(WANT_VECTOR_OR_COMPLEX): Likewise.
(WANT_ARITH): Likewise.
(COMPARE_STRICT): Likewise.
(COMPARE_BASE): Likewise.
(COMPARE_DERIVED): Likewise.
(COMPARE_REDECLARATION): Likewise.
(COMPARE_STRUCTURAL): Likewise.
(SF_DEFAULT): Likewise.
(SF_PRE_PARSED): Likewise.
(SF_INCLASS_INLINE): Likewise.
(SD_UNINITIALIZED): Likewise.
(SD_INITIALIZED): Likewise.
(SD_DECOMPOSITION): Likewise.
(SD_DEFAULTED): Likewise.
(SD_DELETED): Likewise.
(TYPE_PTRDATAMEM_P): Likewise.
(RS_TYPE_CONST_P): Likewise.
(TYPE_MAIN_DECL): Likewise.
(DECL_NONTRIVIALLY_INITIALIZED_P): Likewise.
(DECL_DEFAULTED_FN): Likewise.
(TYPE_HAS_USER_CONSTRUCTOR): Likewise.
(DECL_INITIALIZED_IN_CLASS_P): Likewise.
(DECL_DEFAULTED_IN_CLASS_P): Likewise.
(DECL_NONSTATIC_MEMBER_FUNCTION_P): Likewise.
(DECL_HAS_IN_CHARGE_PARM_P): Likewise.
(DECL_HAS_VTT_PARM_P): Likewise.
(FUNCTION_FIRST_USER_PARMTYPE): Likewise.
(FUNCTION_FIRST_USER_PARM): Likewise.
(DECL_CONSTRUCTOR_P): Likewise.
(DECL_DELETED_FN): Likewise.
(BRACE_ENCLOSED_INITIALIZER_P): Likewise.
(DECL_IMMEDIATE_FUNCTION_P): Likewise.
(SET_DECL_IMMEDIATE_FUNCTION_P): Likewise.
(CONSTRUCTOR_MUTABLE_POISON): Likewise.
(PTRMEM_CST_MEMBER): Likewise.
(REF_PARENTHESIZED_P): Likewise.
(TYPE_PTRMEM_P): Likewise.
(TYPE_PTR_OR_PTRMEM_P): Likewise.
(DECL_DECOMPOSITION_P): Likewise.
(DECL_DECOMP_BASE): Likewise.
(DECL_MAYBE_IN_CHARGE_CDTOR_P): Likewise.
(DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
(DECL_CLONED_FUNCTION_P): Likewise.
(DECL_CLONED_FUNCTION): Likewise.
(DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
(cp_function_chain): Likewise.
(cdtor_label): Likewise.
(current_class_ptr): Likewise.
(current_class_ref): Likewise.
(current_eh_spec_block): Likewise.
(current_in_charge_parm): Likewise.
(current_vtt_parm): Likewise.
(current_retval_sentinel): Likewise.
(current_function_returns_value): Likewise.
(current_function_returns_null): Likewise.
(current_function_returns_abnormally): Likewise.
(current_function_infinite_loop): Likewise.
(in_base_initializer): Likewise.
(in_function_try_handler): Likewise.
(current_function_return_value): Likewise.
(current_class_type): Likewise.
(TYPE_BEING_DEFINED): Likewise.
(DECL_STATIC_FUNCTION_P): Likewise.
(DECL_FUNCTION_MEMBER_P): Likewise.
(LANG_DECL_MIN_CHECK): Likewise.
(LANG_DECL_FN_CHECK): Likewise.
(LANG_DECL_NS_CHECK): Likewise.
(LANG_DECL_PARM_CHECK): Likewise.
(LANG_DECL_DECOMP_CHECK): Likewise.
(RS_INTEGRAL_TYPE_P): Likewise.
(STAT_HACK_P): Likewise.
(STAT_TYPE_VISIBLE_P): Likewise.
(STAT_TYPE): Likewise.
(STAT_DECL): Likewise.
(STAT_VISIBLE): Likewise.
(MAYBE_STAT_DECL): Likewise.
(MAYBE_STAT_TYPE): Likewise.
(STAT_TYPE_HIDDEN_P): Likewise.
(STAT_DECL_HIDDEN_P): Likewise.
(class warning_sentinel): Likewise.
(struct uid_sensitive_constexpr_evaluation_checker): Likewise.
(class iloc_sentinel): Likewise.
(struct GTY): Likewise.
(struct named_decl_hash): Likewise.
(enum lang_decl_selector): Likewise.
(LANG_DECL_HAS_MIN): Likewise.
(struct named_label_entry): Likewise.
(struct named_label_hash): Likewise.
(enum ref_operator): Likewise.
(struct c_fileinfo): Likewise.
(class ovl_iterator): Likewise.
(class lkp_iterator): Likewise.
(enum rs_ref_qualifier): Likewise.
(enum tsubst_flags): Likewise.
(enum cp_identifier_kind): Likewise.
(enum tag_types): Likewise.
(enum compare_bounds_t): Likewise.
(mark_rvalue_use): Likewise.
(type_unknown_p): Likewise.
(init_modules): Likewise.
(var_in_constexpr_fn): Likewise.
(ovl_first): Likewise.
(lookup_add): Likewise.
(ovl_make): Likewise.
(is_overloaded_fn): Likewise.
(maybe_add_lang_type_raw): Likewise.
(type_memfn_rqual): Likewise.
(builtin_pack_fn_p): Likewise.
(make_conv_op_name): Likewise.
(type_memfn_quals): Likewise.
(get_fileinfo): Likewise.
(cxx_make_type): Likewise.
(build_cplus_array_type): Likewise.
(is_byte_access_type): Likewise.
(comptypes): Likewise.
(canonical_eh_spec): Likewise.
(cp_tree_operand_length): Likewise.
(rs_tree_equal): Likewise.
(compparms): Likewise.
(rs_build_qualified_type_real): Likewise.
(rs_build_qualified_type): Likewise.
(cv_qualified_p): Likewise.
(similar_type_p): Likewise.
(vector_targets_convertible_p): Likewise.
(same_type_ignoring_top_level_qualifiers_p): Likewise.
(comp_ptr_ttypes_const): Likewise.
(get_class_binding_direct): Likewise.
(skip_artificial_parms_for): Likewise.
(lang_check_failed): Likewise.
(default_init_uninitialized_part): Likewise.
(type_has_non_user_provided_default_constructor): Likewise.
(default_ctor_p): Likewise.
(user_provided_p): Likewise.
(sufficient_parms_p): Likewise.
(next_initializable_field): Likewise.
(in_class_defaulted_default_constructor): Likewise.
(is_instantiation_of_constexpr): Likewise.
(check_for_uninitialized_const_var): Likewise.
(reduced_constant_expression_p): Likewise.
(cv_unqualified): Likewise.
(cp_get_callee): Likewise.
(cp_get_callee_fndecl_nofold): Likewise.
(is_nondependent_static_init_expression): Likewise.
(maybe_constant_init): Likewise.
(build_nop): Likewise.
(scalarish_type_p): Likewise.
(is_bitfield_expr_with_lowered_type): Likewise.
(convert_bitfield_to_declared_type): Likewise.
(cp_fold_maybe_rvalue): Likewise.
(maybe_undo_parenthesized_ref): Likewise.
(fold_offsetof): Likewise.
(cp_truthvalue_conversion): Likewise.
(fold_non_dependent_expr): Likewise.
(char_type_p): Likewise.
(instantiation_dependent_expression_p): Likewise.
(type_has_nontrivial_copy_init): Likewise.
(build_local_temp): Likewise.
(is_normal_capture_proxy): Likewise.
(reject_gcc_builtin): Likewise.
(resolve_nondeduced_context): Likewise.
(cxx_incomplete_type_diagnostic): Likewise.
(cxx_incomplete_type_error): Likewise.
(invalid_nonstatic_memfn_p): Likewise.
(really_overloaded_fn): Likewise.
(resolve_nondeduced_context_or_error): Likewise.
(instantiate_non_dependent_or_null): Likewise.
(cxx_incomplete_type_inform): Likewise.
(strip_top_quals): Likewise.
(undeduced_auto_decl): Likewise.
(require_deduced_type): Likewise.
(decl_constant_var_p): Likewise.
(type_of_this_parm): Likewise.
(class_of_this_parm): Likewise.
(identifier_p): Likewise.
(gnu_vector_type_p): Likewise.
(make_tree_vector): Likewise.
(release_tree_vector): Likewise.
(class releasing_vec): Likewise.
(vec_safe_push): Likewise.
(null_node_p): Likewise.
* backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl): Correctly
set fndecl as constexpr from qualifiers.
(HIRCompileBase::compile_function): Test if fndecl is constexpr.
(HIRCompileBase::compile_constant_item): Set fndecl as constexpr.
* backend/rust-compile-intrinsic.cc : Update include.
(finalize_intrinsic_block): Set fndecl as constexpr.
* backend/rust-constexpr.cc : Update include.
(VERIFY_CONSTANT): New.
(is_instantiation_of_constexpr): New.
(literal_type_p): New.
(verify_constant): New.
(find_array_ctor_elt): New.
(array_index_cmp): New.
(potential_constant_expression_1): New.
(get_nth_callarg): New.
(unshare_constructor): New.
(maybe_save_constexpr_fundef): New.
(returns): New.
(breaks): New.
(continues): New.
(switches): New.
(struct constexpr_global_ctx): Add new fields.
(constexpr_fundef): New.
(struct constexpr_call): New.
(constexpr_call_hasher : ggc_ptr_hash<constexpr_call>): New.
(enum constexpr_switch_state): New.
(struct constexpr_ctx): Add new fields.
(struct constexpr_fundef_hasher): New.
(constexpr_fundef_table): New.
(constexpr_fundef_hasher::equal): New.
(constexpr_fundef_hasher::hash): New.
(retrieve_constexpr_fundef): New.
(uid_sensitive_constexpr_evaluation_value): New.
(uid_sensitive_constexpr_evaluation_true_counter): New.
(uid_sensitive_constexpr_evaluation_p): New.
(class temp_override): New.
(struct uid_sensitive_constexpr_evaluation_sentinel): New.
(struct uid_sensitive_constexpr_evaluation_checker): New.
(::uid_sensitive_constexpr_evaluation_sentinel): New.
(::uid_sensitive_constexpr_evaluation_checker): New.
(uid_sensitive_constexpr_evaluation_checker::evaluation_restricted_p): New.
(constexpr_call_table): New.
(constexpr_call_hasher::hash): New.
(constexpr_call_hasher::equal): New.
(maybe_initialize_constexpr_call_table): New.
(fundef_copies_table): New.
(get_fundef_copy): New.
(save_fundef_copy): New.
(constexpr_expression): Refactor in ...
(eval_constant_expression): ...this.
(eval_store_expression): Add 3 bool params.
(eval_call_expression): Likewise.
(eval_binary_expression): Likewise.
(eval_statement_list): New.
(extract_string_elt): New.
(eval_conditional_expression): New.
(eval_bit_field_ref): New.
(eval_loop_expr): New.
(eval_switch_expr): New.
(eval_unary_expression): New.
(call_stack): New.
(call_stack_tick): New.
(last_cx_error_tick): New.
(push_cx_call_context): New.
(pop_cx_call_context): New.
(cx_error_context): New.
(fold_expr): Adjust call to eval_constant_expression.
(same_type_ignoring_tlq_and_bounds_p): New.
(union_active_member): Port more for cxx constexpr.
(fold_indirect_ref_1): New.
(rs_fold_indirect_ref): Likewise.
(rs_eval_indirect_ref): New (from corresponding cxx FE file).
(eval_logical_expression): Adjust parameter list.
(lookup_placeholder): New (from corresponding cxx FE file).
(constant_value_1): Remove.
(inline_asm_in_constexpr_error): New (from corresponding cxx FE file).
(verify_ctor_sanity): New.
(get_callee): Remove.
(initialized_type): New.
(maybe_constexpr_fn): Remove.
(init_subob_ctx): New.
(base_field_constructor_elt): New.
(get_or_insert_ctor_field): New.
(eval_vector_conditional_expression): New (from correponding cxx FE file).
(eval_bare_aggregate): New.
(cxx_eval_trinary_expression): New.
(reduced_constant_expression_p): New.
(adjust_temp_type): New.
(free_constructor): New.
(eval_and_check_array_index): New.
(eval_array_reference): New.
(eval_component_reference): New.
(label_matches): New.
(eval_constant_expression): New.
(modifying_const_object_error): New.
(is_empty_field): New.
(eval_store_expression): New.
(eval_binary_expression): New.
(addr_of_non_const_var): New.
(rs_bind_parameters_in_call): New.
(eval_builtin_function_call): New.
(eval_call_expression): New.
(build_anon_member_initialization): New.
(build_data_member_initialization): New.
(constexpr_fn_retval): New.
(constant_value_1): New.
(decl_constant_value): New.
(non_const_var_error): New.
(get_callee): New.
(get_function_named_in_call): New.
(maybe_constexpr_fn): New.
(get_nth_callarg): New.
(var_in_maybe_constexpr_fn): New.
(instantiate_cx_fn_r): New.
(instantiate_constexpr_fns): New.
(array_index_cmp): New.
(unshare_constructor): New.
(find_array_ctor_elt): New.
(verify_constant): New.
(find_heap_var_refs): New.
(find_immediate_fndecl): New.
(diag_array_subscript): New.
(get_array_or_vector_nelts): New.
(eval_and_check_array_index): New.
(extract_string_elt): New.
(is_valid_constexpr_fn): New.
(explain_invalid_constexpr_fn): New.
(register_constexpr_fundef): New.
(maybe_save_constexpr_fundef): New.
(eval_statement_list): New.
(eval_conditional_expression): New.
(eval_bit_field_ref): New.
(returns): New.
(breaks): New.
(continues): New.
(switches): New.
(eval_loop_expr): New.
(eval_switch_expr): New.
(eval_unary_expression): New.
(cxx_eval_outermost_constant_expr): New.
(is_static_init_expression): New.
(is_constant_expression): New.
(is_nondependent_static_init_expression): New.
(maybe_constant_init_1): New.
(maybe_constant_init): New.
(is_nondependent_constant_expression): New.
(cv_cache): New.
(maybe_constant_value): New.
(potential_constant_expression): New.
(struct check_for_return_continue_data): New.
(check_for_return_continue): New.
(decl_namespace_context): New.
(decl_in_std_namespace_p): New.
(is_std_construct_at): New.
(cxx_dynamic_cast_fn_p): New.
(is_std_allocator_allocate): New.
(is_std_allocator_allocate): New.
(potential_constant_expression_1): New.
(potential_constant_expression_1): New.
(fold_non_dependent_init): New.
* backend/rust-constexpr.h (maybe_save_constexpr_fundef): New.
gcc/testsuite:
* rust/compile/const4.rs: New.
* rust/compile/const5.rs: New.
Signed-off-by: Faisal Abbas <90.abbasfaisal@gmail.com>
Arthur Cohen [Thu, 11 Aug 2022 15:16:24 +0000 (17:16 +0200)]
gccrs: session-manager: Add ast-pretty-expanded dump
gcc/rust/ChangeLog:
* rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST
(Session::dump_ast_pretty): New
* rust-session-manager.h: Add new output file for pretty AST dump
Gaius Mulley [Tue, 31 Jan 2023 12:37:36 +0000 (12:37 +0000)]
Modula-2 rename logitech libraries to log
Rename the gcc/m2/gm2-libs-pim to gcc/m2/gm2-libs-log for
consistency.
gcc/m2/ChangeLog:
* Make-lang.in (gm2-libs.texi-check): Rename
m2/gm2-libs-pim to m2/gm2-libs-log.
* gm2-libs-pim/BitBlockOps.def: Moved to...
* gm2-libs-log/BitBlockOps.def: ...here.
* gm2-libs-pim/BitBlockOps.mod: Moved to...
* gm2-libs-log/BitBlockOps.mod: ...here.
* gm2-libs-pim/BitByteOps.def: Moved to...
* gm2-libs-log/BitByteOps.def: ...here.
* gm2-libs-pim/BitByteOps.mod: Moved to...
* gm2-libs-log/BitByteOps.mod: ...here.
* gm2-libs-pim/BitWordOps.def: Moved to...
* gm2-libs-log/BitWordOps.def: ...here.
* gm2-libs-pim/BitWordOps.mod: Moved to...
* gm2-libs-log/BitWordOps.mod: ...here.
* gm2-libs-pim/BlockOps.def: Moved to...
* gm2-libs-log/BlockOps.def: ...here.
* gm2-libs-pim/BlockOps.mod: Moved to...
* gm2-libs-log/BlockOps.mod: ...here.
* gm2-libs-pim/Break.c: Moved to...
* gm2-libs-log/Break.c: ...here.
* gm2-libs-pim/Break.def: Moved to...
* gm2-libs-log/Break.def: ...here.
* gm2-libs-pim/CardinalIO.def: Moved to...
* gm2-libs-log/CardinalIO.def: ...here.
* gm2-libs-pim/CardinalIO.mod: Moved to...
* gm2-libs-log/CardinalIO.mod: ...here.
* gm2-libs-pim/Conversions.def: Moved to...
* gm2-libs-log/Conversions.def: ...here.
* gm2-libs-pim/Conversions.mod: Moved to...
* gm2-libs-log/Conversions.mod: ...here.
* gm2-libs-pim/DebugPMD.def: Moved to...
* gm2-libs-log/DebugPMD.def: ...here.
* gm2-libs-pim/DebugPMD.mod: Moved to...
* gm2-libs-log/DebugPMD.mod: ...here.
* gm2-libs-pim/DebugTrace.def: Moved to...
* gm2-libs-log/DebugTrace.def: ...here.
* gm2-libs-pim/DebugTrace.mod: Moved to...
* gm2-libs-log/DebugTrace.mod: ...here.
* gm2-libs-pim/Delay.def: Moved to...
* gm2-libs-log/Delay.def: ...here.
* gm2-libs-pim/Delay.mod: Moved to...
* gm2-libs-log/Delay.mod: ...here.
* gm2-libs-pim/Display.def: Moved to...
* gm2-libs-log/Display.def: ...here.
* gm2-libs-pim/Display.mod: Moved to...
* gm2-libs-log/Display.mod: ...here.
* gm2-libs-pim/ErrorCode.def: Moved to...
* gm2-libs-log/ErrorCode.def: ...here.
* gm2-libs-pim/ErrorCode.mod: Moved to...
* gm2-libs-log/ErrorCode.mod: ...here.
* gm2-libs-pim/FileSystem.def: Moved to...
* gm2-libs-log/FileSystem.def: ...here.
* gm2-libs-pim/FileSystem.mod: Moved to...
* gm2-libs-log/FileSystem.mod: ...here.
* gm2-libs-pim/FloatingUtilities.def: Moved to...
* gm2-libs-log/FloatingUtilities.def: ...here.
* gm2-libs-pim/FloatingUtilities.mod: Moved to...
* gm2-libs-log/FloatingUtilities.mod: ...here.
* gm2-libs-pim/InOut.def: Moved to...
* gm2-libs-log/InOut.def: ...here.
* gm2-libs-pim/InOut.mod: Moved to...
* gm2-libs-log/InOut.mod: ...here.
* gm2-libs-pim/Keyboard.def: Moved to...
* gm2-libs-log/Keyboard.def: ...here.
* gm2-libs-pim/Keyboard.mod: Moved to...
* gm2-libs-log/Keyboard.mod: ...here.
* gm2-libs-pim/LongIO.def: Moved to...
* gm2-libs-log/LongIO.def: ...here.
* gm2-libs-pim/LongIO.mod: Moved to...
* gm2-libs-log/LongIO.mod: ...here.
* gm2-libs-pim/NumberConversion.def: Moved to...
* gm2-libs-log/NumberConversion.def: ...here.
* gm2-libs-pim/NumberConversion.mod: Moved to...
* gm2-libs-log/NumberConversion.mod: ...here.
* gm2-libs-pim/README.texi: Moved to...
* gm2-libs-log/README.texi: ...here.
* gm2-libs-pim/Random.def: Moved to...
* gm2-libs-log/Random.def: ...here.
* gm2-libs-pim/Random.mod: Moved to...
* gm2-libs-log/Random.mod: ...here.
* gm2-libs-pim/RealConversions.def: Moved to...
* gm2-libs-log/RealConversions.def: ...here.
* gm2-libs-pim/RealConversions.mod: Moved to...
* gm2-libs-log/RealConversions.mod: ...here.
* gm2-libs-pim/RealInOut.def: Moved to...
* gm2-libs-log/RealInOut.def: ...here.
* gm2-libs-pim/RealInOut.mod: Moved to...
* gm2-libs-log/RealInOut.mod: ...here.
* gm2-libs-pim/Strings.def: Moved to...
* gm2-libs-log/Strings.def: ...here.
* gm2-libs-pim/Strings.mod: Moved to...
* gm2-libs-log/Strings.mod: ...here.
* gm2-libs-pim/Termbase.def: Moved to...
* gm2-libs-log/Termbase.def: ...here.
* gm2-libs-pim/Termbase.mod: Moved to...
* gm2-libs-log/Termbase.mod: ...here.
* gm2-libs-pim/Terminal.def: Moved to...
* gm2-libs-log/Terminal.def: ...here.
* gm2-libs-pim/Terminal.mod: Moved to...
* gm2-libs-log/Terminal.mod: ...here.
* gm2-libs-pim/TimeDate.def: Moved to...
* gm2-libs-log/TimeDate.def: ...here.
* gm2-libs-pim/TimeDate.mod: Moved to...
* gm2-libs-log/TimeDate.mod: ...here.
libgm2/ChangeLog:
* libm2log/Makefile.am (VPATH): Replace gm2-libs-pim
with gm2-libs-log.
(libm2log_la_M2FLAGS): Replace gm2-libs-pim with
gm2-libs-log.
(install-data-local): Replace gm2-libs-pim with
gm2-libs-log.
* libm2log/Makefile.in: Rebuilt.
gcc/testsuite/ChangeLog:
* lib/gm2.exp (gm2_init_pimx): Replace gm2-libs-pim with
gm2-libs-log.
(gm2_init_iso): Replace gm2-libs-pim with gm2-libs-log.
(gm2_init_ulm): Replace gm2-libs-pim with gm2-libs-log.
(gm2_init_log): Replace gm2-libs-pim with gm2-libs-log.
(gm2_init_cor): Replace gm2-libs-pim with gm2-libs-log.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Martin Liska [Tue, 31 Jan 2023 09:35:33 +0000 (10:35 +0100)]
libsanitizer: Regenerate configure
libsanitizer/ChangeLog:
* configure: Regenerate.
Jakub Jelinek [Tue, 31 Jan 2023 09:12:19 +0000 (10:12 +0100)]
i386: Fix up ix86_convert_const_wide_int_to_broadcast [PR108599]
The following testcase is miscompiled. The problem is that during
RTL DSE we see a V4DI register is being loaded { 16, 16, 0, 0 }
value and DSE mostly works in terms of scalar modes, so it calls
movoi to set an OImode REG to (const_wide_int 0x100000000000000010)
and ix86_convert_const_wide_int_to_broadcast thinks it can compute
that value by broadcasting DImode 0x10. While it is true that
for TImode result the broadcast could be used, for OImode/XImode
it can't be, because all but the lowest 2 HOST_WIDE_INTs aren't
present (so are 0 or -1 depending on sign), not 0x10 in this case.
The function checks if the least significant HOST_WIDE_INT elt
of the CONST_WIDE_INT is broadcastable from QI/HI/SI/DImode and then
/* Check if OP can be broadcasted from VAL. */
for (int i = 1; i < CONST_WIDE_INT_NUNITS (op); i++)
if (val != CONST_WIDE_INT_ELT (op, i))
return nullptr;
That is needed of course, but nothing checks that
CONST_WIDE_INT_NUNITS (op) isn't too small for the mode in question.
I think if op would be 0 or -1, it ought to be never CONST_WIDE_INT,
but CONST_INT and so we can just punt whenever the number of
CONST_WIDE_INT elts is not the expected one.
2023-01-31 Jakub Jelinek <jakub@redhat.com>
PR target/108599
* config/i386/i386-expand.cc
(ix86_convert_const_wide_int_to_broadcast): Return nullptr if
CONST_WIDE_INT_NUNITS (op) times HOST_BITS_PER_WIDE_INT isn't
equal to bitsize of mode.
* gcc.target/i386/avx2-pr108599.c: New test.
Xianmiao Qu [Tue, 31 Jan 2023 08:49:06 +0000 (09:49 +0100)]
testsuite/108604 - gcc.dg/torture/pr108574-3.c hangs on unsigned char archs
In the architecture where sign defaults to unsigned, the 'f' will be zero
extended to int type in the expression 'd = ~(f & ~
2880764155)', then the
'd' will become -1 wich cause the case to fail.
So it's ok for the architectures where sign defaults to signed like x86,
but failed for the architectures where sign defaults to unsigned like arm
and csky. Change char to signed char to avoid this problem.
PR testsuite/108604
gcc/testsuite:
* gcc.dg/torture/pr108574-3.c (b, f): Change type from char to
signed char.
Jakub Jelinek [Tue, 31 Jan 2023 08:46:35 +0000 (09:46 +0100)]
bbpart: Fix up ICE on asm goto [PR108596]
On the following testcase we have asm goto in hot block with 2 successors,
one cold to which it both falls through and has one of the label
pointing to it and another hot successor with another label.
Now, during bbpart we want to ensure that no blocks from one partition fall
through into a block in a different partition. fix_up_fall_thru_edges
does that by temporarily clearing the EDGE_CROSSING on the fallthrough edge,
calling force_nonfallthru and then depending on whether it created a new
bb either set EDGE_CROSSING on the single successor edge from the new bb
(the new bb is kept in the same partition as the predecessor block), or
if no new bb has been created setting EDGE_CROSSING back on the fallthru
edge which has been forced non-EDGE_FALLTHRU.
For asm goto this doesn't always work, force_nonfallthru can create a new bb
and change the fallthrough edge to point to that, but if the original
fallthru destination block has its label referenced among the asm goto
labels, it will create a new non-fallthru edge for the label(s).
But because we've temporarily cheated and cleared EDGE_CROSSING on the edge,
it is cleared on the new edge as well, then the caller sees we've created
a new bb and just sets EDGE_CROSSING on the single fallthru edge from the
new bb. But the direct edge from cur_bb to fallthru edge's destination
isn't handled and fails afterwards consistency checks, because it crosses
partitions.
The following patch notes the case and sets EDGE_CROSSING on that edge too.
2023-01-31 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/108596
* bb-reorder.cc (fix_up_fall_thru_edges): Handle the case where cur_bb
ends with asm goto and has a crossing fallthrough edge to the same bb
that contains at least one of its labels by restoring EDGE_CROSSING
flag even on possible edge from cur_bb to new_bb successor.
* gcc.c-torture/compile/pr108596.c: New test.
Jakub Jelinek [Tue, 31 Jan 2023 08:20:34 +0000 (09:20 +0100)]
i386: Fix up -Wuninitialized warnings in avx512erintrin.h [PR105593]
As reported in the PR, there are some -Wuninitialized warnings in
avx512erintrin.h. One can see that by compiling sse-23.c testcase with
-Wuninitialized (or when actually using those intrinsics).
Those 6 spots use an uninitialized variable and pass it as one of the
argument to a builtin with constant mask -1, because there is no unmasked
builtin. It is true that expansion of those builtins into RTL will see
mask is all ones and ignore the unneeded argument, but -Wuninitialized
is diagnosed on GIMPLE and on GIMPLE these builtins are just builtin calls.
avx512fintrin.h and other headers use in these cases the _mm*_undefined_* ()
intrinsics, like:
return (__m512i) __builtin_ia32_psrav8di_mask ((__v8di) __X,
(__v8di) __Y,
(__v8di)
_mm512_undefined_epi32 (),
(__mmask8) -1);
etc. and the following patch does the same for avx512erintrin.h.
With the recent changes in C++ FE and the _mm*_undefined_* intrinsics,
we don't emit -Wuninitialized warnings for those (previously we didn't
just in C due to self-initialization). Of course we could also
just self-initialize these uninitialized vars and add the #pragma GCC
diagnostic dances around it, but using the intrinsics is consistent with
the rest and IMHO cleaner.
2023-01-31 Jakub Jelinek <jakub@redhat.com>
PR c++/105593
* config/i386/avx512erintrin.h (_mm512_exp2a23_round_pd,
_mm512_exp2a23_round_ps, _mm512_rcp28_round_pd, _mm512_rcp28_round_ps,
_mm512_rsqrt28_round_pd, _mm512_rsqrt28_round_ps): Use
_mm512_undefined_pd () or _mm512_undefined_ps () instead of using
uninitialized automatic variable __W.
* gcc.target/i386/sse-23.c: Add -Wuninitialized to dg-options.
Kito Cheng [Tue, 31 Jan 2023 03:48:51 +0000 (11:48 +0800)]
RISC-V: Simplify testcase condition for RVV tests [NFC]
We got some trouble on some platform, it show get twice for the asm, but
it only show once, seems like our pattern might be too complicated, so
simplify that make every platform happey with those testcase.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c: Refine the scan
condition.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c: Ditto.
* gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c: Ditto.
YunQiang Su [Fri, 6 Jan 2023 10:28:22 +0000 (18:28 +0800)]
libsanitizer/mips: always build with largefile support
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 is always used for mips
when build libsanitizer in LLVM. Thus
FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216);
instead of
FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
in sanitizer_platform_limits_posix.h.
To keep sync with LLVM and to make the code simple, we use the
largefile options always.
libsanitizer/
* configure.ac: set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
always for mips*.
* configure: Regenerate.
GCC Administrator [Tue, 31 Jan 2023 00:18:44 +0000 (00:18 +0000)]
Daily bump.
Gerald Pfeifer [Tue, 31 Jan 2023 00:11:32 +0000 (01:11 +0100)]
doc: Change fsf.org to www.fsf.org in URLs (GFDL)
We have been getting a 301 (permanent redirect) http response from
the server for a long while.
gcc/ChangeLog:
* doc/include/fdl.texi: Change fsf.org to www.fsf.org.
Gerald Pfeifer [Mon, 30 Jan 2023 22:12:23 +0000 (23:12 +0100)]
libstdc++: Update links in the Memory section of the manual
libstdc++-v3/ChangeLog:
* doc/xml/manual/shared_ptr.xml: Move links from both
http://open-std.org and http://www.open-std.org to
https://www.open-std.org.
* doc/html/manual/memory.html: Regenerate.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:40:50 +0000 (07:40 +0800)]
RISC-V: Add vloxei64 C++ API intrinsic testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vloxei64-1.C: New test.
* g++.target/riscv/rvv/base/vloxei64-2.C: New test.
* g++.target/riscv/rvv/base/vloxei64-3.C: New test.
* g++.target/riscv/rvv/base/vloxei64_mu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei64_mu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei64_mu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tum-1.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tum-2.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tum-3.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei64_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:39:29 +0000 (07:39 +0800)]
RISC-V: Add vloxei32 C++ API intrinsic testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vloxei32-1.C: New test.
* g++.target/riscv/rvv/base/vloxei32-2.C: New test.
* g++.target/riscv/rvv/base/vloxei32-3.C: New test.
* g++.target/riscv/rvv/base/vloxei32_mu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei32_mu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei32_mu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tum-1.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tum-2.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tum-3.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei32_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:37:39 +0000 (07:37 +0800)]
RISC-V: Add vloxei16 C++ API intrinsic testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vloxei16-1.C: New test.
* g++.target/riscv/rvv/base/vloxei16-2.C: New test.
* g++.target/riscv/rvv/base/vloxei16-3.C: New test.
* g++.target/riscv/rvv/base/vloxei16_mu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei16_mu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei16_mu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tum-1.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tum-2.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tum-3.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei16_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:35:38 +0000 (07:35 +0800)]
RISC-V: Add vloxei8 C++ API intrinsic testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vloxei8-1.C: New test.
* g++.target/riscv/rvv/base/vloxei8-2.C: New test.
* g++.target/riscv/rvv/base/vloxei8-3.C: New test.
* g++.target/riscv/rvv/base/vloxei8_mu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei8_mu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei8_mu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tu-3.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tum-1.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tum-2.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tum-3.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vloxei8_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:33:49 +0000 (07:33 +0800)]
RISC-V: Add vluxei64 C++ API intrinsic testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vluxei64-1.C: New test.
* g++.target/riscv/rvv/base/vluxei64-2.C: New test.
* g++.target/riscv/rvv/base/vluxei64-3.C: New test.
* g++.target/riscv/rvv/base/vluxei64_mu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei64_mu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei64_mu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tum-1.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tum-2.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tum-3.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei64_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:32:09 +0000 (07:32 +0800)]
RISC-V: Add vluxei32 C++ intrinsic API testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vluxei32-1.C: New test.
* g++.target/riscv/rvv/base/vluxei32-2.C: New test.
* g++.target/riscv/rvv/base/vluxei32-3.C: New test.
* g++.target/riscv/rvv/base/vluxei32_mu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei32_mu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei32_mu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tum-1.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tum-2.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tum-3.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei32_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:28:33 +0000 (07:28 +0800)]
RISC-V: Add vluxei16 C++ API intrinsic testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vluxei16-1.C: New test.
* g++.target/riscv/rvv/base/vluxei16-2.C: New test.
* g++.target/riscv/rvv/base/vluxei16-3.C: New test.
* g++.target/riscv/rvv/base/vluxei16_mu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei16_mu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei16_mu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tum-1.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tum-2.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tum-3.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei16_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:26:25 +0000 (07:26 +0800)]
RISC-V: Add vluxei8 C++ API intrinsic testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vluxei8-1.C: New test.
* g++.target/riscv/rvv/base/vluxei8-2.C: New test.
* g++.target/riscv/rvv/base/vluxei8-3.C: New test.
* g++.target/riscv/rvv/base/vluxei8_mu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei8_mu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei8_mu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tu-3.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tum-1.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tum-2.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tum-3.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tumu-2.C: New test.
* g++.target/riscv/rvv/base/vluxei8_tumu-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:24:01 +0000 (07:24 +0800)]
RISC-V: Add vsuxei* C++ API intrinsics testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vsuxei16-1.C: New test.
* g++.target/riscv/rvv/base/vsuxei16-2.C: New test.
* g++.target/riscv/rvv/base/vsuxei16-3.C: New test.
* g++.target/riscv/rvv/base/vsuxei32-1.C: New test.
* g++.target/riscv/rvv/base/vsuxei32-2.C: New test.
* g++.target/riscv/rvv/base/vsuxei32-3.C: New test.
* g++.target/riscv/rvv/base/vsuxei64-1.C: New test.
* g++.target/riscv/rvv/base/vsuxei64-2.C: New test.
* g++.target/riscv/rvv/base/vsuxei64-3.C: New test.
* g++.target/riscv/rvv/base/vsuxei8-1.C: New test.
* g++.target/riscv/rvv/base/vsuxei8-2.C: New test.
* g++.target/riscv/rvv/base/vsuxei8-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:18:34 +0000 (07:18 +0800)]
RISC-V: Add vsuxei C API intrinsic testcase
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vsuxei16_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei16_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei16_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei16_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei16_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei16_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei32_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei64_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsuxei8_v_m-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:16:58 +0000 (07:16 +0800)]
RISC-V: Add vsoxei C API intrinsic testcase
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vsoxei16_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei16_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei16_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei16_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei16_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei16_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei32_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei64_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v-3.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsoxei8_v_m-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:14:44 +0000 (07:14 +0800)]
RISC-V: Add vsoxei32 && vsoxei64 C++ API intrinsic testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vsoxei32-1.C: New test.
* g++.target/riscv/rvv/base/vsoxei32-2.C: New test.
* g++.target/riscv/rvv/base/vsoxei32-3.C: New test.
* g++.target/riscv/rvv/base/vsoxei64-1.C: New test.
* g++.target/riscv/rvv/base/vsoxei64-2.C: New test.
* g++.target/riscv/rvv/base/vsoxei64-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:11:40 +0000 (07:11 +0800)]
RISC-V: Add vsoxei8 && vsoxei16 C++ API intrinsic testcase
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vsoxei16-1.C: New test.
* g++.target/riscv/rvv/base/vsoxei16-2.C: New test.
* g++.target/riscv/rvv/base/vsoxei16-3.C: New test.
* g++.target/riscv/rvv/base/vsoxei8-1.C: New test.
* g++.target/riscv/rvv/base/vsoxei8-2.C: New test.
* g++.target/riscv/rvv/base/vsoxei8-3.C: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:08:30 +0000 (07:08 +0800)]
RISC-V: Add vluxei64 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vluxei64_v-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei64_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 23:06:32 +0000 (07:06 +0800)]
RISC-V: Add vluxei32 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vluxei32_v-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei32_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 22:56:39 +0000 (06:56 +0800)]
RISC-V: Add vluxei16 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vluxei16_v-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei16_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:52:35 +0000 (23:52 +0800)]
RISC-V: Add vluxei8 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vluxei8_v-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vluxei8_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:50:34 +0000 (23:50 +0800)]
RISC-V: Add vloxei64 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vloxei64_v-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei64_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:48:46 +0000 (23:48 +0800)]
RISC-V: Add vloxei32 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vloxei32_v-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei32_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:46:54 +0000 (23:46 +0800)]
RISC-V: Add vloxei16 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vloxei16_v-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei16_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:44:24 +0000 (23:44 +0800)]
RISC-V: Add vloxei8 C API intrinsic testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vloxei8_v-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_m-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_m-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_m-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vloxei8_v_tumu-3.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:37:21 +0000 (23:37 +0800)]
RISC-V: Add indexed loads/stores constraints testcases
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/vlxei-vsxei-constraint-1.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:34:57 +0000 (23:34 +0800)]
RISC-V: Add VSETVL testcases for indexed loads/stores.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/vsetvl/avl_single-72.c: New test.
* gcc.target/riscv/rvv/vsetvl/avl_single-76.c: New test.
* gcc.target/riscv/rvv/vsetvl/avl_single-77.c: New test.
Ju-Zhe Zhong [Sun, 29 Jan 2023 15:32:33 +0000 (23:32 +0800)]
RISC-V: Add indexed loads/stores C/C++ intrinsic support
gcc/ChangeLog:
* config/riscv/riscv-protos.h (get_vector_mode): New function.
* config/riscv/riscv-v.cc (get_vector_mode): Ditto.
* config/riscv/riscv-vector-builtins-bases.cc (enum lst_type): New enum.
(class loadstore): Adjust for indexed loads/stores support.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: New function declare.
* config/riscv/riscv-vector-builtins-functions.def (vluxei8): Ditto.
(vluxei16): Ditto.
(vluxei32): Ditto.
(vluxei64): Ditto.
(vloxei8): Ditto.
(vloxei16): Ditto.
(vloxei32): Ditto.
(vloxei64): Ditto.
(vsuxei8): Ditto.
(vsuxei16): Ditto.
(vsuxei32): Ditto.
(vsuxei64): Ditto.
(vsoxei8): Ditto.
(vsoxei16): Ditto.
(vsoxei32): Ditto.
(vsoxei64): Ditto.
* config/riscv/riscv-vector-builtins-shapes.cc
(struct indexed_loadstore_def): New class.
(SHAPE): Ditto.
* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
* config/riscv/riscv-vector-builtins.cc (required_extensions_p): Adjust
for indexed loads/stores support.
(check_required_extensions): Ditto.
(rvv_arg_type_info::get_base_vector_type): New function.
(rvv_arg_type_info::get_tree_type): Ditto.
(function_builder::add_unique_function): Adjust for indexed loads/stores
support.
(function_expander::use_exact_insn): New function.
* config/riscv/riscv-vector-builtins.h (enum rvv_base_type): Adjust for
indexed loads/stores support.
(struct rvv_arg_type_info): Ditto.
(function_expander::index_mode): New function.
(function_base::apply_tail_policy_p): Ditto.
(function_base::apply_mask_policy_p): Ditto.
* config/riscv/vector-iterators.md (unspec): New unspec.
* config/riscv/vector.md (unspec): Ditto.
(@pred_indexed_<order>load<VNX1_QHSD:mode><VNX1_QHSDI:mode>): New
pattern.
(@pred_indexed_<order>store<VNX1_QHSD:mode><VNX1_QHSDI:mode>): Ditto.
(@pred_indexed_<order>load<VNX2_QHSD:mode><VNX2_QHSDI:mode>): Ditto.
(@pred_indexed_<order>store<VNX2_QHSD:mode><VNX2_QHSDI:mode>): Ditto.
(@pred_indexed_<order>load<VNX4_QHSD:mode><VNX4_QHSDI:mode>): Ditto.
(@pred_indexed_<order>store<VNX4_QHSD:mode><VNX4_QHSDI:mode>): Ditto.
(@pred_indexed_<order>load<VNX8_QHSD:mode><VNX8_QHSDI:mode>): Ditto.
(@pred_indexed_<order>store<VNX8_QHSD:mode><VNX8_QHSDI:mode>): Ditto.
(@pred_indexed_<order>load<VNX16_QHS:mode><VNX16_QHSI:mode>): Ditto.
(@pred_indexed_<order>store<VNX16_QHS:mode><VNX16_QHSI:mode>): Ditto.
(@pred_indexed_<order>load<VNX32_QH:mode><VNX32_QHI:mode>): Ditto.
(@pred_indexed_<order>store<VNX32_QH:mode><VNX32_QHI:mode>): Ditto.
(@pred_indexed_<order>load<VNX64_Q:mode><VNX64_Q:mode>): Ditto.
(@pred_indexed_<order>store<VNX64_Q:mode><VNX64_Q:mode>): Ditto.
Flavio Cruz [Fri, 27 Jan 2023 03:45:27 +0000 (22:45 -0500)]
Add support for x86_64-*-gnu-* targets to build x86_64 gnumach/hurd
Tested by building a toolchain and compiling gnumach for x86_64 [1].
This is the basic version without unwind support which I think is only
required to implement exceptions.
[1]
https://github.com/flavioc/cross-hurd/blob/master/bootstrap-kernel.sh.
gcc/ChangeLog:
* config.gcc: Recognize x86_64-*-gnu* targets and include
i386/gnu64.h.
* config/i386/gnu64.h: Define configuration for new target
including ld.so location.
libgcc/ChangeLog:
* config.host: Recognize x86_64-*-gnu* targets.
* config/i386/gnu-unwind.h: Update to handle __x86_64__ with a
TODO for now.
Signed-off-by: Flavio Cruz <flaviocruz@gmail.com>
Philipp Tomsich [Wed, 25 Jan 2023 19:15:14 +0000 (20:15 +0100)]
aarch64: Update Ampere-1A (-mcpu=ampere1a) to include SM4
gcc/ChangeLog:
* config/aarch64/aarch64-cores.def (AARCH64_CORE): Update
ampere1a to include SM4.
Rainer Orth [Mon, 30 Jan 2023 13:26:06 +0000 (14:26 +0100)]
testsuite: Restore TORTURE_OPTIONS in gm2/warnings/returntype/fail/warnings-returntype-fail.exp
Between
20230126 and
20230127, 1100+ gm2 tests started to FAIL for the
non-default multilib, e.g.
FAIL: gm2/calling-c/datatypes/unbounded/run/pass/m.mod compilation,
{additional_flags= -O0 -g -Werror=return-type } timeout=10
UNRESOLVED: gm2/calling-c/datatypes/unbounded/run/pass/m.mod execution,
{additional_flags= -O0 -g -Werror=return-type } timeout=10
FAIL: gm2/case/pass/testcase1.mod, -O0 -g -Werror=return-type
[...]
cc1gm2: warning: '-Werror=' argument '-Werror=return-type' is not valid for
Modula-2
I'm seeing this on all of Solaris/x86, Solaris/SPARC, and Linux/x86_64.
I could trace this to
gm2/warnings/returntype/fail/warnings-returntype-fail.exp not properly
restoring TORTURE_OPTIONS.
Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.
2023-01-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
* gm2/warnings/returntype/fail/warnings-returntype-fail.exp: Save,
restore TORTURE_OPTIONS.
Andrew Pinski [Sat, 28 Jan 2023 18:27:08 +0000 (18:27 +0000)]
Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.
This patch adds a check in match_simplify_replacement to make sure the middlebb
does not have any phi-nodes as we don't currently move those.
This was just a thinko from before.
Ok? Bootstrapped and tested on x86_64-linux-gnu with no regressions?
PR tree-optimization/108582
gcc/ChangeLog:
* tree-ssa-phiopt.cc (match_simplify_replacement): Add check
for middlebb to have no phi nodes.
gcc/testsuite/ChangeLog:
* gcc.dg/pr108582-1.c: New test.
Richard Biener [Mon, 30 Jan 2023 08:25:23 +0000 (09:25 +0100)]
tree-optimization/108574 - wrong-code with PRE PHI node processing
The PR108523 was too optimistic in replacing the same value with
an equivalence from a possibly not taken edge. The following
rectifies this and instead refrains from using the equivalence in
the problematic cases.
PR tree-optimization/108574
* tree-ssa-sccvn.cc (visit_phi): Instead of swapping
sameval and def, ignore the equivalence if there's the
danger of oscillating between two values.
* gcc.dg/torture/pr108574-1.c: New testcase.
* gcc.dg/torture/pr108574-2.c: Likewise.
* gcc.dg/torture/pr108574-3.c: Likewise.
Andreas Schwab [Wed, 25 Jan 2023 11:00:09 +0000 (12:00 +0100)]
riscv: Enable -fasynchronous-unwind-tables by default on Linux
This follows the example of aarch64.
gcc/:
* common/config/riscv/riscv-common.cc
(riscv_option_optimization_table)
[TARGET_DEFAULT_ASYNC_UNWIND_TABLES]: Enable
-fasynchronous-unwind-tables and -funwind-tables.
* config.gcc (riscv*-*-linux*): Define
TARGET_DEFAULT_ASYNC_UNWIND_TABLES.
YunQiang Su [Fri, 6 Jan 2023 10:15:28 +0000 (18:15 +0800)]
Set CROSS_SYSTEM_HEADER_DIR according includedir
For cross building with option:
--sysroot=/ --prefix=/usr --includedir=/usr/<triple>
just like Debian does, fixinc.sh will use the wrong header files
from /usr/include.
gcc/
* Makefile.in (CROSS_SYSTEM_HEADER_DIR): set according the
value of includedir.
Richard Biener [Mon, 30 Jan 2023 07:20:03 +0000 (08:20 +0100)]
ipa/108511 - relax assert for undefined local statics
Since we no longer promote undefined local statics extern the
assert in possibly_call_in_translation_unit_p triggers. The
following relaxes it according to Honzas advice.
PR ipa/108511
* cgraph.cc (possibly_call_in_translation_unit_p): Relax
assert.
liuhongt [Sat, 28 Jan 2023 14:27:17 +0000 (22:27 +0800)]
Change AVX512FP16 to AVX512-FP16 in the document.
The official name is AVX512-FP16.
gcc/ChangeLog:
* config/i386/i386.opt: Change AVX512FP16 to AVX512-FP16.
* doc/invoke.texi: Ditto.
GCC Administrator [Mon, 30 Jan 2023 00:16:41 +0000 (00:16 +0000)]
Daily bump.
Mikael Morin [Sun, 29 Jan 2023 20:57:24 +0000 (21:57 +0100)]
fortran: Set name for *LOC default BACK argument [PR108450]
This change fixes an ICE caused by the double resolution of MINLOC,
MAXLOC and FINDLOC expressions which get a default value for the BACK
argument at resolution time. That argument is added without name,
and argument reordering code is not prepared to handle unnamed arguments
coming after named ones, so the second resolution causes a NULL pointer
dereference.
The problem is fixed by explicitly setting the argument name.
PR fortran/108450
gcc/fortran/ChangeLog:
* check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
(gfc_check_findloc): Ditto.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/minmaxloc_1.f90: New test.
Jerry DeLisle [Sun, 29 Jan 2023 04:00:34 +0000 (20:00 -0800)]
ICE in gfc_free_namespace. ice-on-invalid.
PR fortran/103506
gcc/fortran/ChangeLog:
* parse.cc (parse_module): Remove use of a bool error value
that prevented proper setting of the namespace pointer.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr103506_1.f90: New test.
Jan Hubicka [Sun, 29 Jan 2023 00:27:26 +0000 (01:27 +0100)]
Fix find_always_executed_bbs handling of infinite loops
This patch fixes the stupid typo info find_always_executed_bbs which made
all edges to be considered as ones closing infinite loops. This fix has
somewhat snowballed as, comparing it to finite_function_p, I noticed a
divergence in handling of volatile asms (find_always_executed_bbs is conservative
and thinks that volatile statement may return or do EH, but it is really
impossible and elsewhere we expects that we dont) and I also noticed
a bug in handling early returns which made some loops to be missed.
I also noticed that function assumes that irreducible loops are marked in CFG
which is not necessarily true and it is easy to detect them during the walk.
Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:
2023-01-29 Jan Hubicka <hubicka@ucw.cz>
* ipa-utils.cc: Include calls.h, cfgloop.h and cfganal.h
(stmt_may_terminate_function_p): If assuming return or EH
volatile asm is safe.
(find_always_executed_bbs): Fix handling of terminating BBS and
infinite loops; add debug output.
* tree-ssa-alias.cc (stmt_kills_ref_p): Fix debug output
gcc/testsuite/ChangeLog:
2023-01-29 Jan Hubicka <hubicka@ucw.cz>
* gcc.dg/ipa/ipa-sra-30.c: New test.
* gcc.dg/ipa/ipa-sra-31.c: New test.
* gcc.dg/tree-ssa/modref-dse-7.c: New test.
GCC Administrator [Sun, 29 Jan 2023 00:17:14 +0000 (00:17 +0000)]
Daily bump.
Philipp Tomsich [Sat, 28 Jan 2023 23:07:09 +0000 (00:07 +0100)]
aarch64: Correct the maximum shift amount for shifted operands
The aarch64 ISA specification allows a left shift amount to be applied
after extension in the range of 0 to 4 (encoded in the imm3 field).
This is true for at least the following instructions:
* ADD (extend register)
* ADDS (extended register)
* SUB (extended register)
The result of this patch can be seen, when compiling the following code:
uint64_t myadd(uint64_t a, uint64_t b)
{
return a+(((uint8_t)b)<<4);
}
Without the patch the following sequence will be generated:
0000000000000000 <myadd>:
0:
d37c1c21 ubfiz x1, x1, #4, #8
4:
8b000020 add x0, x1, x0
8:
d65f03c0 ret
With the patch the ubfiz will be merged into the add instruction:
0000000000000000 <myadd>:
0:
8b211000 add x0, x0, w1, uxtb #4
4:
d65f03c0 ret
gcc/ChangeLog:
* config/aarch64/aarch64.cc (aarch64_uxt_size): fix an
off-by-one in checking the permissible shift-amount.
Gerald Pfeifer [Sat, 28 Jan 2023 22:19:46 +0000 (23:19 +0100)]
doc: Update link to the AVR-Libc manual
gcc/ChangeLog:
* doc/extend.texi (Named Address Spaces): Update link to the
AVR-Libc manual.
Gerald Pfeifer [Sat, 28 Jan 2023 22:07:01 +0000 (23:07 +0100)]
libstdc++: Update links in the "Contributing" manual
libstdc++-v3/ChangeLog:
* doc/xml/manual/appendix_contributing.xml: Adjust link to
ISO C++ standard at ANSI.
Move link to www.open-std.org to https.
* doc/html/manual/appendix_contributing.html: Regenerate.
Harald Anlauf [Tue, 24 Jan 2023 21:36:25 +0000 (22:36 +0100)]
Fortran: fix ICE in compare_bound_int [PR108527]
gcc/fortran/ChangeLog:
PR fortran/108527
* resolve.cc (compare_bound_int): Expression to compare must be of
type INTEGER.
(compare_bound_mpz_t): Likewise.
(check_dimension): Fix comment on checks applied to array section
and clean up associated logic.
gcc/testsuite/ChangeLog:
PR fortran/108527
* gfortran.dg/pr108527.f90: New test.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
Harald Anlauf [Sat, 28 Jan 2023 16:59:23 +0000 (17:59 +0100)]
Fortran: diagnose USE associated symbols in COMMON blocks [PR108453]
gcc/fortran/ChangeLog:
PR fortran/108453
* match.cc (gfc_match_common): A USE associated name shall not appear
in a COMMON block (F2018:C8121).
gcc/testsuite/ChangeLog:
PR fortran/108453
* gfortran.dg/common_27.f90: New test.
Gerald Pfeifer [Sat, 28 Jan 2023 18:26:46 +0000 (19:26 +0100)]
doc: Fix markup
gcc/ChangeLog:
* doc/standards.texi (Standards): Fix markup.
Gerald Pfeifer [Sat, 28 Jan 2023 18:23:35 +0000 (19:23 +0100)]
doc: Update link to Objective-C book
gcc/ChangeLog:
* doc/standards.texi (Standards): Update link to Objective-C book.
Jonathan Yong [Wed, 11 Jan 2023 09:51:02 +0000 (09:51 +0000)]
PR c/108192 - Fix test for mingw
gcc/testsuite/ChangeLog:
PR c/108192
* g++.dg/cet-notrack-1.C: Use puts instead of printf,
so function call is not mangled by __mingw_printf when
doing assembly symbol inspection.
Signed-off-by: Jonathan Yong <10walls@gmail.com>
Jonathan Yong [Sun, 8 Jan 2023 01:28:34 +0000 (01:28 +0000)]
PR c/108150 - Fix alignment test for Windows targets
gcc/testsuite/ChangeLog:
PR c/108150
* gcc.dg/attr-aligned.c: Make errors emitted on Windows
target same as on Linux.
Signed-off-by: Jonathan Yong <10walls@gmail.com>
Iain Sandoe [Sat, 28 Jan 2023 09:38:23 +0000 (09:38 +0000)]
Modula-2: Claim Wreturn-type in lang.opt.
Modula-2 handles this warning so that we need to claim it in the
language options.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/m2/ChangeLog:
* lang.opt: Claim Wreturn-type.
Gerald Pfeifer [Sat, 28 Jan 2023 10:49:13 +0000 (11:49 +0100)]
libstdc++: Move sourceforge.net links to https
libstdc++-v3/ChangeLog:
* doc/xml/manual/documentation_hacking.xml: Move sourceforge.net
links to https.
* doc/html/manual/documentation_hacking.html: Regenerate.
Gerald Pfeifer [Sat, 28 Jan 2023 10:35:40 +0000 (11:35 +0100)]
doc: Update reference to AddressSanitizer
gcc/ChangeLog:
* doc/invoke.texi (Instrumentation Options): Update reference to
AddressSanitizer.
Gerald Pfeifer [Sat, 28 Jan 2023 10:23:16 +0000 (11:23 +0100)]
doc: Update Go1 link
gcc/ChangeLog:
* doc/standards.texi: Update Go1 link.
Gerald Pfeifer [Sat, 28 Jan 2023 10:12:57 +0000 (11:12 +0100)]
libstdc++: Switch open-std.org to https (ABI manual)
libstdc++-v3/ChangeLog:
* doc/xml/manual/abi.xml: Update www.open-std.org link to https.
* doc/html/manual/abi.html: Regenerate.
Ju-Zhe Zhong [Fri, 27 Jan 2023 23:27:57 +0000 (07:27 +0800)]
RISC-V: Add vlse/vsse C/C++ intrinsic testcases
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/vlse-1.C: New test.
* g++.target/riscv/rvv/base/vlse_tu-1.C: New test.
* g++.target/riscv/rvv/base/vlse_tum-1.C: New test.
* g++.target/riscv/rvv/base/vlse_tumu-1.C: New test.
* g++.target/riscv/rvv/base/vsse-1.C: New test.
* gcc.target/riscv/rvv/base/vlse-1.c: New test.
* gcc.target/riscv/rvv/base/vlse-2.c: New test.
* gcc.target/riscv/rvv/base/vlse-3.c: New test.
* gcc.target/riscv/rvv/base/vlse-vsse-constraint-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_m-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_m-2.c: New test.
* gcc.target/riscv/rvv/base/vlse_m-3.c: New test.
* gcc.target/riscv/rvv/base/vlse_mu-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_mu-2.c: New test.
* gcc.target/riscv/rvv/base/vlse_mu-3.c: New test.
* gcc.target/riscv/rvv/base/vlse_tu-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_tu-2.c: New test.
* gcc.target/riscv/rvv/base/vlse_tu-3.c: New test.
* gcc.target/riscv/rvv/base/vlse_tum-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_tum-2.c: New test.
* gcc.target/riscv/rvv/base/vlse_tum-3.c: New test.
* gcc.target/riscv/rvv/base/vlse_tumu-1.c: New test.
* gcc.target/riscv/rvv/base/vlse_tumu-2.c: New test.
* gcc.target/riscv/rvv/base/vlse_tumu-3.c: New test.
* gcc.target/riscv/rvv/base/vsse-1.c: New test.
* gcc.target/riscv/rvv/base/vsse-2.c: New test.
* gcc.target/riscv/rvv/base/vsse-3.c: New test.
* gcc.target/riscv/rvv/base/vsse_m-1.c: New test.
* gcc.target/riscv/rvv/base/vsse_m-2.c: New test.
* gcc.target/riscv/rvv/base/vsse_m-3.c: New test.
Ju-Zhe Zhong [Fri, 27 Jan 2023 23:26:08 +0000 (07:26 +0800)]
RISC-V: Add vlse/vsse intrinsics support
gcc/ChangeLog:
* config/riscv/predicates.md (pmode_reg_or_0_operand): New predicate.
* config/riscv/riscv-vector-builtins-bases.cc (class loadstore):
Support vlse/vsse.
(BASE): Ditto.
* config/riscv/riscv-vector-builtins-bases.h: Ditto.
* config/riscv/riscv-vector-builtins-functions.def (vlse): New class.
(vsse): New class.
* config/riscv/riscv-vector-builtins.cc
(function_expander::use_contiguous_load_insn): Support vlse/vsse.
* config/riscv/vector.md (@pred_strided_load<mode>): New md pattern.
(@pred_strided_store<mode>): Ditto.
Ju-Zhe Zhong [Fri, 27 Jan 2023 22:57:14 +0000 (06:57 +0800)]
RISC-V: Remove redundant attributes [NFC]
gcc/ChangeLog:
* config/riscv/vector.md (tail_policy_op_idx): Remove.
(mask_policy_op_idx): Remove.
(avl_type_op_idx): Remove.
Jerry DeLisle [Sat, 21 Jan 2023 23:47:19 +0000 (15:47 -0800)]
Fortran tests: Revise line end tests allowing windows testing.
gcc/testsuite/ChangeLog:
* gfortran.dg/ISO_Fortran_binding_17.f90: Replace (\n|\r\n|\r)
with (\r*\n+).
* gfortran.dg/array_temporaries_2.f90: Likewise.
* gfortran.dg/bind-c-contiguous-1.f90: Likewise.
* gfortran.dg/bind-c-contiguous-4.f90: Likewise.
* gfortran.dg/bind-c-contiguous-5.f90: Likewise.
* gfortran.dg/fmt_error_4.f90: Likewise.
* gfortran.dg/fmt_error_5.f90: Likewise.
* gfortran.dg/fmt_float.f90: Likewise.
* gfortran.dg/fmt_l.f90: Likewise.
* gfortran.dg/fmt_nonchar_2.f90: Likewise.
* gfortran.dg/fmt_zero_precision.f90: Likewise.
* gfortran.dg/g77/f77-edit-apostrophe-out.f: Likewise.
* gfortran.dg/g77/f77-edit-colon-out.f: Likewise.
* gfortran.dg/g77/f77-edit-h-out.f: Likewise.
* gfortran.dg/g77/f77-edit-i-out.f: Likewise.
* gfortran.dg/g77/f77-edit-s-out.f: Likewise.
* gfortran.dg/g77/f77-edit-slash-out.f: Likewise.
* gfortran.dg/g77/f77-edit-t-out.f: Likewise.
* gfortran.dg/g77/f77-edit-x-out.f: Likewise.
* gfortran.dg/namelist_40.f90: Likewise.
* gfortran.dg/namelist_47.f90: Likewise.
* gfortran.dg/namelist_print_1.f: Likewise.
* gfortran.dg/parameter_array_dummy.f90: Likewise.
GCC Administrator [Sat, 28 Jan 2023 00:16:39 +0000 (00:16 +0000)]
Daily bump.
Gaius Mulley [Fri, 27 Jan 2023 22:18:46 +0000 (22:18 +0000)]
PR-108557 Stuck compilation for empty file
Trying to compile an empty file causes cc1gm2 to hang.
The bug occurs when M2LexBuf.mod calls m2flex.GetToken after
an eof token has been seen which results in m2flex attempting
to read from stdin. The bug fix detects eof per file and
blocks subsequent calls to m2flex.GetToken.
gcc/m2/ChangeLog:
* gm2-compiler/M2Comp.mod: Import MetaString0.
(ExamineCompilationUnit): New variable Message.
Create and format error string.
* gm2-compiler/M2LexBuf.mod: New variable SeenEof.
(GetNonEofToken): New procedure.
(Init): Set SeenEof to FALSE.
(GetToken): Use GetNonEofToken instead of calls to
m2flex.GetToken and GetToken.
(AddTok): Detect eoftok and set SeenEof.
gcc/testsuite/ChangeLog:
* gm2/pim/fail/empty.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Joseph Myers [Fri, 27 Jan 2023 21:38:57 +0000 (21:38 +0000)]
c: Disallow braces around C2x auto initializers
WG14 agreed at this week's meeting to remove support for braces around
auto scalar initializers, as incompatible with C++ auto handling of
braced initializers; thus remove that support in GCC.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c/
* c-parser.cc (c_parser_declaration_or_fndef): Do not allow braces
around auto initializer.
gcc/testsuite/
* gcc.dg/c2x-auto-1.c, gcc.dg/c2x-auto-3.c: Expect braces around
auto initializers to be disallowed.
Jakub Jelinek [Fri, 27 Jan 2023 19:11:20 +0000 (20:11 +0100)]
libstdc++: Fix up FAIL in 17_intro/names.cc on glibc < 2.19 [PR108568]
On gcc112 which has glibc 2.17 I've noticed
FAIL: 17_intro/names.cc (test for excess errors)
FAIL: experimental/names.cc (test for excess errors)
These are because glibc < 2.19 used __unused as field member of various structs,
including mcontext_t in sys/ucontext.h on ppc64le.
This was changed in glibc with
https://gcc.gnu.org/pipermail/libc-alpha/2013-November/045766.html
names.cc even has
#ifdef __GLIBC_PREREQ
#if ! __GLIBC_PREREQ(2, 19)
// Glibc defines this prior to 2.19
#undef __unused
#endif
#endif
for it, but it doesn't work. The reason is that __GLIBC_PREREQ is defined in
<features.h> but nothing included that header before this spot (it is included later
from bits/stdc++.h).
The following patch on Linux/Hurd conditionally includes features.h to get
the needed macros before deciding if __unused should be undefined or not.
If needed, I could use __GLIBC_PREREQ then but would need to check if it is
defined and between 1996 and 1999 it wasn't.
2023-01-27 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/108568
* testsuite/17_intro/names.cc (__unused): For linux or GNU hurd
include features.h if present and then check __GLIBC__ and
__GLIBC_MINOR__ macros for glibc prior to 2.19, instead of testing
__GLIBC_PREREQ which isn't defined yet.
Richard Sandiford [Fri, 27 Jan 2023 17:04:28 +0000 (17:04 +0000)]
testsuite: Two adjustments to gcc.dg/vect/complex
fast-math-bb-slp-complex-add-pattern-half-float.c no longer fails.
The scans in (loop test) fast-math-complex-add-half-float.c were
marked UNRESOLVED because they scanned slp1 rather than vect.
gcc/testsuite/
* gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c:
Remove XFAIL.
* gcc.dg/vect/complex/fast-math-complex-add-half-float.c: Fix names
of dump files.
Richard Sandiford [Fri, 27 Jan 2023 17:04:28 +0000 (17:04 +0000)]
aarch64: Prevent simd tests from being optimised away
The vqdml[as]l[hs]_laneq_* tests were folded at compile time, meaning
that we didn't have any Advanced SIMD instructions in the assembly.
Kyrill's preference was to use wrapper functions, so this patch does
that for the failing tests and for others that had scan-assemblers
with inline intrinsics calls. (There were some tests that already
used wrapper functions, some that used volatile, some that used
inline asm barriers, and some that had no separation.)
Doing that for vqdmulhs_lane_s32.c meant that we generated the scalar
form of the instruction, rather than a vector instruction operating
on lane 0. That seems fair enough, so the patch keeps that test but
adds a second one for lane 1.
gcc/testsuite/
* gcc.target/aarch64/simd/vfma_f64.c: Use a wrapper function
rather than an asm barrier.
* gcc.target/aarch64/simd/vfms_f64.c: Likewise.
* gcc.target/aarch64/simd/vmul_f64_1.c: Use a wrapper function
rather than volatile.
* gcc.target/aarch64/simd/vmul_n_f64_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlalh_laneq_s16_1.c: Use a wrapper
function. Remove -fno-inline.
* gcc.target/aarch64/simd/vqdmlals_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlslh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlsls_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhh_lane_s16.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhs_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhh_lane_s16.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhs_lane_s32.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhs_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhs_lane_s32.c: Likewise.
Allow the scalar form to be used when operating on lane 0.
Add a test for lane 1.