diff options
136 files changed, 3958 insertions, 600 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f52642..4c214df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2025-05-16 Maciej W. Rozycki <macro@orcam.me.uk> + + Backported from master: + 2025-04-19 Maciej W. Rozycki <macro@orcam.me.uk> + + * config/alpha/alpha.cc + (alpha_get_mem_rtx_alignment_and_offset): Recurse into + COMPONENT_REF nodes. + +2025-05-14 Kyle Huey <me@kylehuey.com> + + * dwarf2out.cc (resolve_addr_in_expr): Propagate dtprel into the address + table when appropriate. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-05-12 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/120188 + * doc/gm2.texi (Semantic checking): Add -fm2-plugin command line option. + 2025-05-11 Richard Biener <rguenther@suse.de> PR tree-optimization/120211 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 823f45b..4ea9877 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250512 +20250520 diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc index ba470d9..14e7da5 100644 --- a/gcc/config/alpha/alpha.cc +++ b/gcc/config/alpha/alpha.cc @@ -4291,14 +4291,10 @@ alpha_get_mem_rtx_alignment_and_offset (rtx expr, int &a, HOST_WIDE_INT &o) tree mem = MEM_EXPR (expr); if (mem != NULL_TREE) - switch (TREE_CODE (mem)) - { - case MEM_REF: - tree_offset = mem_ref_offset (mem).force_shwi (); - tree_align = get_object_alignment (get_base_address (mem)); - break; + { + HOST_WIDE_INT comp_offset = 0; - case COMPONENT_REF: + for (; TREE_CODE (mem) == COMPONENT_REF; mem = TREE_OPERAND (mem, 0)) { tree byte_offset = component_ref_field_offset (mem); tree bit_offset = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (mem, 1)); @@ -4307,14 +4303,15 @@ alpha_get_mem_rtx_alignment_and_offset (rtx expr, int &a, HOST_WIDE_INT &o) || !poly_int_tree_p (byte_offset, &offset) || !tree_fits_shwi_p (bit_offset)) break; - tree_offset = offset + tree_to_shwi (bit_offset) / BITS_PER_UNIT; + comp_offset += offset + tree_to_shwi (bit_offset) / BITS_PER_UNIT; } - tree_align = get_object_alignment (get_base_address (mem)); - break; - default: - break; - } + if (TREE_CODE (mem) == MEM_REF) + { + tree_offset = comp_offset + mem_ref_offset (mem).force_shwi (); + tree_align = get_object_alignment (get_base_address (mem)); + } + } if (reg_align > mem_align) { diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f950c61..ae663cd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,42 @@ +2025-05-15 Patrick Palka <ppalka@redhat.com> + + Backported from master: + 2025-05-15 Patrick Palka <ppalka@redhat.com> + + PR c++/120161 + * pt.cc (unify) <case RECORD_TYPE>: When comparing specializations + of a non-primary template, still perform a type comparison. + +2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + Backported from master: + 2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/120125 + * module.cc (trees_out::write_function_def): Only set + DECL_NOT_REALLY_EXTERN if the importer might need to emit it. + * optimize.cc (maybe_thunk_body): Don't assume 'fn' has a cgraph + node created. + +2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + Backported from master: + 2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/119864 + * decl2.cc (start_objects): Only use module initialized for + host. + (c_parse_final_cleanups): Don't always create an OMP offload + init function in modules. + +2025-05-12 Jason Merrill <jason@redhat.com> + + Backported from master: + 2025-05-12 Jason Merrill <jason@redhat.com> + + PR c++/120012 + * class.cc (check_non_pod_aggregate): Check is_empty_class. + 2025-05-07 Jason Merrill <jason@redhat.com> Backported from master: diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index 6767ac1..93ad9d6 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -6835,8 +6835,10 @@ check_non_pod_aggregate (tree field) tree type = TREE_TYPE (field); if (TYPE_IDENTIFIER (type) == as_base_identifier) type = TYPE_CONTEXT (type); - if (!CLASS_TYPE_P (type) || (!CLASSTYPE_NON_POD_AGGREGATE (type) - && !CLASSTYPE_NON_AGGREGATE_POD (type))) + if (!CLASS_TYPE_P (type) + || is_empty_class (type) + || (!CLASSTYPE_NON_POD_AGGREGATE (type) + && !CLASSTYPE_NON_AGGREGATE_POD (type))) return; tree size = end_of_class (type, (DECL_FIELD_IS_BASE (field) ? eoc_nvsize : eoc_nv_or_dsize)); diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 23b4bfe..d019d4d 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -4189,7 +4189,11 @@ start_objects (bool initp, unsigned priority, bool has_body, bool omp_target = false) { bool default_init = initp && priority == DEFAULT_INIT_PRIORITY; - bool is_module_init = default_init && module_global_init_needed (); + /* FIXME: We may eventually want to treat OpenMP offload initializers + in modules specially as well. */ + bool is_module_init = (default_init + && !omp_target + && module_global_init_needed ()); tree name = NULL_TREE; if (is_module_init) @@ -5881,12 +5885,8 @@ c_parse_final_cleanups (void) if (static_init_fini_fns[true]->get_or_insert (DEFAULT_INIT_PRIORITY)) has_module_inits = true; - if (flag_openmp) - { - if (!static_init_fini_fns[2 + true]) - static_init_fini_fns[2 + true] = priority_map_t::create_ggc (); - static_init_fini_fns[2 + true]->get_or_insert (DEFAULT_INIT_PRIORITY); - } + /* FIXME: We need to work out what static constructors on OpenMP offload + target in modules will look like. */ } /* Generate initialization and destruction functions for all diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index f562bf8..f8fa7f1 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -8097,18 +8097,37 @@ trees_in::install_entity (tree decl) gcc_checking_assert (!existed); slot = ident; } - else if (state->is_partition ()) - { - /* The decl is already in the entity map, but we see it again now from a - partition: we want to overwrite if the original decl wasn't also from - a (possibly different) partition. Otherwise, for things like template - instantiations, make_dependency might not realise that this is also - provided from a partition and should be considered part of this module - (and thus always emitted into the primary interface's CMI). */ + else + { unsigned *slot = entity_map->get (DECL_UID (decl)); - module_state *imp = import_entity_module (*slot); - if (!imp->is_partition ()) - *slot = ident; + + /* The entity must be in the entity map already. However, DECL may + be the DECL_TEMPLATE_RESULT of an existing partial specialisation + if we matched it while streaming another instantiation; in this + case we already registered that TEMPLATE_DECL. */ + if (!slot) + { + tree type = TREE_TYPE (decl); + gcc_checking_assert (TREE_CODE (decl) == TYPE_DECL + && CLASS_TYPE_P (type) + && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)); + slot = entity_map->get (DECL_UID (CLASSTYPE_TI_TEMPLATE (type))); + } + gcc_checking_assert (slot); + + if (state->is_partition ()) + { + /* The decl is already in the entity map, but we see it again now + from a partition: we want to overwrite if the original decl + wasn't also from a (possibly different) partition. Otherwise, + for things like template instantiations, make_dependency might + not realise that this is also provided from a partition and + should be considered part of this module (and thus always + emitted into the primary interface's CMI). */ + module_state *imp = import_entity_module (*slot); + if (!imp->is_partition ()) + *slot = ident; + } } return true; @@ -12638,7 +12657,11 @@ trees_out::write_function_def (tree decl) { unsigned flags = 0; - flags |= 1 * DECL_NOT_REALLY_EXTERN (decl); + /* Whether the importer should emit this definition, if used. */ + flags |= 1 * (DECL_NOT_REALLY_EXTERN (decl) + && (get_importer_interface (decl) + != importer_interface::always_import)); + if (f) { flags |= 2; diff --git a/gcc/cp/optimize.cc b/gcc/cp/optimize.cc index 6f9a77f..fc4d6c2 100644 --- a/gcc/cp/optimize.cc +++ b/gcc/cp/optimize.cc @@ -309,8 +309,8 @@ maybe_thunk_body (tree fn, bool force) defer_mangling_aliases = save_defer_mangling_aliases; cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group); cgraph_node::get_create (fns[1])->add_to_same_comdat_group - (cgraph_node::get_create (fns[0])); - symtab_node::get (fn)->add_to_same_comdat_group + (cgraph_node::get (fns[0])); + symtab_node::get_create (fn)->add_to_same_comdat_group (symtab_node::get (fns[0])); if (fns[2]) /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index d794083..fc2b31f 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -26012,10 +26012,10 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (parm)), INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (t)), UNIFY_ALLOW_NONE, explain_p); - else - return unify_success (explain_p); + gcc_checking_assert (t == arg); } - else if (!same_type_ignoring_top_level_qualifiers_p (parm, arg)) + + if (!same_type_ignoring_top_level_qualifiers_p (parm, arg)) return unify_type_mismatch (explain_p, parm, arg); return unify_success (explain_p); diff --git a/gcc/cp/rtti.cc b/gcc/cp/rtti.cc index 3539962..8393301 100644 --- a/gcc/cp/rtti.cc +++ b/gcc/cp/rtti.cc @@ -468,6 +468,7 @@ get_tinfo_decl_direct (tree type, tree name, int pseudo_ix) DECL_IGNORED_P (d) = 1; TREE_READONLY (d) = 1; TREE_STATIC (d) = 1; + TREE_ADDRESSABLE (d) = 1; /* Tell equal_address_to that different tinfo decls never overlap. */ if (vec_safe_is_empty (unemitted_tinfo_decls)) diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index cb52e8c..8293da4 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -1495,7 +1495,7 @@ from @samp{bad} will cause an overflow to @samp{foo}. If we compile the code with the following options: @example -$ gm2 -g -fsoft-check-all -O2 -c assignvalue.mod +$ gm2 -g -fsoft-check-all -O2 -fm2-plugin -c assignvalue.mod assignvalue.mod:16:0:inevitable that this error will occur at run time, assignment will result in an overflow @end example diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 8c711e4..b5a7886 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -31099,7 +31099,8 @@ resolve_addr_in_expr (dw_attr_node *a, dw_loc_descr_ref loc) return false; remove_addr_table_entry (loc->dw_loc_oprnd1.val_entry); loc->dw_loc_oprnd1.val_entry - = add_addr_table_entry (rtl, ate_kind_rtx); + = add_addr_table_entry (rtl, loc->dtprel + ? ate_kind_rtx_dtprel : ate_kind_rtx); } break; case DW_OP_const4u: diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2697deb..3116650 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,63 @@ +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-05-15 Tobias Burnus <tburnus@baylibre.com> + + * trans-openmp.cc (gfc_omp_deep_mapping_do): Handle SSA_NAME if + a def_stmt is available. + +2025-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + Backported from master: + 2025-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/120049 + * check.cc (gfc_check_c_associated): Modify checks to avoid + ICE and allow use, intrinsic :: iso_c_binding from a separate + module file. + +2025-05-15 Thomas Koenig <tkoenig@gcc.gnu.org> + + Backported from master: + 2025-05-14 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120139 + * dump-parse-tree.cc (get_c_type_name): If no constant + size of an array exists, output an asterisk. + +2025-05-15 Thomas Koenig <tkoenig@gcc.gnu.org> + + Backported from master: + 2025-05-14 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120107 + * dump-parse-tree.cc (write_type): Do not dump non-interoperable + types. + +2025-05-13 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120163 + * gfortran.h: Add formal_resolved to gfc_symbol. + * resolve.cc (gfc_resolve_formal_arglist): Set it. + (resolve_function): Do not call gfc_get_formal_from_actual_arglist + if we already resolved a formal arglist. + (resolve_call): Likewise. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + Daniil Kochergin <daniil2472s@gmail.com> + Tobias Burnus <tburnus@baylibre.com> + + PR fortran/120191 + * trans-intrinsic.cc (strip_kind_from_actual): Remove. + (gfc_conv_intrinsic_minmaxloc): Don't call strip_kind_from_actual. + Free and clear kind_arg->expr if non-NULL. Set back_arg->name to + "%VAL" instead of a loop looking for last argument. Remove actual + variable, use array_arg instead. Free and clear dim_arg->expr if + non-NULL for BT_CHARACTER cases instead of using a loop. + 2025-05-11 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/119928 diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc index 9c66c25..0073cd0 100644 --- a/gcc/fortran/check.cc +++ b/gcc/fortran/check.cc @@ -5919,30 +5919,40 @@ gfc_check_c_sizeof (gfc_expr *arg) bool gfc_check_c_associated (gfc_expr *c_ptr_1, gfc_expr *c_ptr_2) { - if (c_ptr_1->ts.type != BT_DERIVED - || c_ptr_1->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING - || (c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_PTR - && c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_FUNPTR)) + if (c_ptr_1) { - gfc_error ("Argument C_PTR_1 at %L to C_ASSOCIATED shall have the " - "type TYPE(C_PTR) or TYPE(C_FUNPTR)", &c_ptr_1->where); - return false; + if (c_ptr_1->expr_type == EXPR_FUNCTION && c_ptr_1->ts.type == BT_VOID) + return true; + + if (c_ptr_1->ts.type != BT_DERIVED + || c_ptr_1->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING + || (c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_PTR + && c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_FUNPTR)) + { + gfc_error ("Argument C_PTR_1 at %L to C_ASSOCIATED shall have the " + "type TYPE(C_PTR) or TYPE(C_FUNPTR)", &c_ptr_1->where); + return false; + } } if (!scalar_check (c_ptr_1, 0)) return false; - if (c_ptr_2 - && (c_ptr_2->ts.type != BT_DERIVED + if (c_ptr_2) + { + if (c_ptr_2->expr_type == EXPR_FUNCTION && c_ptr_2->ts.type == BT_VOID) + return true; + + if (c_ptr_2->ts.type != BT_DERIVED || c_ptr_2->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING || (c_ptr_1->ts.u.derived->intmod_sym_id - != c_ptr_2->ts.u.derived->intmod_sym_id))) - { - gfc_error ("Argument C_PTR_2 at %L to C_ASSOCIATED shall have the " - "same type as C_PTR_1: %s instead of %s", &c_ptr_1->where, - gfc_typename (&c_ptr_1->ts), - gfc_typename (&c_ptr_2->ts)); - return false; + != c_ptr_2->ts.u.derived->intmod_sym_id)) + { + gfc_error ("Argument C_PTR_2 at %L to C_ASSOCIATED shall have the " + "same type as C_PTR_1: %s instead of %s", &c_ptr_1->where, + gfc_typename (&c_ptr_1->ts), gfc_typename (&c_ptr_2->ts)); + return false; + } } if (c_ptr_2 && !scalar_check (c_ptr_2, 1)) diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 9708964..648109b 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -4350,6 +4350,8 @@ get_c_type_name (gfc_typespec *ts, gfc_array_spec *as, const char **pre, mpz_clear (sz); *asterisk = false; } + else + *asterisk = true; } return ret; } @@ -4394,10 +4396,11 @@ write_type (gfc_symbol *sym) { gfc_component *c; - /* Don't dump our iso c module, nor vtypes. */ + /* Don't dump types that are not interoperable, our very own ISO C Binding + module, or vtypes. */ if (sym->from_intmod == INTMOD_ISO_C_BINDING || sym->attr.flavor != FL_DERIVED - || sym->attr.vtype) + || sym->attr.vtype || !sym->attr.is_bind_c) return; fprintf (dumpfile, "typedef struct %s {\n", sym->name); diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index c9cf072..903712a 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2074,6 +2074,9 @@ typedef struct gfc_symbol This is legal in Fortran, but can cause problems with autogenerated C prototypes for C23. */ unsigned ext_dummy_arglist_mismatch:1; + /* Set if the formal arglist has already been resolved, to avoid + trying to generate it again from actual arguments. */ + unsigned formal_resolved:1; /* Reference counter, used for memory management. diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 3872b39..9d31062 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -533,7 +533,8 @@ gfc_resolve_formal_arglist (gfc_symbol *proc) } } } - + if (sym) + sym->formal_resolved = 1; gfc_current_ns = orig_current_ns; } @@ -3472,7 +3473,7 @@ resolve_function (gfc_expr *expr) &expr->where, &sym->formal_at); } } - else + else if (!sym->formal_resolved) { gfc_get_formal_from_actual_arglist (sym, expr->value.function.actual); sym->formal_at = expr->where; @@ -4033,7 +4034,7 @@ resolve_call (gfc_code *c) &c->loc, &csym->formal_at); } } - else + else if (!csym->formal_resolved) { gfc_get_formal_from_actual_arglist (csym, c->ext.actual); csym->formal_at = c->loc; diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc index 6ffc3e0..974e25f 100644 --- a/gcc/fortran/trans-intrinsic.cc +++ b/gcc/fortran/trans-intrinsic.cc @@ -4716,22 +4716,6 @@ maybe_absent_optional_variable (gfc_expr *e) } -/* Remove unneeded kind= argument from actual argument list when the - result conversion is dealt with in a different place. */ - -static void -strip_kind_from_actual (gfc_actual_arglist * actual) -{ - for (gfc_actual_arglist *a = actual; a; a = a->next) - { - if (a && a->name && strcmp (a->name, "kind") == 0) - { - gfc_free_expr (a->expr); - a->expr = NULL; - } - } -} - /* Emit code for minloc or maxloc intrinsic. There are many different cases we need to handle. For performance reasons we sometimes create two loops instead of one, where the second one is much simpler. @@ -4926,7 +4910,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) tree b_if, b_else; tree back; gfc_loopinfo loop, *ploop; - gfc_actual_arglist *actual, *array_arg, *dim_arg, *mask_arg, *kind_arg; + gfc_actual_arglist *array_arg, *dim_arg, *mask_arg, *kind_arg; gfc_actual_arglist *back_arg; gfc_ss *arrayss = nullptr; gfc_ss *maskss = nullptr; @@ -4945,8 +4929,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) int n; bool optional_mask; - actual = expr->value.function.actual; - array_arg = actual; + array_arg = expr->value.function.actual; dim_arg = array_arg->next; mask_arg = dim_arg->next; kind_arg = mask_arg->next; @@ -4955,14 +4938,16 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) bool dim_present = dim_arg->expr != nullptr; bool nested_loop = dim_present && expr->rank > 0; - /* The last argument, BACK, is passed by value. Ensure that - by setting its name to %VAL. */ - for (gfc_actual_arglist *a = actual; a; a = a->next) + /* Remove kind. */ + if (kind_arg->expr) { - if (a->next == NULL) - a->name = "%VAL"; + gfc_free_expr (kind_arg->expr); + kind_arg->expr = NULL; } + /* Pass BACK argument by value. */ + back_arg->name = "%VAL"; + if (se->ss) { if (se->ss->info->useflags) @@ -4984,25 +4969,19 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) } } - arrayexpr = actual->expr; + arrayexpr = array_arg->expr; - /* Special case for character maxloc. Remove unneeded actual - arguments, then call a library function. */ + /* Special case for character maxloc. Remove unneeded "dim" actual + argument, then call a library function. */ if (arrayexpr->ts.type == BT_CHARACTER) { gcc_assert (expr->rank == 0); - gfc_actual_arglist *a = actual; - strip_kind_from_actual (a); - while (a) + if (dim_arg->expr) { - if (a->name && strcmp (a->name, "dim") == 0) - { - gfc_free_expr (a->expr); - a->expr = NULL; - } - a = a->next; + gfc_free_expr (dim_arg->expr); + dim_arg->expr = NULL; } gfc_conv_intrinsic_funcall (se, expr); return; diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc index 64e5cec..7a63f52 100644 --- a/gcc/fortran/trans-openmp.cc +++ b/gcc/fortran/trans-openmp.cc @@ -2568,6 +2568,26 @@ gfc_omp_deep_mapping_do (bool is_cnt, gimple *ctx, tree clause, else while (TREE_CODE (tmp) == COMPONENT_REF || TREE_CODE (tmp) == ARRAY_REF) tmp = TREE_OPERAND (tmp, TREE_CODE (tmp) == COMPONENT_REF ? 1 : 0); + if (TREE_CODE (tmp) == MEM_REF) + tmp = TREE_OPERAND (tmp, 0); + if (TREE_CODE (tmp) == SSA_NAME) + { + gimple *def_stmt = SSA_NAME_DEF_STMT (tmp); + if (gimple_code (def_stmt) == GIMPLE_ASSIGN) + { + tmp = gimple_assign_rhs1 (def_stmt); + if (poly) + { + tmp = TYPE_FIELDS (type); + type = TREE_TYPE (tmp); + } + else + while (TREE_CODE (tmp) == COMPONENT_REF + || TREE_CODE (tmp) == ARRAY_REF) + tmp = TREE_OPERAND (tmp, + TREE_CODE (tmp) == COMPONENT_REF ? 1 : 0); + } + } /* If the clause argument is nonallocatable, skip is-allocate check. */ if (GFC_DECL_GET_SCALAR_ALLOCATABLE (tmp) || GFC_DECL_GET_SCALAR_POINTER (tmp) diff --git a/gcc/m2/ChangeLog b/gcc/m2/ChangeLog index f56104b..cb70f1c 100644 --- a/gcc/m2/ChangeLog +++ b/gcc/m2/ChangeLog @@ -1,3 +1,60 @@ +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-05-05 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/120117 + * gm2-compiler/M2GenGCC.mod (FoldBecomes): Remove the call to + RemoveQuad since this is performed by TypeCheckBecomes. + * gm2-compiler/PCSymBuild.mod (buildConstFunction): Rewrite + header comment. + Check for a set or a type aliased set and appropriately + skip type equivalences and obtain the element type. + * gm2-compiler/SymbolTable.mod (PutConst): Add call to + CheckBreak. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-04-24 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/119915 + * gm2-libs/FormatStrings.mod (PerformFormatString): Handle + the %u and %x format specifiers in a similar way to the %d + specifier. Avoid using Slice and use Copy instead. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-04-24 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/119914 + * gm2-compiler/M2Check.mod (checkConstMeta): Add check for + Ztype, Rtype and Ctype and unbounded arrays. + (IsZRCType): New procedure function. + (isZRC): Add comment. + * gm2-compiler/M2Quads.mod: + * gm2-compiler/M2Range.mod (gdbinit): New procedure. + (BreakWhenRangeCreated): Ditto. + (CheckBreak): Ditto. + (InitRange): Call CheckBreak. + (Init): Add gdbhook and initialize interactive watch point. + * gm2-compiler/SymbolTable.def (GetNthParamAnyClosest): New + procedure function. + * gm2-compiler/SymbolTable.mod (BreakSym): Remove constant. + (BreakSym): Add Variable. + (stop): Remove. + (gdbhook): New procedure. + (BreakWhenSymCreated): Ditto. + (CheckBreak): Ditto. + (NewSym): Call CheckBreak. + (Init): Add gdbhook and initialize interactive watch point. + (MakeProcedure): Replace guarded call to stop with CheckBreak. + (GetNthParamChoice): New procedure function. + (GetNthParamOrdered): Ditto. + (GetNthParamAnyClosest): Ditto. + (GetOuterModuleScope): Ditto. + 2025-04-25 Release Manager * GCC 15.1.0 released. diff --git a/gcc/m2/gm2-compiler/M2Check.mod b/gcc/m2/gm2-compiler/M2Check.mod index 528c51d..d86ef8e 100644 --- a/gcc/m2/gm2-compiler/M2Check.mod +++ b/gcc/m2/gm2-compiler/M2Check.mod @@ -803,7 +803,12 @@ BEGIN THEN typeRight := GetDType (right) ; typeLeft := GetDType (left) ; - RETURN doCheckPair (result, tinfo, typeLeft, typeRight) + IF IsZRCType (typeLeft) AND IsUnbounded (typeRight) + THEN + RETURN false + ELSE + RETURN doCheckPair (result, tinfo, typeLeft, typeRight) + END END ; RETURN result END checkConstMeta ; @@ -868,7 +873,19 @@ END checkSubrangeTypeEquivalence ; (* - isZRC - + IsZRCType - return TRUE if type is a ZType, RType or a CType. +*) + +PROCEDURE IsZRCType (type: CARDINAL) : BOOLEAN ; +BEGIN + RETURN (type = CType) OR (type = ZType) OR (type = RType) +END IsZRCType ; + + +(* + isZRC - return TRUE if zrc is a ZType, RType or a CType + and sym is either a complex type when zrc = CType + or is not a composite type when zrc is a RType or ZType. *) PROCEDURE isZRC (zrc, sym: CARDINAL) : BOOLEAN ; diff --git a/gcc/m2/gm2-compiler/M2GenGCC.mod b/gcc/m2/gm2-compiler/M2GenGCC.mod index a1e3c07..bc1d588 100644 --- a/gcc/m2/gm2-compiler/M2GenGCC.mod +++ b/gcc/m2/gm2-compiler/M2GenGCC.mod @@ -2914,9 +2914,6 @@ BEGIN IF TypeCheckBecomes (p, quad) THEN PerformFoldBecomes (p, quad) - ELSE - GetQuad (quad, op, des, op2, expr) ; - RemoveQuad (p, des, quad) END END END diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 9bb8c4d..4022657 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -69,6 +69,7 @@ FROM SymbolTable IMPORT ModeOfAddr, GetMode, PutMode, GetSymName, IsUnknown, GetArraySubscript, GetDimension, GetParam, GetNth, GetNthParamAny, + GetNthParamAnyClosest, GetFirstUsed, GetDeclaredMod, GetQuads, GetReadQuads, GetWriteQuads, GetWriteLimitQuads, GetReadLimitQuads, @@ -5676,7 +5677,8 @@ BEGIN WHILE i<=ParamTotal DO IF i <= NoOfParamAny (Proc) THEN - FormalI := GetParam(Proc, i) ; + (* FormalI := GetParam(Proc, i) ; *) + FormalI := GetNthParamAnyClosest (Proc, i, GetCurrentModule ()) ; IF CompilerDebugging THEN n1 := GetSymName(FormalI) ; @@ -5801,7 +5803,7 @@ BEGIN MetaError3 ('parameter {%3n} in {%1dD} causes a mismatch it was declared as a {%2d}', call, GetNth (call, i), i) END ; BuildRange (InitTypesParameterCheck (tokno, CheckedProcedure, i, - GetParam (CheckedProcedure, i), + GetNthParamAnyClosest (CheckedProcedure, i, GetCurrentModule ()), GetParam (ProcType, i), ParamCheckId)) ; INC(i) END @@ -6150,7 +6152,7 @@ BEGIN MetaErrorStringT2 (tokpos, Msg, ProcedureSym, ParameterNo) ; IF NoOfParamAny (ProcedureSym) >= ParameterNo THEN - FormalParam := GetNthParamAny (ProcedureSym, ParameterNo) ; + FormalParam := GetNthParamAnyClosest (ProcedureSym, ParameterNo, GetCurrentModule ()) ; IF IsUnboundedParamAny (ProcedureSym, ParameterNo) THEN MetaErrorT2 (GetVarDeclFullTok (FormalParam), 'formal parameter {%1ad} has an open array type {%2tad}', @@ -6205,7 +6207,7 @@ BEGIN MetaErrorStringT2 (tokpos, Msg, ProcedureSym, ParameterNo) ; IF NoOfParamAny (ProcedureSym) >= ParameterNo THEN - FormalParam := GetNthParamAny (ProcedureSym, ParameterNo) ; + FormalParam := GetNthParamAnyClosest (ProcedureSym, ParameterNo, GetCurrentModule ()) ; IF IsUnboundedParamAny (ProcedureSym, ParameterNo) THEN MetaErrorT2 (GetVarDeclFullTok (FormalParam), '{%W}formal parameter {%1ad} has an open array type {%2tad}', diff --git a/gcc/m2/gm2-compiler/M2Range.mod b/gcc/m2/gm2-compiler/M2Range.mod index 2a5bfab..8e3943a 100644 --- a/gcc/m2/gm2-compiler/M2Range.mod +++ b/gcc/m2/gm2-compiler/M2Range.mod @@ -154,6 +154,34 @@ TYPE VAR TopOfRange: CARDINAL ; RangeIndex: Index ; + BreakRange: CARDINAL ; + + +PROCEDURE gdbhook ; +END gdbhook ; + + +(* + BreakWhenRangeCreated - to be called interactively by gdb. +*) + +PROCEDURE BreakWhenRangeCreated (r: CARDINAL) ; +BEGIN + BreakRange := r +END BreakWhenRangeCreated ; + + +(* + CheckBreak - if sym = BreakRange then call gdbhook. +*) + +PROCEDURE CheckBreak (r: CARDINAL) ; +BEGIN + IF BreakRange = r + THEN + gdbhook + END +END CheckBreak ; (* @@ -302,6 +330,7 @@ BEGIN THEN InternalError ('out of memory error') ELSE + CheckBreak (r) ; WITH p^ DO type := none ; des := NulSym ; @@ -3746,7 +3775,19 @@ END WriteRangeCheck ; PROCEDURE Init ; BEGIN TopOfRange := 0 ; - RangeIndex := InitIndex(1) + RangeIndex := InitIndex(1) ; + BreakWhenRangeCreated (0) ; (* Disable the intereactive range watch. *) + (* To examine the range when it is created run cc1gm2 from gdb + and set a break point on gdbhook. + (gdb) break gdbhook + (gdb) run + Now below interactively call BreakWhenRangeCreated with the symbol + under investigation. *) + gdbhook ; + (* Now is the time to interactively call gdb, for example: + (gdb) print BreakWhenRangeCreated (1234) + (gdb) cont + and you will arrive at gdbhook when this symbol is created. *) END Init ; diff --git a/gcc/m2/gm2-compiler/PCSymBuild.mod b/gcc/m2/gm2-compiler/PCSymBuild.mod index b124c3e..3bffe86 100644 --- a/gcc/m2/gm2-compiler/PCSymBuild.mod +++ b/gcc/m2/gm2-compiler/PCSymBuild.mod @@ -64,7 +64,7 @@ FROM SymbolTable IMPORT NulSym, ModeOfAddr, ProcedureKind, GetFromOuterModule, CheckForEnumerationInCurrentModule, GetMode, PutVariableAtAddress, ModeOfAddr, SkipType, - IsSet, PutConstSet, + IsSet, PutConstSet, IsType, IsConst, IsConstructor, PutConst, PutConstructor, PopValue, PushValue, MakeTemporary, PutVar, @@ -1408,9 +1408,10 @@ END TypeToMeta ; (* - buildConstFunction - we are only concerned about resolving the return type o + buildConstFunction - we are only concerned about resolving the return type of a function, so we can ignore all parameters - except - the first one in the case of VAL(type, foo). + the first one in the case of VAL(type, foo) + and the type of bar in MIN (bar) and MAX (bar). buildConstFunction uses a unary exprNode to represent a function. *) @@ -1866,11 +1867,11 @@ BEGIN THEN IF (func=Min) OR (func=Max) THEN - IF IsSet (sym) + IF IsSet (sym) OR (IsType (sym) AND IsSet (SkipType (sym))) THEN - type := SkipType(GetType(sym)) + type := GetType (SkipType (sym)) ELSE - (* sym is the type required for MAX, MIN and VAL *) + (* sym is the type required for MAX, MIN and VAL. *) type := sym END ELSE diff --git a/gcc/m2/gm2-compiler/SymbolTable.def b/gcc/m2/gm2-compiler/SymbolTable.def index 85a3672..2a9865a 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.def +++ b/gcc/m2/gm2-compiler/SymbolTable.def @@ -3478,4 +3478,20 @@ PROCEDURE UsesOptArgAny (Sym: CARDINAL) : BOOLEAN ; PROCEDURE GetProcedureKindDesc (kind: ProcedureKind) : String ; +(* + GetNthParamAnyClosest - returns the nth parameter from the order + proper procedure, forward declaration + or definition module procedure. + It chooses the parameter which is closest + in source terms to currentmodule. + The same module will return using the order + proper procedure, forward procedure, definition module. + Whereas an imported procedure will choose from + DefProcedure, ProperProcedure, ForwardProcedure. +*) + +PROCEDURE GetNthParamAnyClosest (sym: CARDINAL; ParamNo: CARDINAL; + currentmodule: CARDINAL) : CARDINAL ; + + END SymbolTable. diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index 826d2d3..ff661dc 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -122,8 +122,6 @@ CONST UnboundedAddressName = "_m2_contents" ; UnboundedHighName = "_m2_high_%d" ; - BreakSym = 203 ; - TYPE ProcAnyBoolean = PROCEDURE (CARDINAL, ProcedureKind) : BOOLEAN ; ProcAnyCardinal = PROCEDURE (CARDINAL, ProcedureKind) : CARDINAL ; @@ -930,6 +928,7 @@ VAR (* passes and reduce duplicate *) (* errors. *) ConstLitArray : Indexing.Index ; + BreakSym : CARDINAL ; (* Allows interactive debugging. *) (* @@ -1032,11 +1031,34 @@ END FinalSymbol ; (* - stop - a debugger convenience hook. + gdbhook - a debugger convenience hook. +*) + +PROCEDURE gdbhook ; +END gdbhook ; + + +(* + BreakWhenSymCreated - to be called interactively by gdb. *) -PROCEDURE stop ; -END stop ; +PROCEDURE BreakWhenSymCreated (sym: CARDINAL) ; +BEGIN + BreakSym := sym +END BreakWhenSymCreated ; + + +(* + CheckBreak - if sym = BreakSym then call gdbhook. +*) + +PROCEDURE CheckBreak (sym: CARDINAL) ; +BEGIN + IF sym = BreakSym + THEN + gdbhook + END +END CheckBreak ; (* @@ -1053,10 +1075,7 @@ BEGIN SymbolType := DummySym END ; PutIndice(Symbols, sym, pSym) ; - IF sym = BreakSym - THEN - stop - END ; + CheckBreak (sym) ; INC(FreeSymbol) END NewSym ; @@ -1660,6 +1679,18 @@ PROCEDURE Init ; VAR pCall: PtrToCallFrame ; BEGIN + BreakWhenSymCreated (NulSym) ; (* Disable the intereactive sym watch. *) + (* To examine the symbol table when a symbol is created run cc1gm2 from gdb + and set a break point on gdbhook. + (gdb) break gdbhook + (gdb) run + Now below interactively call BreakWhenSymCreated with the symbol + under investigation. *) + gdbhook ; + (* Now is the time to interactively call gdb, for example: + (gdb) print BreakWhenSymCreated (1234) + (gdb) cont + and you will arrive at gdbhook when this symbol is created. *) AnonymousName := 0 ; CurrentError := NIL ; InitTree (ConstLitPoolTree) ; @@ -3959,10 +3990,7 @@ VAR BEGIN tok := CheckTok (tok, 'procedure') ; Sym := DeclareSym(tok, ProcedureName) ; - IF Sym = BreakSym - THEN - stop - END ; + CheckBreak (Sym) ; IF NOT IsError(Sym) THEN pSym := GetPsym(Sym) ; @@ -6926,6 +6954,89 @@ END GetNthParamAny ; (* + GetNthParamChoice - returns the parameter definition from + sym:ParamNo:kind or NulSym. +*) + +PROCEDURE GetNthParamChoice (sym: CARDINAL; ParamNo: CARDINAL; + kind: ProcedureKind) : CARDINAL ; +BEGIN + IF GetProcedureParametersDefined (sym, kind) + THEN + RETURN GetNthParam (sym, kind, ParamNo) + ELSE + RETURN NulSym + END +END GetNthParamChoice ; + + +(* + GetNthParamOrdered - returns the parameter definition from list {a, b, c} + in order. + sym:ParamNo:{a,b,c} or NulSym. +*) + +PROCEDURE GetNthParamOrdered (sym: CARDINAL; ParamNo: CARDINAL; + a, b, c: ProcedureKind) : CARDINAL ; +VAR + param: CARDINAL ; +BEGIN + param := GetNthParamChoice (sym, ParamNo, a) ; + IF param = NulSym + THEN + param := GetNthParamChoice (sym, ParamNo, b) ; + IF param = NulSym + THEN + param := GetNthParamChoice (sym, ParamNo, c) + END + END ; + RETURN param +END GetNthParamOrdered ; + + +(* + GetNthParamAnyClosest - returns the nth parameter from the order + proper procedure, forward declaration + or definition module procedure. + It chooses the parameter which is closest + in source terms to currentmodule. + The same module will return using the order + proper procedure, forward procedure, definition module. + Whereas an imported procedure will choose from + DefProcedure, ProperProcedure, ForwardProcedure. +*) + +PROCEDURE GetNthParamAnyClosest (sym: CARDINAL; ParamNo: CARDINAL; + currentmodule: CARDINAL) : CARDINAL ; +BEGIN + IF GetOuterModuleScope (currentmodule) = GetOuterModuleScope (sym) + THEN + (* Same module. *) + RETURN GetNthParamOrdered (sym, ParamNo, + ProperProcedure, ForwardProcedure, DefProcedure) + ELSE + (* Procedure is imported. *) + RETURN GetNthParamOrdered (sym, ParamNo, + DefProcedure, ProperProcedure, ForwardProcedure) + END +END GetNthParamAnyClosest ; + + +(* + GetOuterModuleScope - returns the outer module symbol scope for sym. +*) + +PROCEDURE GetOuterModuleScope (sym: CARDINAL) : CARDINAL ; +BEGIN + WHILE NOT (IsDefImp (sym) OR + (IsModule (sym) AND (GetScope (sym) = NulSym))) DO + sym := GetScope (sym) + END ; + RETURN sym +END GetOuterModuleScope ; + + +(* The Following procedures fill in the symbol table with the symbol entities. *) @@ -7154,6 +7265,7 @@ VAR pSym: PtrToSymbol ; BEGIN pSym := GetPsym(Sym) ; + CheckBreak (Sym) ; WITH pSym^ DO CASE SymbolType OF diff --git a/gcc/m2/gm2-libs/FormatStrings.mod b/gcc/m2/gm2-libs/FormatStrings.mod index ec2985b..aea8da9 100644 --- a/gcc/m2/gm2-libs/FormatStrings.mod +++ b/gcc/m2/gm2-libs/FormatStrings.mod @@ -378,7 +378,7 @@ BEGIN THEN INC (afterperc) ; Cast (u, w) ; - in := ConCat (in, Slice (fmt, startpos, nextperc)) ; + in := Copy (fmt, in, startpos, nextperc) ; in := ConCat (in, CardinalToString (u, width, leader, 16, TRUE)) ; startpos := afterperc ; DSdbExit (NIL) ; @@ -387,7 +387,7 @@ BEGIN THEN INC (afterperc) ; Cast (u, w) ; - in := ConCat (in, Slice (fmt, startpos, nextperc)) ; + in := Copy (fmt, in, startpos, nextperc) ; in := ConCat (in, CardinalToString (u, width, leader, 10, FALSE)) ; startpos := afterperc ; DSdbExit (NIL) ; diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index f78bda3..1db7cd5 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,15 @@ +2025-05-15 Joseph Myers <josmyers@redhat.com> + + * zh_CN.po: Update. + +2025-05-14 Joseph Myers <josmyers@redhat.com> + + * sv.po: Update. + +2025-05-12 Joseph Myers <josmyers@redhat.com> + + * sv.po: Update. + 2025-04-30 Joseph Myers <josmyers@redhat.com> * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po, diff --git a/gcc/po/sv.po b/gcc/po/sv.po index 31e5502..28318cd 100644 --- a/gcc/po/sv.po +++ b/gcc/po/sv.po @@ -32,7 +32,7 @@ msgstr "" "Project-Id-Version: gcc 15.1.0\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2025-04-23 19:27+0000\n" -"PO-Revision-Date: 2025-05-10 14:36+0200\n" +"PO-Revision-Date: 2025-05-14 22:41+0200\n" "Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "Language: sv\n" @@ -2732,7 +2732,7 @@ msgstr "Varna för avslutande blanktecken på rader utom i råa stränglitterale #: c-family/c.opt:1523 #, no-c-format msgid "Warn about trailing whitespace on lines except when in raw string literals. Equivalent to Wtrailing-whitespace=blanks when enabled or Wtrailing-whitespace=none when disabled." -msgstr "Varna för avslutande mellanrum på rader utom i råa strängliteraler. Ekvivalent med Wtrailing-whitespace=blanks när det är aktiverat eller Wtrailing-whitespace=none när det är avaktiverat." +msgstr "Varna för avslutande mellanrum på rader utom i råa stränglitteraler. Ekvivalent med Wtrailing-whitespace=blanks när det är aktiverat eller Wtrailing-whitespace=none när det är avaktiverat." #: c-family/c.opt:1527 #, no-c-format @@ -3864,7 +3864,7 @@ msgstr "-finternal-ebcdic\tIntern bearbetning är i EBCDIC kodsida 1140" #: cobol/lang.opt:94 #, no-c-format msgid "Enable/disable static linkage for CALL literals" -msgstr "Aktivera/avaktivera statisk länkning för CALL-literaler" +msgstr "Aktivera/avaktivera statisk länkning för CALL-litteraler" #: cobol/lang.opt:98 #, no-c-format @@ -4719,7 +4719,7 @@ msgstr "Det maximala djupet av exploderade noder som skall förekomma i en dot-d #: analyzer/analyzer.opt:59 #, no-c-format msgid "The number of bytes at which to ellipsize string literals in analyzer text art diagrams." -msgstr "Antalet byte vid vilket strängliteraler i textkonstdiagram från analyseraren skall ha ellips." +msgstr "Antalet byte vid vilket stränglitteraler i textkonstdiagram från analyseraren skall ha ellips." #: analyzer/analyzer.opt:63 #, no-c-format @@ -6677,7 +6677,7 @@ msgstr "Parameter för att styra vilka återskrivningsmöjligheter vi försöker #: config/aarch64/aarch64.opt:437 #, no-c-format msgid "Warn about usage of experimental Function Multi Versioning." -msgstr "Varna för användning av experminetell funktionsmultiversionering." +msgstr "Varna för användning av experimentell funktionsmultiversionering." #: config/linux.opt:24 #, no-c-format @@ -8848,7 +8848,7 @@ msgstr "Gör så att länkarens lättnadsmaskin antar att programräknaren slår #: config/avr/avr.opt:112 #, no-c-format msgid "Optimization. Accumulate outgoing function arguments and acquire/release the needed stack space for outgoing function arguments in function prologue/epilogue. Without this option, outgoing arguments are pushed before calling a function and popped afterwards. This option can lead to reduced code size for functions that call many functions that get their arguments on the stack like, for example printf." -msgstr "Optimering. Samla utgående funktionsargument och ta/släpp det nödvändiga stackutrymmet för utgående funktionsargument i funktionsprologen/-epilogen. Utan denna flagga trycks utgående argument på stacken före anrop av en funktion och plockas efteråt. Denna flagga kan medföra reducerad kodstorlek för funktioner som anropar många funktioner som får sina argument på stacken som, till exempel printf." +msgstr "Optimering. Samla utgående funktionsargument och ta/släpp det nödvändiga stackutrymmet för utgående funktionsargument i funktionsprologen/-epilogen. Utan denna flagga trycks utgående argument på stacken före anrop av en funktion och plockas efteråt. Denna flagga kan medföra reducerad kodstorlek för funktioner som anropar många funktioner som får sina argument på stacken, som till exempel printf." #: config/avr/avr.opt:116 #, no-c-format @@ -8878,7 +8878,7 @@ msgstr "Enheten har sektionen .rodata placerad i RAM-området." #: config/avr/avr.opt:137 #, no-c-format msgid "This option is used internally for multilib generation and selection. The device has no SPH special function register." -msgstr "Denna flagga används internt för multilib-generering och -val. Enheten har inga speiciella SPH-fuktionsregister." +msgstr "Denna flagga används internt för multilib-generering och -val. Enheten har inga speciella SPH-fuktionsregister." #: config/avr/avr.opt:141 #, no-c-format @@ -14856,7 +14856,7 @@ msgstr "Skriv en KÄLLFIL.opt-record.json-fil med detaljer om vilka optimeringar #: common.opt:2469 #, no-c-format msgid "Detect loops calculating CRC and replace with faster implementation. If the target supports CRC instruction and the CRC loop uses the same polynomial as the one used in the CRC instruction, directly replace with the corresponding CRC instruction. Otherwise, if the target supports carry-less-multiplication instruction, generate CRC using it. If neither case applies, generate table-based CRC." -msgstr "Upptäck slingor som beräknar CRC och ersätt dem med en snabbare implementation. Om målet stödjer en CRC-instruktion och CRC-slingan använder samma polynom smo det som används i CRC-instruktionen, ersätt då direkt med motsvarande CRC-instruktion. Annars, om målet stöjder en instruktion för minnesfri multiplikation, generera en CRC som använder det. Om inget av fallen är tillämpligt, generera tabellbaserad CRC." +msgstr "Upptäck slingor som beräknar CRC och ersätt dem med en snabbare implementation. Om målet stödjer en CRC-instruktion och CRC-slingan använder samma polynom smo det som används i CRC-instruktionen, ersätt då direkt med motsvarande CRC-instruktion. Annars, om målet stödjer en instruktion för minnesfri multiplikation, generera en CRC som använder det. Om inget av fallen är tillämpligt, generera tabellbaserad CRC." #: common.opt:2483 #, no-c-format @@ -17528,7 +17528,7 @@ msgstr "Framtvinga användningen av SLP vid vektorisering, misslyckas om det int #: params.opt:1266 #, no-c-format msgid "Maximum number of basic blocks before VRP switches to a fast model with less memory requirements." -msgstr "Maximalt antal grundblock innan VRP byter till en snabb modell med mintre minneskrav." +msgstr "Maximalt antal grundblock innan VRP byter till en snabb modell med mindre minneskrav." #: params.opt:1270 #, no-c-format @@ -17563,7 +17563,7 @@ msgstr "den anropade returnerar en post" #: calls.cc:2565 msgid "target is not able to optimize the call into a sibling call" -msgstr "målet kan inte optinera anropet till ett syskonanrop" +msgstr "målet kan inte optimera anropet till ett syskonanrop" #: calls.cc:2574 msgid "callee returns twice" @@ -49107,7 +49107,7 @@ msgstr "%<detach%>-klausulens händelsehandtag har typen %qT istället för %<om #: cp/parser.cc:42940 #, gcc-internal-format msgid "string literal must not contain %<\\0%>" -msgstr "strängliteraler får inte innehålla %<\\0%>" +msgstr "stränglitteraler får inte innehålla %<\\0%>" #: c/c-parser.cc:20581 c/c-parser.cc:20702 cp/parser.cc:42835 #: cp/parser.cc:42975 @@ -52621,7 +52621,6 @@ msgstr "%s: regcomp: %s" msgid "logic error: missing inode for %s" msgstr "logikfel: saknad inod för %s" -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104709 #: cobol/util.cc:2141 #, gcc-internal-format, gfc-internal-format msgid "failed compiling %s" @@ -78141,7 +78140,6 @@ msgstr "HOLDS-uttryck vid %L måste vara ett skalärt logiskt uttryck" msgid "ORDERED clause parameter is less than COLLAPSE at %L" msgstr "ORDERED-klausulparameter är mindre än COLLAPSE vid %L" -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107122 #: fortran/openmp.cc:8623 #, gcc-internal-format, gfc-internal-format msgid "ORDER clause must not be used together with ORDERED at %L" diff --git a/gcc/po/zh_CN.po b/gcc/po/zh_CN.po index a5073c1..3f9023f 100644 --- a/gcc/po/zh_CN.po +++ b/gcc/po/zh_CN.po @@ -4,7 +4,7 @@ # Meng Jie <zuxy.meng@gmail.com>, 2005-2014. # Jeff Bai <jeffbai@aosc.xyz>, 2015. # Mingye Wang (Arthur2e5) <arthur200126@gmail.com>, 2015, 2016. -# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2024. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023-2025. # Zixing Zhou <zixingzhou@foxmail.com>, 2023. # Zhanhaoxiang Zhang <zzhx2006@outlook.com>, 2024. # @@ -33,11 +33,11 @@ # msgid "" msgstr "" -"Project-Id-Version: gcc 14.2.0\n" +"Project-Id-Version: gcc 15.1.0\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2025-04-23 19:27+0000\n" -"PO-Revision-Date: 2025-01-09 15:04+0800\n" -"Last-Translator: Zhanhaoxiang Zhang <zzhx2006@outlook.com>\n" +"PO-Revision-Date: 2025-05-15 13:53-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" @@ -45,7 +45,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.5\n" +"X-Generator: Poedit 3.6\n" #: cif-code.def:39 msgid "function not considered for inlining" @@ -317,10 +317,8 @@ msgid "-E or -x required when input is from standard input" msgstr "当输入来自标准输入设备时,需要 -E 或 -x" #: config/darwin.h:153 -#, fuzzy -#| msgid " conflicting code gen style switches are used" msgid "conflicting code generation switches" -msgstr "使用了相互冲突的代码生成风格" +msgstr "使用了相互冲突的代码生成开关" #: config/darwin.h:158 msgid "-bundle_loader not allowed with -dynamiclib" @@ -831,10 +829,9 @@ msgid "Issue debug information for compiler-generated auxiliary variables." msgstr "" #: fortran/lang.opt:486 -#, fuzzy, no-c-format -#| msgid "Enable Plan 9 language extensions" +#, no-c-format msgid "Enable all DEC language extensions." -msgstr "启用九号计划语言扩展" +msgstr "启用所有 DEC 语言扩展。" #: fortran/lang.opt:490 #, fuzzy, no-c-format @@ -868,9 +865,9 @@ msgid "Enable legacy math intrinsics for compatibility." msgstr "" #: fortran/lang.opt:515 -#, fuzzy, no-c-format +#, no-c-format msgid "Enable support for DEC STRUCTURE/RECORD." -msgstr "启用对巨型对象的支持" +msgstr "启用对 DEC STRUCTURE/RECORD 的支持。" #: fortran/lang.opt:519 #, no-c-format @@ -1257,10 +1254,9 @@ msgid "Does nothing. Preserved for backward compatibility." msgstr "不起作用。为向前兼容保留的选项。" #: fortran/lang.opt:911 -#, fuzzy, no-c-format -#| msgid "Statically link the GNU Fortran helper library (libgfortran)" +#, no-c-format msgid "Statically link the GNU Fortran helper library (libgfortran)." -msgstr "静态链接 GNU Fortran 助手库(libgfortran)" +msgstr "静态链接 GNU Fortran 助手库(libgfortran)。" #: fortran/lang.opt:915 #, fuzzy, no-c-format @@ -1296,7 +1292,7 @@ msgstr "遵循 ISO Fortran 2023 标准。" #: fortran/lang.opt:939 #, no-c-format msgid "Enable experimental Fortran 202y features." -msgstr "" +msgstr "启用实验性的 Fortuan 202y 特性。" #: fortran/lang.opt:943 #, no-c-format @@ -1670,7 +1666,7 @@ msgstr "当把函数转换为不兼容类型时给出警告" #: c-family/c.opt:410 #, no-c-format msgid "-Wbidi-chars=[none|unpaired|any|ucn] Warn about UTF-8 bidirectional control characters." -msgstr "" +msgstr "-Wbidi-chars=[none|unpaired|any|ucn] 对 UTF-8 双向控制字符给出警告。" #: c-family/c.opt:433 #, no-c-format @@ -1703,10 +1699,9 @@ msgid "Deprecated in favor of -Wc11-c23-compat." msgstr "已弃用,请改用 -Wc11-c23-compat。" #: c-family/c.opt:457 -#, fuzzy, no-c-format -#| msgid "Warn about features not present in ISO C11, but present in ISO C23." +#, no-c-format msgid "Warn about features not present in ISO C23, but present in ISO C2Y." -msgstr "对 ISO C11 中不存在但 ISO C23 中存在的特性给出警告。" +msgstr "对 ISO C23 中不存在但 ISO C2Y 中存在的特性给出警告。" #: c-family/c.opt:461 #, no-c-format @@ -1869,10 +1864,9 @@ msgid "Warn for implicit type conversions that may change a value." msgstr "当隐式类型转换可能改变值时给出警告" #: c-family/c.opt:590 -#, fuzzy, no-c-format -#| msgid "Warn for converting NULL from/to a non-pointer type" +#, no-c-format msgid "Warn for converting NULL from/to a non-pointer type." -msgstr "将 NULL 转换为非指针类型时给出警告" +msgstr "对 NULL 和非指针类型之间的转换给出警告。" #: c-family/c.opt:598 #, fuzzy, no-c-format @@ -1880,10 +1874,9 @@ msgid "Warn when performing class template argument deduction on a type with no msgstr "%qE不是类型%qT的有效模板实参,因为对象%qD没有外部链接" #: c-family/c.opt:603 -#, fuzzy, no-c-format -#| msgid "Warn when all constructors and destructors are private" +#, no-c-format msgid "Warn when all constructors and destructors are private." -msgstr "当所有构造函数和析构函数都是私有时给出警告" +msgstr "当所有构造函数和析构函数都是私有时给出警告。" #: c-family/c.opt:607 #, no-c-format @@ -1893,7 +1886,7 @@ msgstr "对悬空的 else 给出警告。" #: c-family/c.opt:611 c-family/c.opt:615 #, no-c-format msgid "Warn for uses of pointers to auto variables whose lifetime has ended." -msgstr "" +msgstr "对使用了指向生命周期已结束的 auto 变量的指针给出警告。" #: c-family/c.opt:619 #, no-c-format @@ -1993,16 +1986,14 @@ msgid "Warn about implicit conversions from \"float\" to \"double\"." msgstr "对从“float”到“double”的隐式转换给出警告。" #: c-family/c.opt:702 -#, fuzzy, no-c-format -#| msgid "Warn when a declaration does not specify a type" +#, no-c-format msgid "Warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier." -msgstr "当声明未指定类型时给出警告" +msgstr "当声明中含有重复的 const, volatile, restrict 或 _Atomic 说明符时给出警告。" #: c-family/c.opt:706 -#, fuzzy, no-c-format -#| msgid "Warn about an empty body in an if or else statement" +#, no-c-format msgid "Warn about duplicated branches in if-else statements." -msgstr "当 if 或 else 语句体为空时给出警告" +msgstr "对 if-else 语句中重复的分支给出警告。" #: c-family/c.opt:710 #, no-c-format @@ -2263,10 +2254,9 @@ msgid "Warn when a function never produces a constant expression." msgstr "数字常量表达式下溢时警告" #: c-family/c.opt:930 -#, fuzzy, no-c-format -#| msgid "Warn about invalid uses of the \"offsetof\" macro" +#, no-c-format msgid "Warn about invalid uses of the \"offsetof\" macro." -msgstr "对“offsetof”宏无效的使用给出警告" +msgstr "对“offsetof”宏无效的使用给出警告。" #: c-family/c.opt:934 #, fuzzy, no-c-format @@ -2432,7 +2422,7 @@ msgstr "" #: c-family/c.opt:1083 #, no-c-format msgid "Warn on namespace definition." -msgstr "" +msgstr "对命名空间的定义给出警告。" #: c-family/c.opt:1087 #, fuzzy, no-c-format @@ -2556,10 +2546,9 @@ msgid "Warn when fields in a struct with the packed attribute are misaligned." msgstr "" #: c-family/c.opt:1211 -#, fuzzy, no-c-format -#| msgid "Warn about possibly missing parentheses" +#, no-c-format msgid "Warn about possibly missing parentheses." -msgstr "可能缺少括号的情况下给出警告" +msgstr "在可能缺少括号的情况下给出警告。" #: c-family/c.opt:1219 #, no-c-format @@ -2978,9 +2967,9 @@ msgid "Warn about useless casts." msgstr "对无用的类型转换给出警告。" #: c-family/c.opt:1599 -#, fuzzy, no-c-format +#, no-c-format msgid "Warn about using variadic macros." -msgstr "当定义在主文件中的宏未被使用时给出警告" +msgstr "在使用了变长参数宏时给出警告。" #: c-family/c.opt:1603 #, no-c-format @@ -3131,10 +3120,9 @@ msgid "Enable support for C++ concepts." msgstr "启用对 C++ concepts 的支持。" #: c-family/c.opt:1819 -#, fuzzy, no-c-format -#| msgid "Removed in GCC 10. This switch has no effect." +#, no-c-format msgid "Removed in GCC 15. This switch has no effect." -msgstr "已在 GCC 10 中移除。此开关不起作用。" +msgstr "已在 GCC 15 中移除。此开关不起作用。" #: c-family/c.opt:1823 #, no-c-format @@ -3383,10 +3371,9 @@ msgid "Allow implicit conversions between vectors with differing numbers of subp msgstr "允许具有不同元素数量和/或元素类型的向量间的转换。" #: c-family/c.opt:2059 -#, fuzzy, no-c-format -#| msgid "Enable C++ modules-ts (experimental)." +#, no-c-format msgid "Enable C++20 Modules (experimental)." -msgstr "启用 C++ modules-ts(实验性)。" +msgstr "启用 C++20 模块 实验性)。" #: c-family/c.opt:2067 #, no-c-format @@ -3900,10 +3887,9 @@ msgid "Conform to the ISO 2020 C++ standard (experimental and incomplete support msgstr "遵循 ISO 2020 C++ 标准(试验性质的不完全支持)。" #: c-family/c.opt:2589 c-family/c.opt:2593 -#, fuzzy, no-c-format -#| msgid "Conform to the ISO 2020 C++ standard (experimental and incomplete support)." +#, no-c-format msgid "Conform to the ISO 2023 C++ standard (published in 2024; experimental and incomplete support)." -msgstr "遵循 ISO 2020 C++ 标准(试验性质的不完全支持)。" +msgstr "遵循 ISO 2023 C++ 标准(于2024年发布;试验性质的不完全支持)。" #: c-family/c.opt:2597 c-family/c.opt:2601 #, no-c-format @@ -3927,10 +3913,9 @@ msgid "Conform to the ISO 2017 C standard (published in 2018)." msgstr "遵循 ISO 2017 C 标准(于2018年发布)。" #: c-family/c.opt:2621 c-family/c.opt:2779 -#, fuzzy, no-c-format -#| msgid "Conform to the ISO 2017 C standard (published in 2018)." +#, no-c-format msgid "Conform to the ISO 2023 C standard (published in 2024)." -msgstr "遵循 ISO 2017 C 标准(于2018年发布)。" +msgstr "遵循 ISO 2023 C 标准(于2014年发布)。" #: c-family/c.opt:2625 #, no-c-format @@ -3938,10 +3923,9 @@ msgid "Deprecated in favor of -std=c23." msgstr "已弃用,请改用 -std=c23。" #: c-family/c.opt:2629 -#, fuzzy, no-c-format -#| msgid "Conform to the ISO 2020 C++ standard (experimental and incomplete support)." +#, no-c-format msgid "Conform to the ISO 202Y C standard draft (experimental and incomplete support)." -msgstr "遵循 ISO 2020 C++ 标准(试验性质的不完全支持)。" +msgstr "遵循 ISO 202Y C 标准草案(试验性质的不完全支持)。" #: c-family/c.opt:2633 c-family/c.opt:2637 c-family/c.opt:2751 #, no-c-format @@ -4136,10 +4120,9 @@ msgid "Enable Cobol parser debugging" msgstr "启用后端调试." #: cobol/lang.opt:102 -#, fuzzy, no-c-format -#| msgid "Enable backend debugging." +#, no-c-format msgid "Enable Cobol yacc debugging" -msgstr "启用后端调试." +msgstr "启用 Cobol yacc 调试" #: cobol/lang.opt:106 #, no-c-format @@ -4182,9 +4165,9 @@ msgid "Select the runtime." msgstr "选择运行时。" #: ada/gcc-interface/lang.opt:93 -#, fuzzy, no-c-format +#, no-c-format msgid "Catch typos." -msgstr "进入了 catch 块" +msgstr "捕获打字错误。" #: ada/gcc-interface/lang.opt:97 #, fuzzy, no-c-format @@ -4236,10 +4219,9 @@ msgid "Generate JSON file." msgstr "生成 JSON 文件。" #: d/lang.opt:167 -#, fuzzy, no-c-format -#| msgid "-MF <file>\tWrite dependency output to the given file" +#, no-c-format msgid "-Xf <file>\tWrite JSON output to the given <file>." -msgstr "-MF <文件>\t将依赖项输出到给定文件" +msgstr "-Xf <文件>\t将 JSON 输出到给定<文件>。" #: d/lang.opt:171 #, no-c-format @@ -4440,10 +4422,9 @@ msgid "Implement 'in' contracts of overridden methods to be a superset of parent msgstr "" #: d/lang.opt:408 -#, fuzzy, no-c-format -#| msgid "Consider access to byte sized memory slow." +#, no-c-format msgid "Disable access to shared memory objects." -msgstr "认为按字节访问内存速度较慢。" +msgstr "禁用对共享内存对象的访问。" #: d/lang.opt:412 #, no-c-format @@ -9265,7 +9246,7 @@ msgstr "指定目标架构的名称" #: config/nvptx/nvptx.opt:64 #, no-c-format msgid "Alias:" -msgstr "" +msgstr "别名:" #: config/nvptx/nvptx.opt:125 #, fuzzy, no-c-format @@ -9274,9 +9255,9 @@ msgid "Known PTX ISA versions (for use with the -mptx= option):" msgstr "已知 MIPS ISA 等级 (用于 -mips 选项):" #: config/nvptx/nvptx.opt:156 -#, fuzzy, no-c-format +#, no-c-format msgid "Specify the PTX ISA version to use." -msgstr "ELF 文件 ABI 版本无效" +msgstr "指定要使用的 PTX ISA 版本。" #: config/nvptx/nvptx.opt:160 #, no-c-format @@ -12154,10 +12135,9 @@ msgid "Always align function entry, jump target and return address." msgstr "" #: config/nds32/nds32.opt:85 -#, fuzzy, no-c-format -#| msgid "Align code and data to 32 bits" +#, no-c-format msgid "Align function entry to 4 byte." -msgstr "将代码和数据对齐到 32 位边界上" +msgstr "将函数入口对齐到 4 字节。" #: config/nds32/nds32.opt:97 #, no-c-format @@ -12206,9 +12186,9 @@ msgid "Generate string extension instructions." msgstr "生成加载/存储乘法指令" #: config/nds32/nds32.opt:139 -#, fuzzy, no-c-format +#, no-c-format msgid "Generate DSP extension instructions." -msgstr "生成加载/存储乘法指令" +msgstr "生成 DSP 扩展指令。" #: config/nds32/nds32.opt:143 #, fuzzy, no-c-format @@ -12355,10 +12335,9 @@ msgid "Known IQ2000 CPUs (for use with the -mcpu= option):" msgstr "已知 IQ2000 处理器 (用于 -mcpu= 选项):" #: config/iq2000/iq2000.opt:61 config/mips/mips.opt:142 -#, fuzzy, no-c-format -#| msgid "Use ROM instead of RAM" +#, no-c-format msgid "Use ROM instead of RAM." -msgstr "使用 ROM 而不是 RAM" +msgstr "使用 ROM 而不是 RAM。" #: config/iq2000/iq2000.opt:70 #, fuzzy, no-c-format @@ -12373,15 +12352,14 @@ msgid "Put uninitialized constants in ROM (needs -membedded-data)." msgstr "将未初始化的常量放在 ROM 中(需要 -membedded-data)" #: config/csky/csky.opt:34 -#, fuzzy, no-c-format +#, no-c-format msgid "Specify the target architecture." -msgstr "指定目标架构的名称" +msgstr "指定目标架构的名称。" #: config/csky/csky.opt:38 -#, fuzzy, no-c-format -#| msgid "Specify the target CPU" +#, no-c-format msgid "Specify the target processor." -msgstr "选择目标 CPU" +msgstr "指定目标处理器。" #: config/csky/csky.opt:90 #, fuzzy, no-c-format @@ -12426,10 +12404,9 @@ msgid "Enable coprocessor instructions." msgstr "启用 clip 指令" #: config/csky/csky.opt:122 -#, fuzzy, no-c-format -#| msgid "Enable average instructions" +#, no-c-format msgid "Enable cache prefetch instructions." -msgstr "启用均值指令" +msgstr "启用缓存预取指令。" #: config/csky/csky.opt:126 #, fuzzy, no-c-format @@ -12546,12 +12523,12 @@ msgstr "已知 C6X ISA (用于 -march= 选项):" #: config/c6x/c6x.opt:30 config/mips/mips.opt:134 #, no-c-format msgid "Use big-endian byte order." -msgstr "令大端在前。" +msgstr "使用大端字节序。" #: config/c6x/c6x.opt:34 config/mips/mips.opt:138 #, no-c-format msgid "Use little-endian byte order." -msgstr "令小端在前。" +msgstr "使用小端字节序。" #: config/c6x/c6x.opt:42 #, fuzzy, no-c-format @@ -12958,10 +12935,9 @@ msgid "Annotate assembler instructions with estimated addresses." msgstr "使用估算的地址评注汇编指令" #: config/sh/sh.opt:247 -#, fuzzy, no-c-format -#| msgid "Generate code in little endian mode" +#, no-c-format msgid "Generate code in little endian mode." -msgstr "生成小端在前的代码" +msgstr "在小端序模式下生成代码。" #: config/sh/sh.opt:251 #, fuzzy, no-c-format @@ -13014,27 +12990,24 @@ msgid "Pretend a branch-around-a-move is a conditional move." msgstr "将数据传输周围的跳转认为是条件转移。" #: config/sh/sh.opt:295 -#, fuzzy, no-c-format -#| msgid "Enable the use of the fsca instruction" +#, no-c-format msgid "Enable the use of the fsca instruction." -msgstr "启用对 fsca 指令的使用" +msgstr "启用对 fsca 指令的使用。" #: config/sh/sh.opt:299 -#, fuzzy, no-c-format -#| msgid "Enable the use of the fsrra instruction" +#, no-c-format msgid "Enable the use of the fsrra instruction." -msgstr "启用 fsrra 指令的使用" +msgstr "启用 fsrra 指令的使用。" #: config/gcn/gcn-tables.opt:25 #, no-c-format msgid "GCN GPU type to use:" -msgstr "" +msgstr "要使用的 GCN GPU 类型:" #: config/gcn/gcn.opt:26 config/gcn/gcn.opt:30 -#, fuzzy, no-c-format -#| msgid "Specify the name of the target CPU" +#, no-c-format msgid "Specify the name of the target GPU." -msgstr "指定目标 CPU 的名称" +msgstr "指定目标 CPU 的名称。" #: config/gcn/gcn.opt:34 #, no-c-format @@ -13093,10 +13066,9 @@ msgid "Assume small address space." msgstr "假定小地址空间" #: config/bpf/bpf.opt:28 -#, fuzzy, no-c-format -#| msgid "Generate LP64 code" +#, no-c-format msgid "Generate xBPF." -msgstr "生成 LP64 代码" +msgstr "生成 xBPF。" #: config/bpf/bpf.opt:34 #, fuzzy, no-c-format @@ -13127,10 +13099,9 @@ msgid "Enable extra conditional-branch instructions j(s)lt and j(s)le." msgstr "启用条件移动指令。" #: config/bpf/bpf.opt:56 -#, fuzzy, no-c-format -#| msgid "Enable 32-bit divide instructions" +#, no-c-format msgid "Enable 32-bit ALU instructions." -msgstr "启用 32 位除法指令" +msgstr "启用 32 位 ALU 指令。" #: config/bpf/bpf.opt:60 #, fuzzy, no-c-format @@ -13351,10 +13322,9 @@ msgid "FP exceptions are enabled." msgstr "FP 异常已启用" #: config/mips/mips.opt:223 -#, fuzzy, no-c-format -#| msgid "Use 32-bit floating-point registers" +#, no-c-format msgid "Use 32-bit floating-point registers." -msgstr "使用 32 位浮点寄存器" +msgstr "使用 32 位浮点寄存器。" #: config/mips/mips.opt:227 #, no-c-format @@ -13456,22 +13426,19 @@ msgid "Use -G for object-local data." msgstr "为对象局部数据使用 -G" #: config/mips/mips.opt:305 -#, fuzzy, no-c-format -#| msgid "Use indirect calls" +#, no-c-format msgid "Use indirect calls." -msgstr "使用间接调用" +msgstr "使用间接调用。" #: config/mips/mips.opt:309 -#, fuzzy, no-c-format -#| msgid "Use a 32-bit long type" +#, no-c-format msgid "Use a 32-bit long type." -msgstr "使用 32 位 long 类型" +msgstr "使用 32 位 long 类型。" #: config/mips/mips.opt:313 -#, fuzzy, no-c-format -#| msgid "Use a 64-bit long type" +#, no-c-format msgid "Use a 64-bit long type." -msgstr "使用 64 位 long 类型" +msgstr "使用 64 位 long 类型。" #: config/mips/mips.opt:317 #, fuzzy, no-c-format @@ -13486,9 +13453,9 @@ msgid "Don't optimize block moves." msgstr "不优化块移动" #: config/mips/mips.opt:325 -#, fuzzy, no-c-format +#, no-c-format msgid "Use microMIPS instructions." -msgstr "使用浮点双精度指令" +msgstr "使用 microMIPS 指令。" #: config/mips/mips.opt:329 #, fuzzy, no-c-format @@ -13497,10 +13464,9 @@ msgid "Use MIPS MSA Extension instructions." msgstr "使用 MIPS-DSP 指令" #: config/mips/mips.opt:333 -#, fuzzy, no-c-format -#| msgid "Allow the use of MT instructions" +#, no-c-format msgid "Allow the use of MT instructions." -msgstr "允许使用 MT 指令" +msgstr "允许使用 MT 指令。" #: config/mips/mips.opt:337 #, fuzzy, no-c-format @@ -13509,10 +13475,9 @@ msgid "Prevent the use of all floating-point operations." msgstr "不允许使用任何浮点操作" #: config/mips/mips.opt:341 -#, fuzzy, no-c-format -#| msgid "Use MCU instructions" +#, no-c-format msgid "Use MCU instructions." -msgstr "使用 MCU 指令" +msgstr "使用 MCU 指令。" #: config/mips/mips.opt:345 #, fuzzy, no-c-format @@ -30236,14 +30201,14 @@ msgid "if this code is reached, the program will abort" msgstr "如果执行到这段代码,程序将中止" #: godump.cc:1434 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "could not close Go dump file: %m" -msgstr "无法打开用零填充的指令转储文件%qs:%s" +msgstr "无法关闭 Go 转储文件:%m" #: godump.cc:1446 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "could not open Go dump file %qs: %m" -msgstr "无法打开最终指令转储文件%qs:%s" +msgstr "无法打开 Go 转储文件 %qs:%m" #: graphite.cc:529 #, fuzzy, gcc-internal-format @@ -30399,9 +30364,9 @@ msgid "array types have different bounds" msgstr "?: 的操作数类型不一致,分别为%qT和%qT" #: ipa-devirt.cc:1139 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "return value type mismatch" -msgstr "<返回值>" +msgstr "返回值类型不匹配" #: ipa-devirt.cc:1154 #, gcc-internal-format @@ -30610,10 +30575,9 @@ msgid "name %qs is defined to different value in another translation unit" msgstr "%qE未声明(不在函数内)" #: ipa-devirt.cc:4325 -#, fuzzy, gcc-internal-format -#| msgid "missing definition" +#, gcc-internal-format msgid "mismatching definition" -msgstr "定义缺失" +msgstr "不匹配的定义" #: ipa-fnsummary.cc:4845 #, fuzzy, gcc-internal-format @@ -30867,13 +30831,12 @@ msgstr "需要 %<,%> 或 %<)%>" #: lazy-diagnostic-path.cc:179 #, gcc-internal-format msgid "this warning should be skipped" -msgstr "" +msgstr "该警告信息应当被跳过" #: lazy-diagnostic-path.cc:194 -#, fuzzy, gcc-internal-format -#| msgid "this is the insn:" +#, gcc-internal-format msgid "this is a test" -msgstr "这是指令:" +msgstr "这是一个测试" #: lra-assigns.cc:1694 #, fuzzy, gcc-internal-format, gfc-internal-format @@ -31002,7 +30965,7 @@ msgstr "" #: lto-compress.cc:165 #, gcc-internal-format msgid "original size unknown" -msgstr "" +msgstr "原始大小未知" #: lto-compress.cc:171 #, fuzzy, gcc-internal-format, gfc-internal-format @@ -31145,19 +31108,19 @@ msgid "problem with building target image for %s" msgstr "组建目标平台:%s\n" #: lto-wrapper.cc:1083 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "reading input file" -msgstr "读取输入历史文件…\n" +msgstr "正在读取输入文件" #: lto-wrapper.cc:1088 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "writing output file" -msgstr "写入到输出文件 '%s' 时出错\n" +msgstr "正在写入输出文件" #: lto-wrapper.cc:1127 #, gcc-internal-format msgid "installation error, cannot find %<crtoffloadtable%s.o%>" -msgstr "" +msgstr "安装错误,无法找到 %<crtoffloadtable%s.o%>" #: lto-wrapper.cc:1380 #, fuzzy @@ -31178,10 +31141,9 @@ msgid "environment variable %<COLLECT_GCC_OPTIONS%> must be set" msgstr "环境变量 COLLECT_GCC_OPTIONS 必须被设置" #: lto-wrapper.cc:1575 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "missing argument to %qs" +#, gcc-internal-format, gfc-internal-format msgid "missing directory: %s" -msgstr "%qs缺少参数" +msgstr "缺失目录:%s" #: lto-wrapper.cc:1768 lto-wrapper.cc:1828 c-family/c-pch.cc:215 #: c-family/c-pch.cc:250 c-family/c-pch.cc:288 c-family/c-pch.cc:366 @@ -31217,10 +31179,9 @@ msgid "using ltrans cache without file locking support, do not use in parallel" msgstr "" #: lto-wrapper.cc:2315 config/gcn/mkoffload.cc:954 -#, fuzzy, gcc-internal-format -#| msgid "atexit failed" +#, gcc-internal-format msgid "%<atexit%> failed" -msgstr "atexit 失败" +msgstr "%<atexit%> 失败" #: multiple_target.cc:72 #, fuzzy, gcc-internal-format @@ -31744,9 +31705,9 @@ msgid "location of OpenACC %<kernels%>" msgstr "" #: omp-oacc-kernels-decompose.cc:1295 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "%qs not yet supported" -msgstr "%P%F:不支持 -shared\n" +msgstr "%qs 尚未被支持" #: omp-oacc-neuter-broadcast.cc:1764 #, gcc-internal-format @@ -32525,14 +32486,9 @@ msgid "fail to initialize plugin %s" msgstr "无法初始化插件 %s" #: plugin.cc:708 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "" -#| "cannot load plugin %s\n" -#| "%s" +#, gcc-internal-format, gfc-internal-format msgid "cannot load plugin %s: %s" -msgstr "" -"无法加载插件 %s\n" -"%s" +msgstr "无法加载插件 %s:%s" #: plugin.cc:718 #, fuzzy, gcc-internal-format, gfc-internal-format @@ -32555,10 +32511,9 @@ msgstr "" "%3$s" #: plugin.cc:737 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "fail to initialize plugin %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to initialize plugin %s" -msgstr "无法初始化插件 %s" +msgstr "初始化插件 %s 失败" #: plugin.cc:1049 #, fuzzy, gcc-internal-format @@ -32831,9 +32786,9 @@ msgid "register of %qD used for multiple global register variables" msgstr "嵌套函数中使用了全局寄存器变量%qD" #: reginfo.cc:760 config/rs6000/rs6000-logue.cc:5577 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "conflicts with %qD" -msgstr "%qD与已用的函数冲突" +msgstr "与 %qD 冲突" #: reginfo.cc:765 #, gcc-internal-format @@ -33125,9 +33080,9 @@ msgid "variable symbol is not variable" msgstr "%L处的符号不是一个 DUMMY 变量" #: symtab.cc:1130 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "node has unknown type" -msgstr "未知类型的输入行" +msgstr "节点类型未知" #: symtab.cc:1135 #, fuzzy, gcc-internal-format, gfc-internal-format @@ -45675,10 +45630,9 @@ msgid "mips16 function profiling" msgstr "mips16 函数取样" #: config/mmix/mmix.cc:318 -#, fuzzy, gcc-internal-format -#| msgid "-f%s not supported: ignored" +#, gcc-internal-format msgid "%<-f%s%> not supported: ignored" -msgstr "-f%s 不受支持:已忽略" +msgstr "%<-f%s%> 不受支持:已忽略" #: config/mmix/mmix.cc:783 #, gcc-internal-format @@ -45818,7 +45772,7 @@ msgstr "" #: config/msp430/msp430-devices.cc:488 #, gcc-internal-format msgid "could not locate MCU data file %<devices.csv%>" -msgstr "" +msgstr "无法定位 MCU 数据文件 %<devices.csv%>" #: config/msp430/msp430.cc:181 #, gcc-internal-format @@ -45861,10 +45815,9 @@ msgid "unrecognized MCU name %qs, assuming that it just supports the MSP430X ISA msgstr "" #: config/msp430/msp430.cc:250 -#, fuzzy, gcc-internal-format -#| msgid "unrecognized register name %qs" +#, gcc-internal-format msgid "Unrecognized MCU name %qs." -msgstr "不可识别的寄存名%qs" +msgstr "无法识别的 MCU 名称 %qs。" #: config/msp430/msp430.cc:255 #, fuzzy, gcc-internal-format @@ -46152,9 +46105,9 @@ msgid "%<-mabi=2fp+%> option only support when FPU available, must be enable %<- msgstr "" #: config/nvptx/mkoffload.cc:94 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "deleting file %s: %m" -msgstr "删除临时 exp 文件 %s" +msgstr "正在删除文件 %s: %m" #: config/nvptx/mkoffload.cc:119 #, gcc-internal-format @@ -46203,9 +46156,9 @@ msgid "cannot open '%s'" msgstr "无法打开“%s”" #: config/nvptx/mkoffload.cc:860 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "cannot open intermediate ptx file" -msgstr "无法打开输入文件“%s”" +msgstr "无法打开中间的 ptx 文件" #: config/nvptx/nvptx.cc:206 #, fuzzy, gcc-internal-format @@ -46355,15 +46308,14 @@ msgid "%<CTABLE_ENTRY%> index %wd is not valid" msgstr "" #: config/pru/pru-pragma.cc:63 -#, fuzzy, gcc-internal-format -#| msgid "redefinition of %q#T" +#, gcc-internal-format msgid "redefinition of %<CTABLE_ENTRY %wd%>" -msgstr "%q#T重定义" +msgstr "%<CTABLE_ENTRY %wd%> 的重定义" #: config/pru/pru-pragma.cc:67 #, gcc-internal-format msgid "%<CTABLE_ENTRY%> base address is not a multiple of 256" -msgstr "" +msgstr "%<CTABLE_ENTRY%> 基地址不是 256 的倍数" #: config/pru/pru-pragma.cc:75 #, fuzzy, gcc-internal-format @@ -46754,10 +46706,9 @@ msgid "rv32e requires ilp32e ABI" msgstr "rv32e 需要 ilp32e ABI" #: config/riscv/riscv.cc:10723 -#, fuzzy, gcc-internal-format -#| msgid "rv32e requires ilp32e ABI" +#, gcc-internal-format msgid "rv64e requires lp64e ABI" -msgstr "rv32e 需要 ilp32e ABI" +msgstr "rv64e 需要 lp64e ABI" #: config/riscv/riscv.cc:10728 #, fuzzy, gcc-internal-format @@ -47252,10 +47203,9 @@ msgstr "%qs必须与%qs一起使用" #: config/rs6000/rs6000.cc:4222 config/rs6000/rs6000.cc:4231 #: config/rs6000/rs6000.cc:4369 config/rs6000/rs6000.cc:4382 #: config/rs6000/rs6000.cc:4404 -#, fuzzy, gcc-internal-format -#| msgid "%qT referred to as %qs" +#, gcc-internal-format msgid "%qs requires %qs" -msgstr "%qT作为%qs被引用" +msgstr "%qs 需要 %qs" #: config/rs6000/rs6000.cc:4118 #, fuzzy, gcc-internal-format @@ -47517,10 +47467,9 @@ msgid "%qF requires z15 or higher" msgstr "%qF 需要 z15 或更高" #: config/s390/s390-c.cc:965 -#, fuzzy, gcc-internal-format -#| msgid "%qF requires z14 or higher" +#, gcc-internal-format msgid "%qF requires z17 or higher" -msgstr "%qF 需要 z14 或更高" +msgstr "%qF 需要 z17 或更高" #: config/s390/s390-c.cc:979 #, gcc-internal-format @@ -80823,9 +80772,9 @@ msgid "Extension: Unary operator following arithmetic operator (use parentheses) msgstr "扩展:%C处单目运算符出现在算术运算符之后" #: fortran/matchexp.cc:666 -#, fuzzy, gcc-internal-format +#, gcc-internal-format msgid "match_level_4(): Bad operator" -msgstr "错误的运算符" +msgstr "match_level_4():错误的运算符" #: fortran/misc.cc:116 #, gcc-internal-format diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da60a95..c8b0bad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,138 @@ +2025-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + Backported from master: + 2025-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/120049 + * gfortran.dg/pr120049_a.f90: New test. + * gfortran.dg/pr120049_b.f90: New test. + +2025-05-16 Maciej W. Rozycki <macro@orcam.me.uk> + + Backported from master: + 2025-04-19 Maciej W. Rozycki <macro@orcam.me.uk> + + * gcc.target/alpha/memcpy-nested-offset-long.c: New file. + * gcc.target/alpha/memcpy-nested-offset-quad.c: New file. + +2025-05-15 Patrick Palka <ppalka@redhat.com> + + Backported from master: + 2025-05-15 Patrick Palka <ppalka@redhat.com> + + PR c++/120161 + * g++.dg/template/unify13.C: New test. + +2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + Backported from master: + 2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/120125 + * g++.dg/modules/clone-4_a.C: New test. + * g++.dg/modules/clone-4_b.C: New test. + +2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + Backported from master: + 2025-05-14 Nathaniel Shead <nathanieloshead@gmail.com> + + PR c++/119864 + * g++.dg/modules/openmp-1.C: New test. + +2025-05-13 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/120163 + * gfortran.dg/interface_61.f90: New test. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-05-05 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/120117 + * gm2/pim/pass/highbit.mod: New test. + * gm2/pim/pass/highbit2.mod: New test. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-04-24 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/119915 + * gm2/pimlib/run/pass/format2.mod: New test. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-04-24 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/119914 + * gm2/pim/fail/constintarraybyte.mod: New test. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/120188 + * gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp: + Remove call to gm2-dg-frontend-configure-check and replace with + tests for whether plugin variables exist. + +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-05-12 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/120188 + * lib/gm2-dg.exp (gm2-dg-frontend-configure-check): New function. + (gm2-dg-runtest): Add -O2 to the option_list. + * gm2.dg/doc/examples/plugin/fail/assignvalue.mod: New test. + * gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp: New test. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120196 + * gfortran.dg/pr120196.f90: New test. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/120191 + * gfortran.dg/pr120191_3.f90: New test. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/120191 + * gfortran.dg/pr120191_2.f90: New test. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + Daniil Kochergin <daniil2472s@gmail.com> + Tobias Burnus <tburnus@baylibre.com> + + PR fortran/120191 + * gfortran.dg/pr120191_1.f90: New test. + +2025-05-12 Jason Merrill <jason@redhat.com> + + Backported from master: + 2025-05-12 Jason Merrill <jason@redhat.com> + + PR c++/120012 + * g++.dg/abi/base-defaulted2.C: New test. + 2025-05-11 Richard Biener <rguenther@suse.de> PR tree-optimization/120211 diff --git a/gcc/testsuite/g++.dg/abi/base-defaulted2.C b/gcc/testsuite/g++.dg/abi/base-defaulted2.C new file mode 100644 index 0000000..9652ae6 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/base-defaulted2.C @@ -0,0 +1,12 @@ +// { dg-do compile { target c++11 } } +// { dg-additional-options "-fabi-version=20 -Wabi" } + +struct Base { +protected: + Base() = default; + ~Base() = default; +}; + +struct Derived : Base { + void* ptr; // { dg-bogus "offset" } +}; diff --git a/gcc/testsuite/g++.dg/modules/clone-4_a.C b/gcc/testsuite/g++.dg/modules/clone-4_a.C new file mode 100644 index 0000000..3ee6109 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/clone-4_a.C @@ -0,0 +1,12 @@ +// PR c++/120125 +// { dg-additional-options "-fmodules -fdeclone-ctor-dtor" } +// { dg-module-cmi M } + +export module M; + +void foo(); +export template <typename _Tp> struct __shared_ptr { + inline __shared_ptr() { foo(); } +}; + +template class __shared_ptr<int>; diff --git a/gcc/testsuite/g++.dg/modules/clone-4_b.C b/gcc/testsuite/g++.dg/modules/clone-4_b.C new file mode 100644 index 0000000..1b36cb4 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/clone-4_b.C @@ -0,0 +1,12 @@ +// PR c++/120125 +// { dg-additional-options "-fmodules -fdeclone-ctor-dtor" } + +import M; + +int main() { + __shared_ptr<int> s1; + __shared_ptr<double> s2; +} + +// { dg-final { scan-assembler-not {_ZNW1M12__shared_ptrIiEC[1-4]Ev:} } } +// { dg-final { scan-assembler {_ZNW1M12__shared_ptrIdEC2Ev:} } } diff --git a/gcc/testsuite/g++.dg/modules/openmp-1.C b/gcc/testsuite/g++.dg/modules/openmp-1.C new file mode 100644 index 0000000..b5a30ad --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/openmp-1.C @@ -0,0 +1,9 @@ +// PR c++/119864 +// { dg-do assemble } +// { dg-additional-options "-fmodules -fopenmp" } +// { dg-require-effective-target "fopenmp" } + +export module M; + +int foo(); +int x = foo(); diff --git a/gcc/testsuite/g++.dg/modules/partial-8.h b/gcc/testsuite/g++.dg/modules/partial-8.h new file mode 100644 index 0000000..d9a83a8 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-8.h @@ -0,0 +1,8 @@ +// PR c++/120013 + +template <typename> struct tuple_element; +template <typename T> tuple_element<T*> get(T); + +// This case wasn't an issue for the PR, but worth double-checking +template <typename> constexpr int var = 123; +template <typename T> void foo(T, int = var<T*>); diff --git a/gcc/testsuite/g++.dg/modules/partial-8_a.C b/gcc/testsuite/g++.dg/modules/partial-8_a.C new file mode 100644 index 0000000..d6848c7 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-8_a.C @@ -0,0 +1,10 @@ +// PR c++/120013 +// { dg-additional-options "-fmodules -Wno-global-module" } +// { dg-module-cmi m:a } + +module; +#include "partial-8.h" +template <typename T> struct tuple_element<T*>; +template <typename T> constexpr int var<T*> = 456; +module m:a; +template <typename T> void a(T t) { ::get(t); foo(t); } diff --git a/gcc/testsuite/g++.dg/modules/partial-8_b.C b/gcc/testsuite/g++.dg/modules/partial-8_b.C new file mode 100644 index 0000000..ce5cd09 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-8_b.C @@ -0,0 +1,8 @@ +// PR c++/120013 +// { dg-additional-options "-fmodules -Wno-global-module" } +// { dg-module-cmi m:b } + +module; +#include "partial-8.h" +module m:b; +template <typename T> void b(T t) { ::get(t); foo(t); } diff --git a/gcc/testsuite/g++.dg/modules/partial-8_c.C b/gcc/testsuite/g++.dg/modules/partial-8_c.C new file mode 100644 index 0000000..eadd282 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-8_c.C @@ -0,0 +1,7 @@ +// PR c++/120013 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi m } + +export module m; +import :a; +import :b; diff --git a/gcc/testsuite/g++.dg/modules/partial-8_d.C b/gcc/testsuite/g++.dg/modules/partial-8_d.C new file mode 100644 index 0000000..2aedb39 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-8_d.C @@ -0,0 +1,9 @@ +// PR c++/120013 +// { dg-additional-options "-fmodules" } +// { dg-module-cmi m } +// Same as partial-8_c.C but in the other order, to ensure +// that loading a partial spec over an instantiation works + +export module m; +import :b; +import :a; diff --git a/gcc/testsuite/g++.dg/modules/tinfo-3_a.H b/gcc/testsuite/g++.dg/modules/tinfo-3_a.H new file mode 100644 index 0000000..8b53e98 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tinfo-3_a.H @@ -0,0 +1,7 @@ +// PR c++/120350 +// { dg-additional-options "-fmodule-header" } +// { dg-module-cmi {} } + +#include <typeinfo> +struct S {}; +inline const std::type_info& tinfo = typeid(S); diff --git a/gcc/testsuite/g++.dg/modules/tinfo-3_b.C b/gcc/testsuite/g++.dg/modules/tinfo-3_b.C new file mode 100644 index 0000000..95e02ab --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/tinfo-3_b.C @@ -0,0 +1,8 @@ +// PR c++/120350 +// { dg-additional-options "-fmodules" } + +import "tinfo-3_a.H"; + +int main() { + return tinfo == typeid(int); +} diff --git a/gcc/testsuite/g++.dg/template/unify13.C b/gcc/testsuite/g++.dg/template/unify13.C new file mode 100644 index 0000000..ec7ca9d --- /dev/null +++ b/gcc/testsuite/g++.dg/template/unify13.C @@ -0,0 +1,18 @@ +// PR c++/120161 + +template<class T, class U> +struct mp_list { }; + +template<class T> +struct Wrap { struct type { }; }; + +struct A : mp_list<Wrap<int>::type, void> + , mp_list<Wrap<long>::type, void> { }; + +template<class U> +void f(mp_list<Wrap<int>::type, U>*); + +int main() { + A a; + f(&a); +} diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c new file mode 100644 index 0000000..631d14f --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c @@ -0,0 +1,76 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef unsigned int __attribute__ ((mode (DI))) int64_t; +typedef unsigned int __attribute__ ((mode (SI))) int32_t; + +typedef union + { + int32_t l[8]; + } +val; + +typedef struct + { + int32_t l[2]; + val v; + } +tre; + +typedef struct + { + int32_t l[3]; + tre t; + } +due; + +typedef struct + { + val v; + int64_t q; + int32_t l[2]; + due d; + } +uno; + +void +memcpy_nested_offset_long (uno *u) +{ + u->d.t.v = u->v; +} + +/* Expect assembly such as: + + ldq $4,0($16) + ldq $3,8($16) + ldq $2,16($16) + srl $4,32,$7 + ldq $1,24($16) + srl $3,32,$6 + stl $4,68($16) + srl $2,32,$5 + stl $7,72($16) + srl $1,32,$4 + stl $3,76($16) + stl $6,80($16) + stl $2,84($16) + stl $5,88($16) + stl $1,92($16) + stl $4,96($16) + + that is with four quadword loads at offsets 0, 8, 16, 24 each and + eight longword stores at offsets 68, 72, 76, 80, 84, 88, 92, 96 each. */ + +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,0\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,8\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,16\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,24\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,68\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,72\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,76\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,80\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,84\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,88\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,92\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,96\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c new file mode 100644 index 0000000..1d2227e --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c @@ -0,0 +1,64 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } } */ + +typedef unsigned int __attribute__ ((mode (DI))) int64_t; +typedef unsigned int __attribute__ ((mode (SI))) int32_t; + +typedef union + { + int32_t l[8]; + } +val; + +typedef struct + { + int32_t l[2]; + val v; + } +tre; + +typedef struct + { + int32_t l[3]; + tre t; + } +due; + +typedef struct + { + val v; + int64_t q; + int32_t l[3]; + due d; + } +uno; + +void +memcpy_nested_offset_quad (uno *u) +{ + u->d.t.v = u->v; +} + +/* Expect assembly such as: + + ldq $4,0($16) + ldq $3,8($16) + ldq $2,16($16) + ldq $1,24($16) + stq $4,72($16) + stq $3,80($16) + stq $2,88($16) + stq $1,96($16) + + that is with four quadword loads at offsets 0, 8, 16, 24 each + and four quadword stores at offsets 72, 80, 88, 96 each. */ + +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,0\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,8\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,16\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,24\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,72\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,80\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,88\\\(\\\$16\\\)\\s" 1 } } */ +/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,96\\\(\\\$16\\\)\\s" 1 } } */ diff --git a/gcc/testsuite/gfortran.dg/interface_61.f90 b/gcc/testsuite/gfortran.dg/interface_61.f90 new file mode 100644 index 0000000..15db3b8a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_61.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! { dg-options -Wexternal-argument-mismatch } +! PR fortran/120163 - this used to cause an error. +! Original test case by Bálint Aradi +module mod1 + implicit none + + abstract interface + pure subroutine callback_interface(a) + real, intent(in) :: a + end subroutine callback_interface + end interface + +contains + + subroutine caller(callback) + procedure(callback_interface) :: callback + real :: a + call callback(a) + end subroutine caller + +end module mod1 + + +module mod2 + use mod1 +end module mod2 diff --git a/gcc/testsuite/gfortran.dg/pr120049_a.f90 b/gcc/testsuite/gfortran.dg/pr120049_a.f90 new file mode 100644 index 0000000..c404a4d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120049_a.f90 @@ -0,0 +1,15 @@ +! { dg-do preprocess } +! { dg-additional-options "-cpp" } +! +! Test the fix for PR86248 +program tests_gtk_sup + use gtk_sup + implicit none + type(c_ptr), target :: val + if (c_associated(val, c_loc(val))) then + stop 1 + endif + if (c_associated(c_loc(val), val)) then + stop 2 + endif +end program tests_gtk_sup diff --git a/gcc/testsuite/gfortran.dg/pr120049_b.f90 b/gcc/testsuite/gfortran.dg/pr120049_b.f90 new file mode 100644 index 0000000..127db98 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120049_b.f90 @@ -0,0 +1,8 @@ +! { dg-do run } +! { dg-additional-sources pr120049_a.f90 } +! +! Module for pr120049.f90 +! +module gtk_sup + use, intrinsic :: iso_c_binding +end module gtk_sup diff --git a/gcc/testsuite/gfortran.dg/pr120191_1.f90 b/gcc/testsuite/gfortran.dg/pr120191_1.f90 new file mode 100644 index 0000000..13a787d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120191_1.f90 @@ -0,0 +1,614 @@ +! PR fortran/120191 +! { dg-do run } + + integer(kind=1) :: a1(10, 10, 10), b1(10) + integer(kind=2) :: a2(10, 10, 10), b2(10) + integer(kind=4) :: a4(10, 10, 10), b4(10) + integer(kind=8) :: a8(10, 10, 10), b8(10) + real(kind=4) :: r4(10, 10, 10), s4(10) + real(kind=8) :: r8(10, 10, 10), s8(10) + logical :: l1(10, 10, 10), l2(10), l3 + l1 = .true. + l2 = .true. + l3 = .true. + a1 = 0 + if (any (maxloc (a1) .ne. 1)) stop 1 + if (any (maxloc (a1, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (a1, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (a1, kind=2) .ne. 1)) stop 4 + if (any (maxloc (a1, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (a1, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (a1, 1) .ne. 1)) stop 7 + if (any (maxloc (a1, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (a1, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (a1, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (a1, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (a1, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (a1, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (a1, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (a1, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (a1, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (a1, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (a1, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (a1, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (a1, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (a1, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (a1, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (a1, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (a1, 1, l3, 2, .true.) .ne. 10)) stop 24 + b1 = 0 + if (any (maxloc (b1) .ne. 1)) stop 1 + if (any (maxloc (b1, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (b1, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (b1, kind=2) .ne. 1)) stop 4 + if (any (maxloc (b1, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (b1, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (b1, 1) .ne. 1) stop 7 + if (maxloc (b1, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (b1, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (b1, 1, kind=1) .ne. 1) stop 10 + if (maxloc (b1, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (b1, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (b1, 1, l2) .ne. 1) stop 13 + if (maxloc (b1, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (b1, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (b1, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (b1, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (b1, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (b1, 1, l3) .ne. 1) stop 19 + if (maxloc (b1, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (b1, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (b1, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (b1, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (b1, 1, l3, 2, .true.) .ne. 10) stop 24 + a2 = 0 + if (any (maxloc (a2) .ne. 1)) stop 1 + if (any (maxloc (a2, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (a2, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (a2, kind=2) .ne. 1)) stop 4 + if (any (maxloc (a2, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (a2, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (a2, 1) .ne. 1)) stop 7 + if (any (maxloc (a2, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (a2, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (a2, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (a2, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (a2, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (a2, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (a2, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (a2, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (a2, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (a2, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (a2, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (a2, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (a2, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (a2, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (a2, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (a2, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (a2, 1, l3, 2, .true.) .ne. 10)) stop 24 + b2 = 0 + if (any (maxloc (b2) .ne. 1)) stop 1 + if (any (maxloc (b2, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (b2, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (b2, kind=2) .ne. 1)) stop 4 + if (any (maxloc (b2, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (b2, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (b2, 1) .ne. 1) stop 7 + if (maxloc (b2, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (b2, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (b2, 1, kind=1) .ne. 1) stop 10 + if (maxloc (b2, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (b2, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (b2, 1, l2) .ne. 1) stop 13 + if (maxloc (b2, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (b2, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (b2, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (b2, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (b2, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (b2, 1, l3) .ne. 1) stop 19 + if (maxloc (b2, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (b2, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (b2, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (b2, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (b2, 1, l3, 2, .true.) .ne. 10) stop 24 + a4 = 0 + if (any (maxloc (a4) .ne. 1)) stop 1 + if (any (maxloc (a4, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (a4, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (a4, kind=2) .ne. 1)) stop 4 + if (any (maxloc (a4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (a4, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (a4, 1) .ne. 1)) stop 7 + if (any (maxloc (a4, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (a4, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (a4, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (a4, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (a4, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (a4, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (a4, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (a4, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (a4, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (a4, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (a4, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (a4, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (a4, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (a4, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (a4, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (a4, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (a4, 1, l3, 2, .true.) .ne. 10)) stop 24 + b4 = 0 + if (any (maxloc (b4) .ne. 1)) stop 1 + if (any (maxloc (b4, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (b4, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (b4, kind=2) .ne. 1)) stop 4 + if (any (maxloc (b4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (b4, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (b4, 1) .ne. 1) stop 7 + if (maxloc (b4, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (b4, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (b4, 1, kind=1) .ne. 1) stop 10 + if (maxloc (b4, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (b4, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (b4, 1, l2) .ne. 1) stop 13 + if (maxloc (b4, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (b4, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (b4, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (b4, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (b4, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (b4, 1, l3) .ne. 1) stop 19 + if (maxloc (b4, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (b4, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (b4, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (b4, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (b4, 1, l3, 2, .true.) .ne. 10) stop 24 + a8 = 0 + if (any (maxloc (a8) .ne. 1)) stop 1 + if (any (maxloc (a8, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (a8, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (a8, kind=2) .ne. 1)) stop 4 + if (any (maxloc (a8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (a8, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (a8, 1) .ne. 1)) stop 7 + if (any (maxloc (a8, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (a8, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (a8, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (a8, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (a8, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (a8, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (a8, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (a8, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (a8, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (a8, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (a8, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (a8, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (a8, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (a8, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (a8, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (a8, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (a8, 1, l3, 2, .true.) .ne. 10)) stop 24 + b8 = 0 + if (any (maxloc (b8) .ne. 1)) stop 1 + if (any (maxloc (b8, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (b8, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (b8, kind=2) .ne. 1)) stop 4 + if (any (maxloc (b8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (b8, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (b8, 1) .ne. 1) stop 7 + if (maxloc (b8, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (b8, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (b8, 1, kind=1) .ne. 1) stop 10 + if (maxloc (b8, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (b8, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (b8, 1, l2) .ne. 1) stop 13 + if (maxloc (b8, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (b8, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (b8, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (b8, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (b8, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (b8, 1, l3) .ne. 1) stop 19 + if (maxloc (b8, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (b8, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (b8, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (b8, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (b8, 1, l3, 2, .true.) .ne. 10) stop 24 + r4 = 0.0 + if (any (maxloc (r4) .ne. 1)) stop 1 + if (any (maxloc (r4, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (r4, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (r4, kind=2) .ne. 1)) stop 4 + if (any (maxloc (r4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (r4, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (r4, 1) .ne. 1)) stop 7 + if (any (maxloc (r4, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (r4, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (r4, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (r4, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (r4, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (r4, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (r4, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (r4, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (r4, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (r4, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (r4, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (r4, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (r4, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (r4, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (r4, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (r4, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (r4, 1, l3, 2, .true.) .ne. 10)) stop 24 + s4 = 0.0 + if (any (maxloc (s4) .ne. 1)) stop 1 + if (any (maxloc (s4, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (s4, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (s4, kind=2) .ne. 1)) stop 4 + if (any (maxloc (s4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (s4, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (s4, 1) .ne. 1) stop 7 + if (maxloc (s4, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (s4, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (s4, 1, kind=1) .ne. 1) stop 10 + if (maxloc (s4, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (s4, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (s4, 1, l2) .ne. 1) stop 13 + if (maxloc (s4, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (s4, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (s4, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (s4, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (s4, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (s4, 1, l3) .ne. 1) stop 19 + if (maxloc (s4, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (s4, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (s4, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (s4, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (s4, 1, l3, 2, .true.) .ne. 10) stop 24 + r8 = 0.0 + if (any (maxloc (r8) .ne. 1)) stop 1 + if (any (maxloc (r8, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (r8, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (r8, kind=2) .ne. 1)) stop 4 + if (any (maxloc (r8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (r8, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (maxloc (r8, 1) .ne. 1)) stop 7 + if (any (maxloc (r8, 1, back=.false.) .ne. 1)) stop 8 + if (any (maxloc (r8, 1, back=.true.) .ne. 10)) stop 9 + if (any (maxloc (r8, 1, kind=1) .ne. 1)) stop 10 + if (any (maxloc (r8, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (maxloc (r8, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (maxloc (r8, 1, l1) .ne. 1)) stop 13 + if (any (maxloc (r8, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (maxloc (r8, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (maxloc (r8, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (maxloc (r8, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (maxloc (r8, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (maxloc (r8, 1, l3) .ne. 1)) stop 19 + if (any (maxloc (r8, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (maxloc (r8, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (maxloc (r8, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (maxloc (r8, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (maxloc (r8, 1, l3, 2, .true.) .ne. 10)) stop 24 + s8 = 0.0 + if (any (maxloc (s8) .ne. 1)) stop 1 + if (any (maxloc (s8, back=.false.) .ne. 1)) stop 2 + if (any (maxloc (s8, back=.true.) .ne. 10)) stop 3 + if (any (maxloc (s8, kind=2) .ne. 1)) stop 4 + if (any (maxloc (s8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (maxloc (s8, kind=8, back=.true.) .ne. 10)) stop 6 + if (maxloc (s8, 1) .ne. 1) stop 7 + if (maxloc (s8, 1, back=.false.) .ne. 1) stop 8 + if (maxloc (s8, 1, back=.true.) .ne. 10) stop 9 + if (maxloc (s8, 1, kind=1) .ne. 1) stop 10 + if (maxloc (s8, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (maxloc (s8, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (maxloc (s8, 1, l2) .ne. 1) stop 13 + if (maxloc (s8, 1, l2, back=.false.) .ne. 1) stop 14 + if (maxloc (s8, 1, l2, back=.true.) .ne. 10) stop 15 + if (maxloc (s8, 1, l2, kind=8) .ne. 1) stop 16 + if (maxloc (s8, 1, l2, 4, .false.) .ne. 1) stop 17 + if (maxloc (s8, 1, l2, 2, .true.) .ne. 10) stop 18 + if (maxloc (s8, 1, l3) .ne. 1) stop 19 + if (maxloc (s8, 1, l3, back=.false.) .ne. 1) stop 20 + if (maxloc (s8, 1, l3, back=.true.) .ne. 10) stop 21 + if (maxloc (s8, 1, l3, kind=8) .ne. 1) stop 22 + if (maxloc (s8, 1, l3, 4, .false.) .ne. 1) stop 23 + if (maxloc (s8, 1, l3, 2, .true.) .ne. 10) stop 24 + a1 = 0 + if (any (minloc (a1) .ne. 1)) stop 1 + if (any (minloc (a1, back=.false.) .ne. 1)) stop 2 + if (any (minloc (a1, back=.true.) .ne. 10)) stop 3 + if (any (minloc (a1, kind=2) .ne. 1)) stop 4 + if (any (minloc (a1, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (a1, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (a1, 1) .ne. 1)) stop 7 + if (any (minloc (a1, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (a1, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (a1, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (a1, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (a1, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (a1, 1, l1) .ne. 1)) stop 13 + if (any (minloc (a1, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (a1, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (a1, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (a1, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (a1, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (a1, 1, l3) .ne. 1)) stop 19 + if (any (minloc (a1, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (a1, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (a1, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (a1, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (a1, 1, l3, 2, .true.) .ne. 10)) stop 24 + b1 = 0 + if (any (minloc (b1) .ne. 1)) stop 1 + if (any (minloc (b1, back=.false.) .ne. 1)) stop 2 + if (any (minloc (b1, back=.true.) .ne. 10)) stop 3 + if (any (minloc (b1, kind=2) .ne. 1)) stop 4 + if (any (minloc (b1, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (b1, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (b1, 1) .ne. 1) stop 7 + if (minloc (b1, 1, back=.false.) .ne. 1) stop 8 + if (minloc (b1, 1, back=.true.) .ne. 10) stop 9 + if (minloc (b1, 1, kind=1) .ne. 1) stop 10 + if (minloc (b1, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (b1, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (b1, 1, l2) .ne. 1) stop 13 + if (minloc (b1, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (b1, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (b1, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (b1, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (b1, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (b1, 1, l3) .ne. 1) stop 19 + if (minloc (b1, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (b1, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (b1, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (b1, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (b1, 1, l3, 2, .true.) .ne. 10) stop 24 + a2 = 0 + if (any (minloc (a2) .ne. 1)) stop 1 + if (any (minloc (a2, back=.false.) .ne. 1)) stop 2 + if (any (minloc (a2, back=.true.) .ne. 10)) stop 3 + if (any (minloc (a2, kind=2) .ne. 1)) stop 4 + if (any (minloc (a2, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (a2, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (a2, 1) .ne. 1)) stop 7 + if (any (minloc (a2, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (a2, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (a2, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (a2, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (a2, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (a2, 1, l1) .ne. 1)) stop 13 + if (any (minloc (a2, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (a2, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (a2, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (a2, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (a2, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (a2, 1, l3) .ne. 1)) stop 19 + if (any (minloc (a2, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (a2, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (a2, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (a2, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (a2, 1, l3, 2, .true.) .ne. 10)) stop 24 + b2 = 0 + if (any (minloc (b2) .ne. 1)) stop 1 + if (any (minloc (b2, back=.false.) .ne. 1)) stop 2 + if (any (minloc (b2, back=.true.) .ne. 10)) stop 3 + if (any (minloc (b2, kind=2) .ne. 1)) stop 4 + if (any (minloc (b2, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (b2, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (b2, 1) .ne. 1) stop 7 + if (minloc (b2, 1, back=.false.) .ne. 1) stop 8 + if (minloc (b2, 1, back=.true.) .ne. 10) stop 9 + if (minloc (b2, 1, kind=1) .ne. 1) stop 10 + if (minloc (b2, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (b2, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (b2, 1, l2) .ne. 1) stop 13 + if (minloc (b2, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (b2, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (b2, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (b2, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (b2, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (b2, 1, l3) .ne. 1) stop 19 + if (minloc (b2, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (b2, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (b2, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (b2, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (b2, 1, l3, 2, .true.) .ne. 10) stop 24 + a4 = 0 + if (any (minloc (a4) .ne. 1)) stop 1 + if (any (minloc (a4, back=.false.) .ne. 1)) stop 2 + if (any (minloc (a4, back=.true.) .ne. 10)) stop 3 + if (any (minloc (a4, kind=2) .ne. 1)) stop 4 + if (any (minloc (a4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (a4, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (a4, 1) .ne. 1)) stop 7 + if (any (minloc (a4, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (a4, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (a4, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (a4, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (a4, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (a4, 1, l1) .ne. 1)) stop 13 + if (any (minloc (a4, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (a4, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (a4, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (a4, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (a4, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (a4, 1, l3) .ne. 1)) stop 19 + if (any (minloc (a4, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (a4, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (a4, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (a4, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (a4, 1, l3, 2, .true.) .ne. 10)) stop 24 + b4 = 0 + if (any (minloc (b4) .ne. 1)) stop 1 + if (any (minloc (b4, back=.false.) .ne. 1)) stop 2 + if (any (minloc (b4, back=.true.) .ne. 10)) stop 3 + if (any (minloc (b4, kind=2) .ne. 1)) stop 4 + if (any (minloc (b4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (b4, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (b4, 1) .ne. 1) stop 7 + if (minloc (b4, 1, back=.false.) .ne. 1) stop 8 + if (minloc (b4, 1, back=.true.) .ne. 10) stop 9 + if (minloc (b4, 1, kind=1) .ne. 1) stop 10 + if (minloc (b4, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (b4, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (b4, 1, l2) .ne. 1) stop 13 + if (minloc (b4, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (b4, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (b4, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (b4, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (b4, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (b4, 1, l3) .ne. 1) stop 19 + if (minloc (b4, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (b4, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (b4, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (b4, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (b4, 1, l3, 2, .true.) .ne. 10) stop 24 + a8 = 0 + if (any (minloc (a8) .ne. 1)) stop 1 + if (any (minloc (a8, back=.false.) .ne. 1)) stop 2 + if (any (minloc (a8, back=.true.) .ne. 10)) stop 3 + if (any (minloc (a8, kind=2) .ne. 1)) stop 4 + if (any (minloc (a8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (a8, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (a8, 1) .ne. 1)) stop 7 + if (any (minloc (a8, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (a8, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (a8, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (a8, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (a8, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (a8, 1, l1) .ne. 1)) stop 13 + if (any (minloc (a8, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (a8, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (a8, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (a8, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (a8, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (a8, 1, l3) .ne. 1)) stop 19 + if (any (minloc (a8, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (a8, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (a8, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (a8, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (a8, 1, l3, 2, .true.) .ne. 10)) stop 24 + b8 = 0 + if (any (minloc (b8) .ne. 1)) stop 1 + if (any (minloc (b8, back=.false.) .ne. 1)) stop 2 + if (any (minloc (b8, back=.true.) .ne. 10)) stop 3 + if (any (minloc (b8, kind=2) .ne. 1)) stop 4 + if (any (minloc (b8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (b8, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (b8, 1) .ne. 1) stop 7 + if (minloc (b8, 1, back=.false.) .ne. 1) stop 8 + if (minloc (b8, 1, back=.true.) .ne. 10) stop 9 + if (minloc (b8, 1, kind=1) .ne. 1) stop 10 + if (minloc (b8, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (b8, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (b8, 1, l2) .ne. 1) stop 13 + if (minloc (b8, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (b8, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (b8, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (b8, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (b8, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (b8, 1, l3) .ne. 1) stop 19 + if (minloc (b8, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (b8, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (b8, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (b8, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (b8, 1, l3, 2, .true.) .ne. 10) stop 24 + r4 = 0.0 + if (any (minloc (r4) .ne. 1)) stop 1 + if (any (minloc (r4, back=.false.) .ne. 1)) stop 2 + if (any (minloc (r4, back=.true.) .ne. 10)) stop 3 + if (any (minloc (r4, kind=2) .ne. 1)) stop 4 + if (any (minloc (r4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (r4, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (r4, 1) .ne. 1)) stop 7 + if (any (minloc (r4, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (r4, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (r4, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (r4, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (r4, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (r4, 1, l1) .ne. 1)) stop 13 + if (any (minloc (r4, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (r4, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (r4, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (r4, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (r4, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (r4, 1, l3) .ne. 1)) stop 19 + if (any (minloc (r4, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (r4, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (r4, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (r4, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (r4, 1, l3, 2, .true.) .ne. 10)) stop 24 + s4 = 0.0 + if (any (minloc (s4) .ne. 1)) stop 1 + if (any (minloc (s4, back=.false.) .ne. 1)) stop 2 + if (any (minloc (s4, back=.true.) .ne. 10)) stop 3 + if (any (minloc (s4, kind=2) .ne. 1)) stop 4 + if (any (minloc (s4, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (s4, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (s4, 1) .ne. 1) stop 7 + if (minloc (s4, 1, back=.false.) .ne. 1) stop 8 + if (minloc (s4, 1, back=.true.) .ne. 10) stop 9 + if (minloc (s4, 1, kind=1) .ne. 1) stop 10 + if (minloc (s4, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (s4, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (s4, 1, l2) .ne. 1) stop 13 + if (minloc (s4, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (s4, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (s4, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (s4, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (s4, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (s4, 1, l3) .ne. 1) stop 19 + if (minloc (s4, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (s4, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (s4, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (s4, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (s4, 1, l3, 2, .true.) .ne. 10) stop 24 + r8 = 0.0 + if (any (minloc (r8) .ne. 1)) stop 1 + if (any (minloc (r8, back=.false.) .ne. 1)) stop 2 + if (any (minloc (r8, back=.true.) .ne. 10)) stop 3 + if (any (minloc (r8, kind=2) .ne. 1)) stop 4 + if (any (minloc (r8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (r8, kind=8, back=.true.) .ne. 10)) stop 6 + if (any (minloc (r8, 1) .ne. 1)) stop 7 + if (any (minloc (r8, 1, back=.false.) .ne. 1)) stop 8 + if (any (minloc (r8, 1, back=.true.) .ne. 10)) stop 9 + if (any (minloc (r8, 1, kind=1) .ne. 1)) stop 10 + if (any (minloc (r8, 1, kind=2, back=.false.) .ne. 1)) stop 11 + if (any (minloc (r8, 1, kind=4, back=.true.) .ne. 10)) stop 12 + if (any (minloc (r8, 1, l1) .ne. 1)) stop 13 + if (any (minloc (r8, 1, l1, back=.false.) .ne. 1)) stop 14 + if (any (minloc (r8, 1, l1, back=.true.) .ne. 10)) stop 15 + if (any (minloc (r8, 1, l1, kind=8) .ne. 1)) stop 16 + if (any (minloc (r8, 1, l1, 4, .false.) .ne. 1)) stop 17 + if (any (minloc (r8, 1, l1, 2, .true.) .ne. 10)) stop 18 + if (any (minloc (r8, 1, l3) .ne. 1)) stop 19 + if (any (minloc (r8, 1, l3, back=.false.) .ne. 1)) stop 20 + if (any (minloc (r8, 1, l3, back=.true.) .ne. 10)) stop 21 + if (any (minloc (r8, 1, l3, kind=8) .ne. 1)) stop 22 + if (any (minloc (r8, 1, l3, 4, .false.) .ne. 1)) stop 23 + if (any (minloc (r8, 1, l3, 2, .true.) .ne. 10)) stop 24 + s8 = 0.0 + if (any (minloc (s8) .ne. 1)) stop 1 + if (any (minloc (s8, back=.false.) .ne. 1)) stop 2 + if (any (minloc (s8, back=.true.) .ne. 10)) stop 3 + if (any (minloc (s8, kind=2) .ne. 1)) stop 4 + if (any (minloc (s8, kind=4, back=.false.) .ne. 1)) stop 5 + if (any (minloc (s8, kind=8, back=.true.) .ne. 10)) stop 6 + if (minloc (s8, 1) .ne. 1) stop 7 + if (minloc (s8, 1, back=.false.) .ne. 1) stop 8 + if (minloc (s8, 1, back=.true.) .ne. 10) stop 9 + if (minloc (s8, 1, kind=1) .ne. 1) stop 10 + if (minloc (s8, 1, kind=2, back=.false.) .ne. 1) stop 11 + if (minloc (s8, 1, kind=4, back=.true.) .ne. 10) stop 12 + if (minloc (s8, 1, l2) .ne. 1) stop 13 + if (minloc (s8, 1, l2, back=.false.) .ne. 1) stop 14 + if (minloc (s8, 1, l2, back=.true.) .ne. 10) stop 15 + if (minloc (s8, 1, l2, kind=8) .ne. 1) stop 16 + if (minloc (s8, 1, l2, 4, .false.) .ne. 1) stop 17 + if (minloc (s8, 1, l2, 2, .true.) .ne. 10) stop 18 + if (minloc (s8, 1, l3) .ne. 1) stop 19 + if (minloc (s8, 1, l3, back=.false.) .ne. 1) stop 20 + if (minloc (s8, 1, l3, back=.true.) .ne. 10) stop 21 + if (minloc (s8, 1, l3, kind=8) .ne. 1) stop 22 + if (minloc (s8, 1, l3, 4, .false.) .ne. 1) stop 23 + if (minloc (s8, 1, l3, 2, .true.) .ne. 10) stop 24 +end diff --git a/gcc/testsuite/gfortran.dg/pr120191_2.f90 b/gcc/testsuite/gfortran.dg/pr120191_2.f90 new file mode 100644 index 0000000..6334286 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120191_2.f90 @@ -0,0 +1,84 @@ +! PR fortran/120191 +! { dg-do run } + + character(kind=1, len=2) :: a(4, 4, 4), b(4) + logical :: l(4, 4, 4), m, n(4) + a = 'aa' + b = 'aa' + l = .true. + m = .true. + n = .true. + if (any (maxloc (a) .ne. 1)) stop 1 + if (any (maxloc (a, dim=1) .ne. 1)) stop 2 + if (any (maxloc (a, 1) .ne. 1)) stop 3 + if (any (maxloc (a, dim=1, mask=l, kind=4, back=.false.) .ne. 1)) stop 4 + if (any (maxloc (a, 1, l, 4, .false.) .ne. 1)) stop 5 + if (any (maxloc (a, dim=1, mask=m, kind=4, back=.false.) .ne. 1)) stop 6 + if (any (maxloc (a, 1, m, 4, .false.) .ne. 1)) stop 7 + if (any (maxloc (a, dim=1, mask=l, kind=4, back=.true.) .ne. 4)) stop 8 + if (any (maxloc (a, 1, l, 4, .true.) .ne. 4)) stop 9 + if (any (maxloc (a, dim=1, mask=m, kind=4, back=.true.) .ne. 4)) stop 10 + if (any (maxloc (a, 1, m, 4, .true.) .ne. 4)) stop 11 + if (any (maxloc (b) .ne. 1)) stop 12 + if (maxloc (b, dim=1) .ne. 1) stop 13 + if (maxloc (b, 1) .ne. 1) stop 14 + if (maxloc (b, dim=1, mask=n, kind=4, back=.false.) .ne. 1) stop 15 + if (maxloc (b, 1, n, 4, .false.) .ne. 1) stop 16 + if (maxloc (b, dim=1, mask=m, kind=4, back=.false.) .ne. 1) stop 17 + if (maxloc (b, 1, m, 4, .false.) .ne. 1) stop 18 + if (maxloc (b, dim=1, mask=n, kind=4, back=.true.) .ne. 4) stop 19 + if (maxloc (b, 1, n, 4, .true.) .ne. 4) stop 20 + if (maxloc (b, dim=1, mask=m, kind=4, back=.true.) .ne. 4) stop 21 + if (maxloc (b, 1, m, 4, .true.) .ne. 4) stop 22 + l = .false. + m = .false. + n = .false. + if (any (maxloc (a, dim=1, mask=l, kind=4, back=.false.) .ne. 0)) stop 23 + if (any (maxloc (a, 1, l, 4, .false.) .ne. 0)) stop 24 + if (maxloc (b, dim=1, mask=n, kind=4, back=.false.) .ne. 0) stop 25 + if (maxloc (b, 1, n, 4, .false.) .ne. 0) stop 26 + if (maxloc (b, dim=1, mask=m, kind=4, back=.false.) .ne. 0) stop 27 + if (maxloc (b, 1, m, 4, .false.) .ne. 0) stop 28 + if (maxloc (b, dim=1, mask=n, kind=4, back=.true.) .ne. 0) stop 29 + if (maxloc (b, 1, n, 4, .true.) .ne. 0) stop 30 + if (maxloc (b, dim=1, mask=m, kind=4, back=.true.) .ne. 0) stop 31 + if (maxloc (b, 1, m, 4, .true.) .ne. 0) stop 32 + l = .true. + m = .true. + n = .true. + if (any (minloc (a) .ne. 1)) stop 1 + if (any (minloc (a, dim=1) .ne. 1)) stop 2 + if (any (minloc (a, 1) .ne. 1)) stop 3 + if (any (minloc (a, dim=1, mask=l, kind=4, back=.false.) .ne. 1)) stop 4 + if (any (minloc (a, 1, l, 4, .false.) .ne. 1)) stop 5 + if (any (minloc (a, dim=1, mask=m, kind=4, back=.false.) .ne. 1)) stop 6 + if (any (minloc (a, 1, m, 4, .false.) .ne. 1)) stop 7 + if (any (minloc (a, dim=1, mask=l, kind=4, back=.true.) .ne. 4)) stop 8 + if (any (minloc (a, 1, l, 4, .true.) .ne. 4)) stop 9 + if (any (minloc (a, dim=1, mask=m, kind=4, back=.true.) .ne. 4)) stop 10 + if (any (minloc (a, 1, m, 4, .true.) .ne. 4)) stop 11 + if (any (minloc (b) .ne. 1)) stop 12 + if (minloc (b, dim=1) .ne. 1) stop 13 + if (minloc (b, 1) .ne. 1) stop 14 + if (minloc (b, dim=1, mask=n, kind=4, back=.false.) .ne. 1) stop 15 + if (minloc (b, 1, n, 4, .false.) .ne. 1) stop 16 + if (minloc (b, dim=1, mask=m, kind=4, back=.false.) .ne. 1) stop 17 + if (minloc (b, 1, m, 4, .false.) .ne. 1) stop 18 + if (minloc (b, dim=1, mask=n, kind=4, back=.true.) .ne. 4) stop 19 + if (minloc (b, 1, n, 4, .true.) .ne. 4) stop 20 + if (minloc (b, dim=1, mask=m, kind=4, back=.true.) .ne. 4) stop 21 + if (minloc (b, 1, m, 4, .true.) .ne. 4) stop 22 + l = .false. + m = .false. + n = .false. + if (any (minloc (a, dim=1, mask=l, kind=4, back=.false.) .ne. 0)) stop 23 + if (any (minloc (a, 1, l, 4, .false.) .ne. 0)) stop 24 + if (minloc (b, dim=1, mask=n, kind=4, back=.false.) .ne. 0) stop 25 + if (minloc (b, 1, n, 4, .false.) .ne. 0) stop 26 + if (minloc (b, dim=1, mask=m, kind=4, back=.false.) .ne. 0) stop 27 + if (minloc (b, 1, m, 4, .false.) .ne. 0) stop 28 + if (minloc (b, dim=1, mask=n, kind=4, back=.true.) .ne. 0) stop 29 + if (minloc (b, 1, n, 4, .true.) .ne. 0) stop 30 + if (minloc (b, dim=1, mask=m, kind=4, back=.true.) .ne. 0) stop 31 + if (minloc (b, 1, m, 4, .true.) .ne. 0) stop 32 +end diff --git a/gcc/testsuite/gfortran.dg/pr120191_3.f90 b/gcc/testsuite/gfortran.dg/pr120191_3.f90 new file mode 100644 index 0000000..26e4095 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120191_3.f90 @@ -0,0 +1,23 @@ +! PR fortran/120191 +! { dg-do run } + + character(kind=1, len=2) :: a(4, 4, 4), b(4) + logical :: l(4, 4, 4), m, n(4) + a = 'aa' + b = 'aa' + l = .false. + m = .false. + n = .false. + if (any (maxloc (a, dim=1, mask=m, kind=4, back=.false.) .ne. 0)) stop 1 + if (any (maxloc (a, 1, m, 4, .false.) .ne. 0)) stop 2 + if (any (maxloc (a, dim=1, mask=l, kind=4, back=.true.) .ne. 0)) stop 3 + if (any (maxloc (a, 1, l, 4, .true.) .ne. 0)) stop 4 + if (any (maxloc (a, dim=1, mask=m, kind=4, back=.true.) .ne. 0)) stop 5 + if (any (maxloc (a, 1, m, 4, .true.) .ne. 0)) stop 6 + if (any (minloc (a, dim=1, mask=m, kind=4, back=.false.) .ne. 0)) stop 7 + if (any (minloc (a, 1, m, 4, .false.) .ne. 0)) stop 8 + if (any (minloc (a, dim=1, mask=l, kind=4, back=.true.) .ne. 0)) stop 9 + if (any (minloc (a, 1, l, 4, .true.) .ne. 0)) stop 10 + if (any (minloc (a, dim=1, mask=m, kind=4, back=.true.) .ne. 0)) stop 11 + if (any (minloc (a, 1, m, 4, .true.) .ne. 0)) stop 12 +end diff --git a/gcc/testsuite/gfortran.dg/pr120196.f90 b/gcc/testsuite/gfortran.dg/pr120196.f90 new file mode 100644 index 0000000..368c43a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr120196.f90 @@ -0,0 +1,26 @@ +! PR libfortran/120196 +! { dg-do run } + +program pr120196 + character(len=:, kind=1), allocatable :: a(:), s + character(len=:, kind=4), allocatable :: b(:), t + logical, allocatable :: l(:) + logical :: m + allocate (character(len=16, kind=1) :: a(10), s) + allocate (l(10)) + a(:) = "" + s = "*" + l = .true. + m = .true. + if (findloc (a, s, dim=1, back=.true.) .ne. 0) stop 1 + if (findloc (a, s, mask=l, dim=1, back=.true.) .ne. 0) stop 2 + if (findloc (a, s, mask=m, dim=1, back=.true.) .ne. 0) stop 3 + deallocate (a, s) + allocate (character(len=16, kind=4) :: b(10), t) + b(:) = "" + t = "*" + if (findloc (b, t, dim=1, back=.true.) .ne. 0) stop 4 + if (findloc (b, t, mask=l, dim=1, back=.true.) .ne. 0) stop 5 + if (findloc (b, t, mask=m, dim=1, back=.true.) .ne. 0) stop 6 + deallocate (b, t, l) +end program pr120196 diff --git a/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/assignvalue.mod b/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/assignvalue.mod new file mode 100644 index 0000000..56eb0bb --- /dev/null +++ b/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/assignvalue.mod @@ -0,0 +1,25 @@ +(* { dg-do compile } *) +(* { dg-options "-fsoft-check-all -fm2-plugin" } *) +(* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } *) + +MODULE assignvalue ; (*!m2iso+gm2*) + +PROCEDURE bad () : INTEGER ; +VAR + i: INTEGER ; +BEGIN + i := -1 ; + RETURN i +END bad ; + +VAR + foo: CARDINAL ; +BEGIN + (* The m2rte plugin will detect this as an error, post + optimization. *) + foo := bad () (* { dg-error "error: In program module assignvalue" } *) + (* { dg-begin-multiline-output "" } +runtime error will occur, assignment will cause a range error, as the runtime instance value of 'CARDINAL' does not overlap with the type 'INTEGER' + { dg-end-multiline-output "" } *) + +END assignvalue. diff --git a/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp b/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp new file mode 100644 index 0000000..6ddf2d5 --- /dev/null +++ b/gcc/testsuite/gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp @@ -0,0 +1,25 @@ +# Compile tests, no torture testing. +# +# These tests should all generate errors if the plugin is available. + +# Load support procs. +load_lib gm2-dg.exp + +gm2_init_pim4 $srcdir/$subdir + +# Initialize `dg'. +dg-init + +# If the --enable-plugin has not been enabled during configure, bail. +if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { + return +} + +# Main loop. + +set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] + +gm2-dg-runtest $tests "" "" + +# All done. +dg-finish diff --git a/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod b/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod new file mode 100644 index 0000000..cbcc804 --- /dev/null +++ b/gcc/testsuite/gm2/pim/fail/constintarraybyte.mod @@ -0,0 +1,10 @@ +MODULE constintarraybyte ; + +FROM FormatStrings IMPORT Sprintf1 ; +FROM DynamicStrings IMPORT String, InitString ; + +VAR + s: String ; +BEGIN + s := Sprintf1 (InitString("abc%x\n"), 42) +END constintarraybyte. diff --git a/gcc/testsuite/gm2/pim/pass/highbit.mod b/gcc/testsuite/gm2/pim/pass/highbit.mod new file mode 100644 index 0000000..c9c872a --- /dev/null +++ b/gcc/testsuite/gm2/pim/pass/highbit.mod @@ -0,0 +1,13 @@ +MODULE highbit ; + +FROM libc IMPORT printf ; + +TYPE + set = BITSET ; + +CONST + HighBit = MAX (set) ; + +BEGIN + printf ("the MAX (set) = %d\n", HighBit) +END highbit. diff --git a/gcc/testsuite/gm2/pim/pass/highbit2.mod b/gcc/testsuite/gm2/pim/pass/highbit2.mod new file mode 100644 index 0000000..940556d --- /dev/null +++ b/gcc/testsuite/gm2/pim/pass/highbit2.mod @@ -0,0 +1,13 @@ +MODULE highbit2 ; + +FROM libc IMPORT printf ; + +TYPE + set = BITSET ; + +CONST + HighBit = MAX (BITSET) ; + +BEGIN + printf ("the MAX (BITSET) = %d\n", HighBit) +END highbit2. diff --git a/gcc/testsuite/gm2/pimlib/run/pass/format2.mod b/gcc/testsuite/gm2/pimlib/run/pass/format2.mod new file mode 100644 index 0000000..2ad6a8c --- /dev/null +++ b/gcc/testsuite/gm2/pimlib/run/pass/format2.mod @@ -0,0 +1,63 @@ +MODULE format2; + +FROM libc IMPORT exit, printf ; +FROM Terminal IMPORT Write, WriteLn; +FROM NumberIO IMPORT WriteCard; +FROM DynamicStrings IMPORT String, Length, char, InitString; +FROM FormatStrings IMPORT Sprintf1; + +PROCEDURE WriteString (s: String); +VAR + l, i: CARDINAL; +BEGIN + l := Length (s) ; + i := 0 ; + WHILE i < l DO + Write (char (s, i)) ; + INC (i) + END +END WriteString; + + +(* + assert - +*) + +PROCEDURE assert (cond: BOOLEAN; line: CARDINAL; file: ARRAY OF CHAR) ; +BEGIN + IF NOT cond + THEN + printf ("%s:%d assertion failed\n", file, line); + exit (1) + END +END assert ; + + +VAR + n: CARDINAL; + r, s: String; +BEGIN + n := 2; + r := InitString("%u pieces of cake") ; + WriteString (r) ; WriteLn ; + assert (Length (r) = 17, __LINE__, __FILE__) ; + s := Sprintf1 (r, n) ; + WriteCard (Length (s), 4) ; WriteLn ; + assert (Length (s) = 16, __LINE__, __FILE__) ; + + r := InitString("%d pieces of cake") ; + WriteString (r) ; WriteLn ; + assert (Length (r) = 17, __LINE__, __FILE__) ; + s := Sprintf1 (r, n) ; + WriteCard (Length (s), 4) ; WriteLn ; + assert (Length (s) = 16, __LINE__, __FILE__) ; + + r := InitString("%x pieces of cake") ; + WriteString (r) ; WriteLn ; + assert (Length (r) = 17, __LINE__, __FILE__) ; + s := Sprintf1 (r, n) ; + WriteCard (Length (s), 4) ; WriteLn ; + assert (Length (s) = 16, __LINE__, __FILE__) ; + + WriteString (InitString ('all tests pass')) ; WriteLn ; +END format2. diff --git a/gcc/testsuite/lib/gm2-dg.exp b/gcc/testsuite/lib/gm2-dg.exp index eaed554..5a36507 100644 --- a/gcc/testsuite/lib/gm2-dg.exp +++ b/gcc/testsuite/lib/gm2-dg.exp @@ -65,7 +65,7 @@ proc gm2-dg-runtest { testcases flags default-extra-flags } { if [expr [search_for $test "dg-do run"]] { set option_list $TORTURE_OPTIONS } else { - set option_list [list { -O } ] + set option_list [list { -O -O2 } ] } set nshort [file tail [file dirname $test]]/[file tail $test] @@ -77,3 +77,38 @@ proc gm2-dg-runtest { testcases flags default-extra-flags } { } } + +# Check if frontend has been configured with option. +# This checks a configure build option was used and not +# the availability of a compiler command line option. + +proc gm2-dg-frontend-configure-check { option } { + global GCC_UNDER_TEST + + # ignore any arguments after the command + set compiler [lindex $GCC_UNDER_TEST 0] + + if ![is_remote host] { + set compiler_name [which $compiler] + } else { + set compiler_name $compiler + } + + # verify that the compiler exists + if { $compiler_name != 0 } then { + set tmp [remote_exec host "$compiler -v"] + set status [lindex $tmp 0] + set output [lindex $tmp 1] + regexp "Configured with.*\[\n\r\]" $output config + set option "*${option}*" + if { [string match $option $config] } { + return 1 + } else { + return 0 + } + } else { + # compiler does not exist (this should have already been detected) + warning "$compiler does not exist" + return 0 + } +} diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog index 6af4190..f528d23 100644 --- a/libcpp/po/ChangeLog +++ b/libcpp/po/ChangeLog @@ -1,3 +1,19 @@ +2025-05-16 Joseph Myers <josmyers@redhat.com> + + * es.po: Update. + +2025-05-15 Joseph Myers <josmyers@redhat.com> + + * zh_CN.po: Update. + +2025-05-14 Joseph Myers <josmyers@redhat.com> + + * es.po: Update. + +2025-05-12 Joseph Myers <josmyers@redhat.com> + + * es.po: Update. + 2025-04-25 Release Manager * GCC 15.1.0 released. diff --git a/libcpp/po/es.po b/libcpp/po/es.po index 4948e7a..65207a8 100644 --- a/libcpp/po/es.po +++ b/libcpp/po/es.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: cpplib 15.1-b20250316\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2025-03-14 22:05+0000\n" -"PO-Revision-Date: 2025-05-12 11:20-0600\n" +"PO-Revision-Date: 2025-05-16 12:16-0600\n" "Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n" "Language-Team: Spanish <es@tp.org.es>\n" "Language: es\n" @@ -58,7 +58,7 @@ msgstr "los nombres universales de carácter de C99 son incompatibles con C90" #: charset.cc:1556 #, gcc-internal-format msgid "the meaning of %<\\%c%> is different in traditional C" -msgstr "el significado de <\\%c> es diferente en C tradicional" +msgstr "el significado de %<\\%c%> es diferente en C tradicional" #: charset.cc:1595 #, gcc-internal-format @@ -95,7 +95,7 @@ msgstr "¿Quiso decir %<\\N{%s}%>?" #: charset.cc:1693 #, gcc-internal-format msgid "%<\\N{%> not terminated with %<}%> after %.*s; treating it as separate tokens" -msgstr "%<\\N{%> no termina con %<}%> después de %.*s; se trata como elemntos separados" +msgstr "%<\\N{%> no termina con %<}%> después de %.*s; se trata como elementos separados" #: charset.cc:1702 #, gcc-internal-format @@ -204,7 +204,7 @@ msgstr "%<\\x{%> no termina con %<}%> después de %.*s" #: charset.cc:2204 msgid "hex escape sequence out of range" -msgstr "secuencia de escape hexadecimal fuera de rango" +msgstr "secuencia de escape hexadecimal fuera de intervalo" #: charset.cc:2247 #, gcc-internal-format @@ -218,7 +218,7 @@ msgstr "%<\\o{%> no termina con %<}%> después de %.*s" #: charset.cc:2314 msgid "octal escape sequence out of range" -msgstr "secuencia de escape octal fuera de rango" +msgstr "secuencia de escape octal fuera de intervalo" #: charset.cc:2366 charset.cc:2376 #, gcc-internal-format @@ -247,11 +247,11 @@ msgstr "secuencia de escape desconocida: %<\\%s%>" #: charset.cc:2436 msgid "converting escape sequence to execution character set" -msgstr "se convierte una secuencia de escape al conjunto de caracteres de ejecución" +msgstr "se convierte la secuencia de escape al conjunto de caracteres de ejecución" #: charset.cc:2576 msgid "missing open quote" -msgstr "falta comilla abierta" +msgstr "falta comilla al inicio" #: charset.cc:2807 msgid "character not encodable in a single execution character code unit" @@ -373,7 +373,7 @@ msgstr "los nombres de macro deben ser identificadores" #: directives.cc:743 directives.cc:747 #, gcc-internal-format msgid "undefining %qs" -msgstr "borrando la definición de %qs" +msgstr "se borra la definición de %qs" #: directives.cc:805 #, gcc-internal-format @@ -383,7 +383,7 @@ msgstr "falta el carácter de terminación %<>%>" #: directives.cc:865 #, gcc-internal-format msgid "%<#%s%> expects %<\"FILENAME\"%> or %<<FILENAME>%>" -msgstr "%<#%s$> espera %<«NOMBREFICHERO»%> o %<<NOMBREFICHERO>%>" +msgstr "%<#%s$> espera %<\"NOMBREFICHERO\"%> o %<<NOMBREFICHERO>%>" #: directives.cc:911 directives.cc:1391 #, gcc-internal-format, gfc-internal-format @@ -398,7 +398,7 @@ msgstr "la profundidad anidada %u de %<#include%> excede el máximo de %u (utili #: directives.cc:965 #, gcc-internal-format msgid "%<#include_next%> in primary source file" -msgstr "%<#include_next%> en fichero primario de código fuente" +msgstr "%<#include_next%> en fichero de código fuente primario" #: directives.cc:1037 directives.cc:1059 directives.cc:1062 directives.cc:1065 #, gcc-internal-format, gfc-internal-format @@ -447,7 +447,7 @@ msgstr "se esperaba %<(%>" #: directives.cc:1269 #, gcc-internal-format msgid "too large %<gnu::offset%> argument" -msgstr "argumento %<gnu::offset%> demasiado grande" +msgstr "el argumento %<gnu::offset%> es demasiado grande" #: directives.cc:1316 msgid "expected character string literal" @@ -485,7 +485,7 @@ msgstr "%qs después de %<#line%> no es un entero positivo" #: directives.cc:1513 directives.cc:1516 msgid "line number out of range" -msgstr "número de línea fuera de rango" +msgstr "número de línea fuera de intervalo" #: directives.cc:1529 directives.cc:1610 #, gcc-internal-format @@ -682,7 +682,7 @@ msgstr "uso de una constante de coma flotante hexadecimal C99" #: expr.cc:789 #, gcc-internal-format msgid "invalid suffix %<%.*s%> on floating constant" -msgstr "sufijo %<%.*s%> inválido en la constante de coma flotante" +msgstr "sufijo %<%.*s%> inválido en una constante de coma flotante" #: expr.cc:800 expr.cc:870 #, gcc-internal-format @@ -696,7 +696,7 @@ msgstr "el sufijo para una constante doble es una extensión GCC" #: expr.cc:815 #, gcc-internal-format msgid "invalid suffix %<%.*s%> with hexadecimal floating constant" -msgstr "sufijo %<%.*s%> inválido en la constante de coma flotante hexadecimal" +msgstr "sufijo %<%.*s%> inválido en una constante de coma flotante hexadecimal" #: expr.cc:829 expr.cc:833 msgid "decimal floating constants are a C23 feature" @@ -705,7 +705,7 @@ msgstr "las constantes de coma flotante decimal son una característica de C23" #: expr.cc:853 #, gcc-internal-format msgid "invalid suffix %<%.*s%> on integer constant" -msgstr "sufijo %<%.*s%> inválido en la constante entera" +msgstr "sufijo %<%.*s%> inválido en una constante entera" #: expr.cc:878 msgid "use of C++11 long long integer constant" @@ -744,7 +744,7 @@ msgstr "las constantes imaginarias son una característica de C2Y" #: expr.cc:956 msgid "binary constants are a C++14 feature or GCC extension" -msgstr "las constantes binarias son una característica C++14 o una extensión de GCC" +msgstr "las constantes binarias son una característica de C++14 o una extensión de GCC" #: expr.cc:961 msgid "binary constants are a C23 feature or GCC extension" @@ -838,7 +838,7 @@ msgstr "operando de parámetro imbuído demasiado grande" #: expr.cc:1658 #, gcc-internal-format, gfc-internal-format msgid "impossible operator '%u'" -msgstr "operador '%u' imposible" +msgstr "operador «%u» imposible" #: expr.cc:1759 #, gcc-internal-format @@ -852,7 +852,7 @@ msgstr "%<?%> sin %<:%> a continuación" #: expr.cc:1798 msgid "integer overflow in preprocessor expression" -msgstr "desbordamiento entero en expresión del preprocesador" +msgstr "desbordamiento entero en una expresión del preprocesador" #: expr.cc:1803 #, gcc-internal-format @@ -871,7 +871,7 @@ msgstr "el operando derecho de %qs cambia de signo cuando es promovido" #: expr.cc:2099 msgid "traditional C rejects the unary plus operator" -msgstr "C tradicional rechaza el operador unario mas" +msgstr "C tradicional rechaza el operador unario más" #: expr.cc:2197 #, gcc-internal-format, gfc-internal-format @@ -890,7 +890,7 @@ msgstr "directorio NULL en %<find_file%>" #: files.cc:603 msgid "one or more PCH files were found, but they were invalid" -msgstr "se encontró uno o más ficheros PCH, pero eran inválidos" +msgstr "se encontraron uno o más ficheros PCH, pero eran inválidos" #: files.cc:607 #, gcc-internal-format @@ -934,7 +934,7 @@ msgstr "Guardias múltiples de include pueden ser útiles para:\n" #: files.cc:2306 #, gcc-internal-format msgid "header guard %qs followed by %<#define%> of a different macro" -msgstr "guarda de encabezado %qs seguida por %<#define%> de un macro diferente" +msgstr "guarda de cabecera %qs seguida por %<#define%> de un macro diferente" #: files.cc:2310 #, gcc-internal-format @@ -954,7 +954,7 @@ msgstr "la aritmética del preprocesador tiene una precisión máxima de %lu bit #: init.cc:687 #, gcc-internal-format msgid "CPP arithmetic must be at least as precise as a target %<int%>" -msgstr "la aritmética de CPP debe se al menos tan precisa como un %<int%> del objetivo" +msgstr "la aritmética de CPP debe ser al menos tan precisa como un %<int%> del objetivo" #: init.cc:691 #, gcc-internal-format @@ -1111,7 +1111,7 @@ msgstr "%<__VA_OPT__%> solamente puede aparecer en la expansión de una macro va #: lex.cc:2186 #, gcc-internal-format msgid "attempt to use poisoned %qs" -msgstr "intento de utilizar %qs envenenado" +msgstr "se intenta usar %qs envenenado" #: lex.cc:2191 msgid "poisoned here" @@ -1151,7 +1151,7 @@ msgstr "carácter inválido nueva línea en un delimitador de cadena cruda" #: lex.cc:2731 lex.cc:5671 #, gcc-internal-format, gfc-internal-format msgid "invalid character '%c' in raw string delimiter" -msgstr "carácter inválido '%c' en un delimitador de cadena cruda" +msgstr "carácter inválido «%c» en un delimitador de cadena cruda" #: lex.cc:2770 lex.cc:2793 msgid "unterminated raw string" @@ -1168,7 +1168,7 @@ msgstr "falta el carácter de terminación %c" #: lex.cc:2986 msgid "C++11 requires a space between string literal and macro" -msgstr "C++11 requiere un espacio entre cadena literal y macro" +msgstr "C++11 requiere un espacio entre una cadena literal y un macro" #: lex.cc:3579 msgid "module control-line cannot be in included file" @@ -1177,7 +1177,7 @@ msgstr "la línea de control del módulo no puede estar en un fichero incluido" #: lex.cc:3593 #, gcc-internal-format msgid "module control-line %qs cannot be an object-like macro" -msgstr "la línea de control del módulo %qs no puede ser una macro de tipo objeto" +msgstr "la línea de control del módulo %qs no puede ser un macro de tipo objeto" #: lex.cc:3631 #, gcc-internal-format @@ -1187,7 +1187,7 @@ msgstr "el nombre de módulo %qs no puede ser una macro de tipo objeto" #: lex.cc:3637 #, gcc-internal-format msgid "module partition %qs cannot be an object-like macro" -msgstr "la partición de módulo %qs no puede ser una macro de tipo objeto" +msgstr "la partición de módulo %qs no puede ser un macro de tipo objeto" #: lex.cc:3658 #, gcc-internal-format @@ -1290,7 +1290,7 @@ msgstr "macro interna %qs inválida" #: macro.cc:579 macro.cc:687 #, gcc-internal-format msgid "macro %qs might prevent reproducible builds" -msgstr "macro %qs quizá previene compilaciones reproducibles" +msgstr "el macro %qs quizá previene compilaciones reproducibles" #: macro.cc:610 msgid "could not determine file timestamp" @@ -1401,7 +1401,7 @@ msgstr "se esperaba %<)%> después de %<...%>" #: macro.cc:3624 msgid "anonymous variadic macros were introduced in C++11" -msgstr "las macros variadic anónimas se introdujeron en C++11" +msgstr "los macros variadic anónimos se introdujeron en C++11" #: macro.cc:3625 macro.cc:3629 msgid "anonymous variadic macros were introduced in C99" @@ -1440,7 +1440,7 @@ msgstr "%<#%> no es seguido por un parámetro de macro" #: macro.cc:3961 #, gcc-internal-format msgid "%qs redefined" -msgstr "%qs redefinido" +msgstr "se redefine %qs" #: macro.cc:3965 msgid "this is the location of the previous definition" @@ -1453,7 +1453,7 @@ msgstr "el argumento de macro %qs debería ser convertido a cadena en C tradicio #: pch.cc:90 pch.cc:342 pch.cc:356 pch.cc:374 pch.cc:380 pch.cc:389 pch.cc:396 msgid "while writing precompiled header" -msgstr "al escribir el encabezado precompilado" +msgstr "al escribir la cabecera precompilada" #: pch.cc:616 #, gcc-internal-format @@ -1482,7 +1482,7 @@ msgstr "%s: no se usa porque %<__COUNTER__%> es inválido" #: pch.cc:722 pch.cc:885 msgid "while reading precompiled header" -msgstr "al leer el encabezado precompilado" +msgstr "al leer la cabecera precompilada" #: traditional.cc:891 #, gcc-internal-format @@ -1523,7 +1523,7 @@ msgstr "error de sintaxis en la lista de parámetros de macro" #~ msgstr "#include anidado con demasiada profundidad" #~ msgid "missing ')' after \"__has_include__\"" -#~ msgstr "falta ')' tras \"__has_include__\"" +#~ msgstr "falta ')' después de \"__has_include__\"" #~ msgid "\"%s\" may not appear in macro parameter list" #~ msgstr "«%s» podría faltar en la lista de parámetro de macro" diff --git a/libcpp/po/zh_CN.po b/libcpp/po/zh_CN.po index 467575b..2262520 100644 --- a/libcpp/po/zh_CN.po +++ b/libcpp/po/zh_CN.po @@ -2,22 +2,24 @@ # Copyright (C) 2005 Free Software Foundation, Inc. # This file is distributed under the same license as the gcc package. # Meng Jie <zuxy.meng@gmail.com>, 2005-2010. +# Boyuan Yang <073plan@gmail.com>, 2025. +# Anbang LI <anbangli@foxmail.com>, 2025. # Zhanhaoxiang Zhang <zzhx2006@outlook.com>, 2024, 2025. # msgid "" msgstr "" -"Project-Id-Version: cpplib 15-b20250216\n" +"Project-Id-Version: cpplib 15.1-b20250316\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2025-03-14 22:05+0000\n" -"PO-Revision-Date: 2025-02-20 18:32+0800\n" -"Last-Translator: Zhanhaoxiang Zhang <zzhx2006@outlook.com>\n" +"PO-Revision-Date: 2025-05-15 12:47-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.5\n" +"X-Generator: Poedit 3.6\n" #: charset.cc:759 #, gcc-internal-format, gfc-internal-format @@ -49,12 +51,12 @@ msgstr "字符 0x%lx 在执行字符集中不是单字节的" #: charset.cc:1549 msgid "universal character names are only valid in C++ and C99" -msgstr "Unicode 字符名只在 C++ 和 C99 中有效" +msgstr "通用字符名只在 C++ 和 C99 中有效" #: charset.cc:1553 #, gcc-internal-format msgid "C99%'s universal character names are incompatible with C90" -msgstr "C99 的 Unicode 字符名与 C90 不兼容" +msgstr "C99 的通用字符名与 C90 不兼容" #: charset.cc:1556 #, gcc-internal-format @@ -64,29 +66,29 @@ msgstr "%<\\%c%> 的意义与在传统 C 中不同" #: charset.cc:1595 #, gcc-internal-format msgid "%<\\N%> not followed by %<{%>" -msgstr "%<\\N%> 后没有 %<{%>" +msgstr "%<\\N%> 后面没有 %<{%>" #: charset.cc:1625 msgid "empty named universal character escape sequence; treating it as separate tokens" -msgstr "空的命名 Unicode 字符转义序列;将其视为独立 token 处理" +msgstr "空命名通用字符转义序列; 将其视为单独的词元" #: charset.cc:1632 msgid "empty named universal character escape sequence" -msgstr "空的命名 Unicode 字符转义序列" +msgstr "空的命名通用字符转义序列" #: charset.cc:1639 msgid "named universal character escapes are only valid in C++23" -msgstr "命名 Unicode 字符转义序列(named universal character escapes)仅在 C++23 中有效" +msgstr "命名通用字符转义仅在 C++23 中有效" #: charset.cc:1659 #, gcc-internal-format msgid "%<\\N{%.*s}%> is not a valid universal character; treating it as separate tokens" -msgstr "%<\\N{%.*s}%> 不是一个有效的 Unicode 字符;将其视为独立 token 处理" +msgstr "%<\\N{%.*s}%> 不是有效的通用字符; 将其视为独立的词元" #: charset.cc:1665 #, gcc-internal-format msgid "%<\\N{%.*s}%> is not a valid universal character" -msgstr "%<\\N{%.*s}%> 不是一个有效的 Unicode 字符" +msgstr "%<\\N{%.*s}%> 不是一个有效的通用字符" #: charset.cc:1675 #, gcc-internal-format @@ -96,7 +98,7 @@ msgstr "你是说 %<\\N{%s}%> 吗?" #: charset.cc:1693 #, gcc-internal-format msgid "%<\\N{%> not terminated with %<}%> after %.*s; treating it as separate tokens" -msgstr "在 %.*s 之后 %<\\N{%> 未以 %<}%> 结束;将其视为独立 token 处理" +msgstr "在 %.*s 之后 %<\\N{%> 未以 %<}%> 结束;将其视为独立词元" #: charset.cc:1702 #, gcc-internal-format @@ -110,7 +112,7 @@ msgstr "在 %<_cpp_valid_ucn%> 中但不是一个 UCN" #: charset.cc:1753 msgid "empty delimited escape sequence; treating it as separate tokens" -msgstr "空的带分隔符的转义序列;将其视为独立 token 处理" +msgstr "空的带分隔符的转义序列;将其视为独立词元" #: charset.cc:1760 charset.cc:2163 charset.cc:2280 msgid "empty delimited escape sequence" @@ -128,12 +130,12 @@ msgstr "带分隔符的转义序列仅在 C2Y 中有效" #: charset.cc:1794 #, gcc-internal-format msgid "%<\\u{%> not terminated with %<}%> after %.*s; treating it as separate tokens" -msgstr "在 %.*s 之后 %<\\u{%> 未以 %<}%> 结束;将其视为独立 token 处理" +msgstr "在 %.*s 之后 %<\\u{%> 未以 %<}%> 结束;将其视为独立词元" #: charset.cc:1806 #, gcc-internal-format msgid "incomplete universal character name %.*s" -msgstr "不完全的 Unicode 字符名 %.*s" +msgstr "不完整的通用字符名 %.*s" #: charset.cc:1810 #, gcc-internal-format @@ -143,12 +145,12 @@ msgstr "在 %.*s 之后 %<\\u{%> 未以 %<}%> 结束" #: charset.cc:1818 #, gcc-internal-format msgid "%.*s is not a valid universal character" -msgstr "%.*s 不是一个有效的 Unicode 字符" +msgstr "%.*s 不是一个有效的通用字符" #: charset.cc:1834 charset.cc:1838 #, gcc-internal-format msgid "%.*s is not a valid universal character name before C23" -msgstr "在C23之前,%.*s 不是一个有效的 Unicode 字符名" +msgstr "在C23之前,%.*s 不是一个有效的通用字符名" #: charset.cc:1854 lex.cc:2096 #, gcc-internal-format @@ -158,17 +160,17 @@ msgstr "%<$%> 出现在标识符或数字中" #: charset.cc:1864 #, gcc-internal-format msgid "universal character %.*s is not valid in an identifier" -msgstr "Unicode 字符 %.*s 在标识符中无效" +msgstr "通用字符 %.*s 在标识符中无效" #: charset.cc:1868 #, gcc-internal-format msgid "universal character %.*s is not valid at the start of an identifier" -msgstr "Unicode 字符 %.*s 在标识符开头无效" +msgstr "通用字符 %.*s 在标识符开头无效" #: charset.cc:1875 #, gcc-internal-format msgid "%.*s is outside the UCS codespace" -msgstr "%.*s 超出了 UCS 码空间" +msgstr "%.*s 在 UCS 码空间之外" #: charset.cc:1919 charset.cc:3072 msgid "converting UCN to source character set" @@ -186,7 +188,7 @@ msgstr "扩展字符 %.*s 在标识符中无效" #: charset.cc:2007 #, gcc-internal-format msgid "extended character %.*s is not valid at the start of an identifier" -msgstr "扩展字符 %.*s 在标识符开头无效" +msgstr "扩展字符 %.*s 在标识符的开头无效" #: charset.cc:2129 #, gcc-internal-format @@ -208,10 +210,9 @@ msgid "hex escape sequence out of range" msgstr "16 进制转义序列越界" #: charset.cc:2247 -#, fuzzy, gcc-internal-format -#| msgid "%<\\o%> not followed by %<}%>" +#, gcc-internal-format msgid "%<\\o%> not followed by %<{%>" -msgstr "%<\\o%> 后没有 %<}%>" +msgstr "%<\\o%> 后面没有 %<{%>" #: charset.cc:2305 #, gcc-internal-format @@ -461,16 +462,14 @@ msgid "%<#embed%> not supported in traditional C" msgstr "在传统C中不支持 %<#embed%>" #: directives.cc:1370 -#, fuzzy, gcc-internal-format -#| msgid "%<#%s%> before C++23 is a GCC extension" +#, gcc-internal-format msgid "%<#%s%> before C++26 is a GCC extension" -msgstr "%<#%s%> 在C++23以前是一个 GCC 扩展" +msgstr "%<#%s%> 在 C++26 以前是一个 GCC 扩展" #: directives.cc:1379 -#, fuzzy, gcc-internal-format -#| msgid "%<#%s%> is a GCC extension" +#, gcc-internal-format msgid "%<#%s%> is a C23 feature" -msgstr "%<#%s%> 是一个 GCC 扩展" +msgstr "%<#%s%> 是一个 C23 特性" #: directives.cc:1436 #, gcc-internal-format diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 6749781..3187863 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,57 @@ +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR libfortran/120196 + * m4/ifindloc2.m4 (header1, header2): For back use i > 0 rather than + i >= 0 as for condition. + * generated/findloc2_s1.c: Regenerate. + * generated/findloc2_s4.c: Regenerate. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/120191 + * m4/ifunction-s.m4 (SCALAR_ARRAY_FUNCTION): Don't multiply + GFC_DESCRIPTOR_EXTENT(array,) by string_len. + * generated/maxloc1_4_s1.c: Regenerate. + * generated/maxloc1_4_s4.c: Regenerate. + * generated/maxloc1_8_s1.c: Regenerate. + * generated/maxloc1_8_s4.c: Regenerate. + * generated/maxloc1_16_s1.c: Regenerate. + * generated/maxloc1_16_s4.c: Regenerate. + * generated/minloc1_4_s1.c: Regenerate. + * generated/minloc1_4_s4.c: Regenerate. + * generated/minloc1_8_s1.c: Regenerate. + * generated/minloc1_8_s4.c: Regenerate. + * generated/minloc1_16_s1.c: Regenerate. + * generated/minloc1_16_s4.c: Regenerate. + +2025-05-13 Jakub Jelinek <jakub@redhat.com> + + Backported from master: + 2025-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/120191 + * m4/maxloc2s.m4: For smaxloc2 call maxloc2 if mask is NULL or *mask. + Swap back and len arguments. + * m4/minloc2s.m4: Likewise. + * generated/maxloc2_4_s1.c: Regenerate. + * generated/maxloc2_4_s4.c: Regenerate. + * generated/maxloc2_8_s1.c: Regenerate. + * generated/maxloc2_8_s4.c: Regenerate. + * generated/maxloc2_16_s1.c: Regenerate. + * generated/maxloc2_16_s4.c: Regenerate. + * generated/minloc2_4_s1.c: Regenerate. + * generated/minloc2_4_s4.c: Regenerate. + * generated/minloc2_8_s1.c: Regenerate. + * generated/minloc2_8_s4.c: Regenerate. + * generated/minloc2_16_s1.c: Regenerate. + * generated/minloc2_16_s4.c: Regenerate. + 2025-05-08 Jakub Jelinek <jakub@redhat.com> Backported from master: diff --git a/libgfortran/generated/findloc2_s1.c b/libgfortran/generated/findloc2_s1.c index 0dcfcc5..eeea821 100644 --- a/libgfortran/generated/findloc2_s1.c +++ b/libgfortran/generated/findloc2_s1.c @@ -49,7 +49,7 @@ findloc2_s1 (gfc_array_s1 * const restrict array, const GFC_UINTEGER_1 * restric if (back) { src = array->base_addr + (extent - 1) * sstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if (compare_string (len_array, (char *) src, len_value, (char *) value) == 0) return i; @@ -112,7 +112,7 @@ mfindloc2_s1 (gfc_array_s1 * const restrict array, { src = array->base_addr + (extent - 1) * sstride; mbase += (extent - 1) * mstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if (*mbase && (compare_string (len_array, (char *) src, len_value, (char *) value) == 0)) return i; diff --git a/libgfortran/generated/findloc2_s4.c b/libgfortran/generated/findloc2_s4.c index 3ac0d00..a336e34 100644 --- a/libgfortran/generated/findloc2_s4.c +++ b/libgfortran/generated/findloc2_s4.c @@ -49,7 +49,7 @@ findloc2_s4 (gfc_array_s4 * const restrict array, const GFC_UINTEGER_4 * restric if (back) { src = array->base_addr + (extent - 1) * sstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if (compare_string_char4 (len_array, src, len_value, value) == 0) return i; @@ -112,7 +112,7 @@ mfindloc2_s4 (gfc_array_s4 * const restrict array, { src = array->base_addr + (extent - 1) * sstride; mbase += (extent - 1) * mstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if (*mbase && (compare_string_char4 (len_array, src, len_value, value) == 0)) return i; diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c index cbab817..21ea81a 100644 --- a/libgfortran/generated/maxloc1_16_s1.c +++ b/libgfortran/generated/maxloc1_16_s1.c @@ -457,7 +457,7 @@ smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c index d7d8893..47e14c1 100644 --- a/libgfortran/generated/maxloc1_16_s4.c +++ b/libgfortran/generated/maxloc1_16_s4.c @@ -457,7 +457,7 @@ smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c index 51740ee..66ee8d0 100644 --- a/libgfortran/generated/maxloc1_4_s1.c +++ b/libgfortran/generated/maxloc1_4_s1.c @@ -457,7 +457,7 @@ smaxloc1_4_s1 (gfc_array_i4 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_4_s1 (gfc_array_i4 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c index cf04d6d..7d889c0 100644 --- a/libgfortran/generated/maxloc1_4_s4.c +++ b/libgfortran/generated/maxloc1_4_s4.c @@ -457,7 +457,7 @@ smaxloc1_4_s4 (gfc_array_i4 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_4_s4 (gfc_array_i4 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c index a35e552..d4711e2 100644 --- a/libgfortran/generated/maxloc1_8_s1.c +++ b/libgfortran/generated/maxloc1_8_s1.c @@ -457,7 +457,7 @@ smaxloc1_8_s1 (gfc_array_i8 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_8_s1 (gfc_array_i8 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c index e264779..dea360e 100644 --- a/libgfortran/generated/maxloc1_8_s4.c +++ b/libgfortran/generated/maxloc1_8_s4.c @@ -457,7 +457,7 @@ smaxloc1_8_s4 (gfc_array_i8 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ smaxloc1_8_s4 (gfc_array_i8 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/maxloc2_16_s1.c b/libgfortran/generated/maxloc2_16_s1.c index 6e860ee..d38d422 100644 --- a/libgfortran/generated/maxloc2_16_s1.c +++ b/libgfortran/generated/maxloc2_16_s1.c @@ -152,8 +152,8 @@ GFC_INTEGER_16 smaxloc2_16_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_16_s1 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_16_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/maxloc2_16_s4.c b/libgfortran/generated/maxloc2_16_s4.c index e4ac04c..09fdbf8 100644 --- a/libgfortran/generated/maxloc2_16_s4.c +++ b/libgfortran/generated/maxloc2_16_s4.c @@ -152,8 +152,8 @@ GFC_INTEGER_16 smaxloc2_16_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_16_s4 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_16_s4 (array, back, len); else return 0; } diff --git a/libgfortran/generated/maxloc2_4_s1.c b/libgfortran/generated/maxloc2_4_s1.c index 78a5012..0804f59 100644 --- a/libgfortran/generated/maxloc2_4_s1.c +++ b/libgfortran/generated/maxloc2_4_s1.c @@ -152,8 +152,8 @@ GFC_INTEGER_4 smaxloc2_4_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_4_s1 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_4_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/maxloc2_4_s4.c b/libgfortran/generated/maxloc2_4_s4.c index 399dab7..6dac06e 100644 --- a/libgfortran/generated/maxloc2_4_s4.c +++ b/libgfortran/generated/maxloc2_4_s4.c @@ -152,8 +152,8 @@ GFC_INTEGER_4 smaxloc2_4_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_4_s4 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_4_s4 (array, back, len); else return 0; } diff --git a/libgfortran/generated/maxloc2_8_s1.c b/libgfortran/generated/maxloc2_8_s1.c index 9e1d36f9..5ced3c6 100644 --- a/libgfortran/generated/maxloc2_8_s1.c +++ b/libgfortran/generated/maxloc2_8_s1.c @@ -152,8 +152,8 @@ GFC_INTEGER_8 smaxloc2_8_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_8_s1 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_8_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/maxloc2_8_s4.c b/libgfortran/generated/maxloc2_8_s4.c index a44c6f6..78ae1be 100644 --- a/libgfortran/generated/maxloc2_8_s4.c +++ b/libgfortran/generated/maxloc2_8_s4.c @@ -152,8 +152,8 @@ GFC_INTEGER_8 smaxloc2_8_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return maxloc2_8_s4 (array, len, back); + if (mask == NULL || *mask) + return maxloc2_8_s4 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c index 8228009..b654608 100644 --- a/libgfortran/generated/minloc1_16_s1.c +++ b/libgfortran/generated/minloc1_16_s1.c @@ -457,7 +457,7 @@ sminloc1_16_s1 (gfc_array_i16 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_16_s1 (gfc_array_i16 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c index e40bf54..2e709a7 100644 --- a/libgfortran/generated/minloc1_16_s4.c +++ b/libgfortran/generated/minloc1_16_s4.c @@ -457,7 +457,7 @@ sminloc1_16_s4 (gfc_array_i16 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_16_s4 (gfc_array_i16 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c index 199d254..61dad55 100644 --- a/libgfortran/generated/minloc1_4_s1.c +++ b/libgfortran/generated/minloc1_4_s1.c @@ -457,7 +457,7 @@ sminloc1_4_s1 (gfc_array_i4 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_4_s1 (gfc_array_i4 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c index 1f0174b..49c25d0 100644 --- a/libgfortran/generated/minloc1_4_s4.c +++ b/libgfortran/generated/minloc1_4_s4.c @@ -457,7 +457,7 @@ sminloc1_4_s4 (gfc_array_i4 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_4_s4 (gfc_array_i4 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c index 39bdb9b..c0ac6e6 100644 --- a/libgfortran/generated/minloc1_8_s1.c +++ b/libgfortran/generated/minloc1_8_s1.c @@ -457,7 +457,7 @@ sminloc1_8_s1 (gfc_array_i8 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_8_s1 (gfc_array_i8 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c index ed74ac9..29624d0 100644 --- a/libgfortran/generated/minloc1_8_s4.c +++ b/libgfortran/generated/minloc1_8_s4.c @@ -457,7 +457,7 @@ sminloc1_8_s4 (gfc_array_i8 * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -465,8 +465,7 @@ sminloc1_8_s4 (gfc_array_i8 * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/generated/minloc2_16_s1.c b/libgfortran/generated/minloc2_16_s1.c index 6381ad6..9b4a92d 100644 --- a/libgfortran/generated/minloc2_16_s1.c +++ b/libgfortran/generated/minloc2_16_s1.c @@ -154,8 +154,8 @@ GFC_INTEGER_16 sminloc2_16_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_16_s1 (array, len, back); + if (mask == NULL || *mask) + return minloc2_16_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc2_16_s4.c b/libgfortran/generated/minloc2_16_s4.c index 11011b7..eac46fa 100644 --- a/libgfortran/generated/minloc2_16_s4.c +++ b/libgfortran/generated/minloc2_16_s4.c @@ -154,8 +154,8 @@ GFC_INTEGER_16 sminloc2_16_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_16_s4 (array, len, back); + if (mask == NULL || *mask) + return minloc2_16_s4 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc2_4_s1.c b/libgfortran/generated/minloc2_4_s1.c index 631484a..bb22f6c 100644 --- a/libgfortran/generated/minloc2_4_s1.c +++ b/libgfortran/generated/minloc2_4_s1.c @@ -154,8 +154,8 @@ GFC_INTEGER_4 sminloc2_4_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_4_s1 (array, len, back); + if (mask == NULL || *mask) + return minloc2_4_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc2_4_s4.c b/libgfortran/generated/minloc2_4_s4.c index d606437..f3020d6 100644 --- a/libgfortran/generated/minloc2_4_s4.c +++ b/libgfortran/generated/minloc2_4_s4.c @@ -154,8 +154,8 @@ GFC_INTEGER_4 sminloc2_4_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_4_s4 (array, len, back); + if (mask == NULL || *mask) + return minloc2_4_s4 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc2_8_s1.c b/libgfortran/generated/minloc2_8_s1.c index b02200b..04ec913 100644 --- a/libgfortran/generated/minloc2_8_s1.c +++ b/libgfortran/generated/minloc2_8_s1.c @@ -154,8 +154,8 @@ GFC_INTEGER_8 sminloc2_8_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_8_s1 (array, len, back); + if (mask == NULL || *mask) + return minloc2_8_s1 (array, back, len); else return 0; } diff --git a/libgfortran/generated/minloc2_8_s4.c b/libgfortran/generated/minloc2_8_s4.c index 9d33d13..fbb6d08 100644 --- a/libgfortran/generated/minloc2_8_s4.c +++ b/libgfortran/generated/minloc2_8_s4.c @@ -154,8 +154,8 @@ GFC_INTEGER_8 sminloc2_8_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) { - if (mask) - return minloc2_8_s4 (array, len, back); + if (mask == NULL || *mask) + return minloc2_8_s4 (array, back, len); else return 0; } diff --git a/libgfortran/m4/ifindloc2.m4 b/libgfortran/m4/ifindloc2.m4 index c6f909a..d309d8b 100644 --- a/libgfortran/m4/ifindloc2.m4 +++ b/libgfortran/m4/ifindloc2.m4 @@ -41,7 +41,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see if (back) { src = array->base_addr + (extent - 1) * sstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if ('comparison`'`) return i; @@ -94,7 +94,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see { src = array->base_addr + (extent - 1) * sstride; mbase += (extent - 1) * mstride; - for (i = extent; i >= 0; i--) + for (i = extent; i > 0; i--) { if (*mbase && ('comparison`'`)) return i; diff --git a/libgfortran/m4/ifunction-s.m4 b/libgfortran/m4/ifunction-s.m4 index 8275f65..22182e9 100644 --- a/libgfortran/m4/ifunction-s.m4 +++ b/libgfortran/m4/ifunction-s.m4 @@ -421,7 +421,7 @@ s'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, for (n = 0; n < dim; n++) { - extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n); if (extent[n] <= 0) extent[n] = 0; @@ -429,8 +429,7 @@ s'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, for (n = dim; n < rank; n++) { - extent[n] = - GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; + extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1); if (extent[n] <= 0) extent[n] = 0; diff --git a/libgfortran/m4/maxloc2s.m4 b/libgfortran/m4/maxloc2s.m4 index 49ecae7..b6070b4 100644 --- a/libgfortran/m4/maxloc2s.m4 +++ b/libgfortran/m4/maxloc2s.m4 @@ -153,8 +153,8 @@ export_proto(s'name`'rtype_qual`_'atype_code`); s'name`'rtype_qual`_'atype_code` ('atype` * const restrict array, GFC_LOGICAL_4 *mask'back_arg`, gfc_charlen_type len) { - if (mask) - return 'name`'rtype_qual`_'atype_code` (array, len, back); + if (mask == NULL || *mask) + return 'name`'rtype_qual`_'atype_code` (array, back, len); else return 0; } diff --git a/libgfortran/m4/minloc2s.m4 b/libgfortran/m4/minloc2s.m4 index 8e7b4ab..9524fc4 100644 --- a/libgfortran/m4/minloc2s.m4 +++ b/libgfortran/m4/minloc2s.m4 @@ -155,8 +155,8 @@ export_proto(s'name`'rtype_qual`_'atype_code`); s'name`'rtype_qual`_'atype_code` ('atype` * const restrict array, GFC_LOGICAL_4 *mask'back_arg`, gfc_charlen_type len) { - if (mask) - return 'name`'rtype_qual`_'atype_code` (array, len, back); + if (mask == NULL || *mask) + return 'name`'rtype_qual`_'atype_code` (array, back, len); else return 0; } diff --git a/libgm2/ChangeLog b/libgm2/ChangeLog index 0c57c33..a90dccf 100644 --- a/libgm2/ChangeLog +++ b/libgm2/ChangeLog @@ -1,3 +1,47 @@ +2025-05-13 Gaius Mulley <gaiusmod2@gmail.com> + + Backported from master: + 2025-04-24 Gaius Mulley <gaiusmod2@gmail.com> + + PR modula2/115276 + * config.h.in: Regenerate. + * configure: Regenerate. + * configure.ac (AC_STRUCT_TIMEZONE): Add. + (AC_CHECK_MEMBER): Test for struct tm.tm_year. + (AC_CHECK_MEMBER): Test for struct tm.tm_mon. + (AC_CHECK_MEMBER): Test for struct tm.tm_mday. + (AC_CHECK_MEMBER): Test for struct tm.tm_hour. + (AC_CHECK_MEMBER): Test for struct tm.tm_min. + (AC_CHECK_MEMBER): Test for struct tm.tm_sec. + (AC_CHECK_MEMBER): Test for struct tm.tm_year. + (AC_CHECK_MEMBER): Test for struct tm.tm_yday. + (AC_CHECK_MEMBER): Test for struct tm.tm_wday. + (AC_CHECK_MEMBER): Test for struct tm.tm_isdst. + (AC_CHECK_MEMBER): Test for struct timeval.tv_sec. + (AC_CHECK_MEMBER): Test for struct timeval.tv_sec. + (AC_CHECK_MEMBER): Test for struct timeval.tv_usec. + * libm2iso/wraptime.cc (InitTimeval): Guard against lack + struct timeval and malloc. + (InitTimezone): Guard against lack of struct tm.tm_zone + and malloc. + (KillTimezone): Ditto. + (InitTimeval): Guard against lack of struct timeval + and malloc. + (KillTimeval): Guard against lack of malloc. + (settimeofday): Guard against lack of struct tm.tm_zone. + (GetFractions): Guard against lack of struct timeval. + (localtime_r): Ditto. + (GetYear): Guard against lack of struct tm. + (GetMonth): Ditto. + (GetDay): Ditto. + (GetHour): Ditto. + (GetMinute): Ditto. + (GetSecond): Ditto. + (GetSummerTime): Ditto. + (GetDST): Guards against lack of struct timezone. + (SetTimezone): Ditto. + (SetTimeval): Guard against lack of struct tm. + 2025-04-25 Release Manager * GCC 15.1.0 released. diff --git a/libgm2/config.h.in b/libgm2/config.h.in index 321ef3b..f9710ff 100644 --- a/libgm2/config.h.in +++ b/libgm2/config.h.in @@ -34,6 +34,10 @@ */ #undef HAVE_DECL_GETENV +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#undef HAVE_DECL_TZNAME + /* Define to 1 if you have the <direct.h> header file. */ #undef HAVE_DIRECT_H @@ -232,6 +236,9 @@ /* Define to 1 if the system has the type `struct tm'. */ #undef HAVE_STRUCT_TM +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +#undef HAVE_STRUCT_TM_TM_ZONE + /* Define to 1 if you have the <sys/errno.h> header file. */ #undef HAVE_SYS_ERRNO_H @@ -286,6 +293,10 @@ /* Define if struct tm has a tm_gmtoff field. */ #undef HAVE_TM_TM_GMTOFF +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#undef HAVE_TM_ZONE + /* function tzname exists */ #undef HAVE_TZNAME @@ -338,6 +349,9 @@ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME +/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -363,6 +377,45 @@ /* Version number of package */ #undef VERSION +/* struct timeval was found */ +#undef WE_HAVE_STRUCT_TIMEVAL + +/* struct timeval.tv_sec was found */ +#undef WE_HAVE_STRUCT_TIMEVAL_TV_SEC + +/* struct timeval.tv_usec was found */ +#undef WE_HAVE_STRUCT_TIMEVAL_TV_USEC + +/* struct tm was found */ +#undef WE_HAVE_STRUCT_TM + +/* struct tm.tm_hour was found */ +#undef WE_HAVE_STRUCT_TM_HOUR + +/* struct tm.tm_isdst was found */ +#undef WE_HAVE_STRUCT_TM_ISDST + +/* struct tm.tm_mday was found */ +#undef WE_HAVE_STRUCT_TM_MDAY + +/* struct tm.tm_min was found */ +#undef WE_HAVE_STRUCT_TM_MIN + +/* struct tm.tm_mon was found */ +#undef WE_HAVE_STRUCT_TM_MON + +/* struct tm.tm_sec was found */ +#undef WE_HAVE_STRUCT_TM_SEC + +/* struct tm.tm_wday was found */ +#undef WE_HAVE_STRUCT_TM_WDAY + +/* struct tm.tm_yday was found */ +#undef WE_HAVE_STRUCT_TM_YDAY + +/* struct tm.tm_year was found */ +#undef WE_HAVE_STRUCT_TM_YEAR + /* Defined if no way to sleep is available. */ #undef _GLIBCXX_NO_SLEEP diff --git a/libgm2/configure b/libgm2/configure index efe3b66..8ffdb31 100755 --- a/libgm2/configure +++ b/libgm2/configure @@ -2100,6 +2100,109 @@ $as_echo "$ac_res" >&6; } } # ac_fn_cxx_check_func +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -2269,52 +2372,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -6872,6 +6929,7 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi + ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes; then : @@ -6903,6 +6961,223 @@ fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h> +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_ZONE 1 +_ACEOF + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> +" +if test "x$ac_cv_have_decl_tzname" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TZNAME $ac_have_decl +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } +if ${ac_cv_var_tzname+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <time.h> +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main () +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_var_tzname=yes +else + ac_cv_var_tzname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +$as_echo "#define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_year" "ac_cv_member_struct_tm_tm_year" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_year" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_year" "ac_cv_member_struct_tm_tm_year" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_year" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_YEAR 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_mon" "ac_cv_member_struct_tm_tm_mon" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_mon" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_MON 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_mday" "ac_cv_member_struct_tm_tm_mday" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_mday" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_MDAY 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_hour" "ac_cv_member_struct_tm_tm_hour" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_hour" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_HOUR 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_min" "ac_cv_member_struct_tm_tm_min" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_min" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_MIN 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_sec" "ac_cv_member_struct_tm_tm_sec" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_sec" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_SEC 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_year" "ac_cv_member_struct_tm_tm_year" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_year" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_YEAR 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_yday" "ac_cv_member_struct_tm_tm_yday" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_yday" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_YDAY 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_wday" "ac_cv_member_struct_tm_tm_wday" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_wday" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_WDAY 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_isdst" "ac_cv_member_struct_tm_tm_isdst" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_isdst" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TM_ISDST 1" >>confdefs.h + +fi + + +ac_fn_c_check_member "$LINENO" "struct timeval" "tv_sec" "ac_cv_member_struct_timeval_tv_sec" "$ac_includes_default" +if test "x$ac_cv_member_struct_timeval_tv_sec" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TIMEVAL 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct timeval" "tv_sec" "ac_cv_member_struct_timeval_tv_sec" "$ac_includes_default" +if test "x$ac_cv_member_struct_timeval_tv_sec" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TIMEVAL_TV_SEC 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct timeval" "tv_usec" "ac_cv_member_struct_timeval_tv_usec" "$ac_includes_default" +if test "x$ac_cv_member_struct_timeval_tv_usec" = xyes; then : + +$as_echo "#define WE_HAVE_STRUCT_TIMEVAL_TV_USEC 1" >>confdefs.h + +fi + + case ${build_alias} in "") build_noncanonical=${build} ;; @@ -14579,7 +14854,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14582 "configure" +#line 14857 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14685,7 +14960,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14688 "configure" +#line 14963 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgm2/configure.ac b/libgm2/configure.ac index c070491..437485f 100644 --- a/libgm2/configure.ac +++ b/libgm2/configure.ac @@ -89,6 +89,7 @@ AC_ARG_WITH(cross-host, AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME + AC_CHECK_HEADER([math.h], [AC_DEFINE([HAVE_MATH_H], [1], [have math.h])]) @@ -102,6 +103,49 @@ AC_CHECK_HEADERS(getopt.h limits.h stddef.h string.h strings.h \ pthread.h stdarg.h stdio.h sys/types.h termios.h \ netinet/in.h netdb.h sys/uio.h sys/stat.h wchar.h) +AC_STRUCT_TIMEZONE + +AC_CHECK_MEMBER([struct tm.tm_year], + [AC_DEFINE(WE_HAVE_STRUCT_TM, [1], [struct tm was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_year], + [AC_DEFINE(WE_HAVE_STRUCT_TM_YEAR, [1], [struct tm.tm_year was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_mon], + [AC_DEFINE(WE_HAVE_STRUCT_TM_MON, [1], [struct tm.tm_mon was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_mday], + [AC_DEFINE(WE_HAVE_STRUCT_TM_MDAY, [1], [struct tm.tm_mday was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_hour], + [AC_DEFINE(WE_HAVE_STRUCT_TM_HOUR, [1], [struct tm.tm_hour was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_min], + [AC_DEFINE(WE_HAVE_STRUCT_TM_MIN, [1], [struct tm.tm_min was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_sec], + [AC_DEFINE(WE_HAVE_STRUCT_TM_SEC, [1], [struct tm.tm_sec was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_year], + [AC_DEFINE(WE_HAVE_STRUCT_TM_YEAR, [1], [struct tm.tm_year was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_yday], + [AC_DEFINE(WE_HAVE_STRUCT_TM_YDAY, [1], [struct tm.tm_yday was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_wday], + [AC_DEFINE(WE_HAVE_STRUCT_TM_WDAY, [1], [struct tm.tm_wday was found])], + [], [[#include <time.h>]]) +AC_CHECK_MEMBER([struct tm.tm_isdst], + [AC_DEFINE(WE_HAVE_STRUCT_TM_ISDST, [1], [struct tm.tm_isdst was found])], + [], [[#include <time.h>]]) + +AC_CHECK_MEMBER([struct timeval.tv_sec], + [AC_DEFINE(WE_HAVE_STRUCT_TIMEVAL, [1], [struct timeval was found])]) +AC_CHECK_MEMBER([struct timeval.tv_sec], + [AC_DEFINE(WE_HAVE_STRUCT_TIMEVAL_TV_SEC, [1], [struct timeval.tv_sec was found])]) +AC_CHECK_MEMBER([struct timeval.tv_usec], + [AC_DEFINE(WE_HAVE_STRUCT_TIMEVAL_TV_USEC, [1], [struct timeval.tv_usec was found])]) + AC_CANONICAL_HOST ACX_NONCANONICAL_HOST ACX_NONCANONICAL_TARGET diff --git a/libgm2/libm2iso/wraptime.cc b/libgm2/libm2iso/wraptime.cc index 4bbd5f9..ed5f05e 100644 --- a/libgm2/libm2iso/wraptime.cc +++ b/libgm2/libm2iso/wraptime.cc @@ -58,7 +58,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* InitTimeval returns a newly created opaque type. */ -#if defined(HAVE_STRUCT_TIMEVAL) && defined(HAVE_MALLOC_H) +#if defined(WE_HAVE_STRUCT_TIMEVAL) && defined(HAVE_MALLOC_H) extern "C" struct timeval * EXPORT(InitTimeval) (void) { @@ -85,7 +85,7 @@ EXPORT(KillTimeval) (void *tv) /* InitTimezone returns a newly created opaque type. */ -#if defined(HAVE_STRUCT_TIMEZONE) && defined(HAVE_MALLOC_H) +#if defined(HAVE_STRUCT_TM_TM_ZONE) && defined(HAVE_MALLOC_H) extern "C" struct timezone * EXPORT(InitTimezone) (void) { @@ -102,14 +102,20 @@ EXPORT(InitTimezone) (void) /* KillTimezone - deallocates the memory associated with an opaque type. */ +#if defined(HAVE_STRUCT_TM_TM_ZONE) && defined(HAVE_MALLOC_H) extern "C" struct timezone * EXPORT(KillTimezone) (struct timezone *tv) { -#if defined(HAVE_MALLOC_H) free (tv); -#endif return NULL; } +#else +extern "C" void * +EXPORT(KillTimezone) (void *tv) +{ + return NULL; +} +#endif /* InitTM - returns a newly created opaque type. */ @@ -141,7 +147,7 @@ EXPORT(KillTM) (struct tm *tv) /* gettimeofday - calls gettimeofday(2) with the same parameters, tv, and, tz. It returns 0 on success. */ -#if defined(HAVE_STRUCT_TIMEZONE) && defined(HAVE_GETTIMEOFDAY) +#if defined(HAVE_STRUCT_TM_TM_ZONE) && defined(HAVE_GETTIMEOFDAY) extern "C" int EXPORT(gettimeofday) (void *tv, struct timezone *tz) { @@ -158,7 +164,7 @@ EXPORT(gettimeofday) (void *tv, void *tz) /* settimeofday - calls settimeofday(2) with the same parameters, tv, and, tz. It returns 0 on success. */ -#if defined(HAVE_STRUCT_TIMEZONE) && defined(HAVE_SETTIMEOFDAY) +#if defined(HAVE_STRUCT_TM_TM_ZONE) && defined(HAVE_SETTIMEOFDAY) extern "C" int EXPORT(settimeofday) (void *tv, struct timezone *tz) { @@ -175,7 +181,7 @@ EXPORT(settimeofday) (void *tv, void *tz) /* wraptime_GetFractions - returns the tv_usec field inside the timeval structure. */ -#if defined(HAVE_STRUCT_TIMEVAL) +#if defined(WE_HAVE_STRUCT_TIMEVAL_TV_USEC) extern "C" unsigned int EXPORT(GetFractions) (struct timeval *tv) { @@ -194,7 +200,7 @@ EXPORT(GetFractions) (void *tv) this procedure function expects, timeval, as its first parameter and not a time_t (as expected by the posix equivalent). */ -#if defined(HAVE_STRUCT_TIMEVAL) +#if defined(WE_HAVE_STRUCT_TIMEVAL_TV_SEC) extern "C" struct tm * EXPORT(localtime_r) (struct timeval *tv, struct tm *m) { @@ -210,7 +216,7 @@ EXPORT(localtime_r) (void *tv, struct tm *m) /* wraptime_GetYear - returns the year from the structure, m. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_YEAR) extern "C" unsigned int EXPORT(GetYear) (struct tm *m) { @@ -226,7 +232,7 @@ EXPORT(GetYear) (void *m) /* wraptime_GetMonth - returns the month from the structure, m. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_MON) extern "C" unsigned int EXPORT(GetMonth) (struct tm *m) { @@ -243,7 +249,7 @@ EXPORT(GetMonth) (void *m) /* wraptime_GetDay - returns the day of the month from the structure, m. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_MDAY) extern "C" unsigned int EXPORT(GetDay) (struct tm *m) { @@ -260,7 +266,7 @@ EXPORT(GetDay) (void *m) /* wraptime_GetHour - returns the hour of the day from the structure, m. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_HOUR) extern "C" unsigned int EXPORT(GetHour) (struct tm *m) { @@ -277,7 +283,7 @@ EXPORT(GetHour) (void *m) /* wraptime_GetMinute - returns the minute within the hour from the structure, m. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_MIN) extern "C" unsigned int EXPORT(GetMinute) (struct tm *m) { @@ -295,7 +301,7 @@ EXPORT(GetMinute) (void *m) structure, m. The return value will always be in the range 0..59. A leap minute of value 60 will be truncated to 59. */ -#if defined(HAVE_STRUCT_TM) +#if defined(WE_HAVE_STRUCT_TM_SEC) extern "C" unsigned int EXPORT(GetSecond) (struct tm *m) { @@ -314,7 +320,7 @@ EXPORT(GetSecond) (void *m) /* wraptime_GetSummerTime - returns true if summer time is in effect. */ -#if defined(HAVE_STRUCT_TIMEZONE) +#if defined(HAVE_STRUCT_TM_TM_ZONE) extern "C" bool EXPORT(GetSummerTime) (struct timezone *tz) { @@ -330,7 +336,7 @@ EXPORT(GetSummerTime) (void *tz) /* wraptime_GetDST - returns the number of minutes west of GMT. */ -#if defined(HAVE_STRUCT_TIMEZONE) +#if defined(HAVE_STRUCT_TM_TM_ZONE) extern "C" int EXPORT(GetDST) (struct timezone *tz) { @@ -350,7 +356,7 @@ EXPORT(GetDST) (void *tz) /* SetTimezone - set the timezone field inside timeval, tv. */ -#if defined(HAVE_STRUCT_TIMEZONE) +#if defined(HAVE_STRUCT_TM_TM_ZONE) extern "C" void EXPORT(SetTimezone) (struct timezone *tz, int zone, int minuteswest) { @@ -367,22 +373,40 @@ EXPORT(SetTimezone) (void *tz, int zone, int minuteswest) /* SetTimeval - sets the fields in tm, t, with: second, minute, hour, day, month, year, fractions. */ -#if defined(HAVE_STRUCT_TIMEVAL) +#if defined(WE_HAVE_STRUCT_TM) extern "C" void EXPORT(SetTimeval) (struct tm *t, unsigned int second, unsigned int minute, unsigned int hour, unsigned int day, unsigned int month, unsigned int year, unsigned int yday, unsigned int wday, unsigned int isdst) { +#if defined(WE_HAVE_STRUCT_TM_SEC) t->tm_sec = second; +#endif +#if defined(WE_HAVE_STRUCT_TM_MIN) t->tm_min = minute; +#endif +#if defined(WE_HAVE_STRUCT_TM_HOUR) t->tm_hour = hour; +#endif +#if defined(WE_HAVE_STRUCT_TM_MDAY) t->tm_mday = day; +#endif +#if defined(WE_HAVE_STRUCT_TM_MON) t->tm_mon = month; +#endif +#if defined(WE_HAVE_STRUCT_TM_YEAR) t->tm_year = year; +#endif +#if defined(WE_HAVE_STRUCT_TM_YDAY) t->tm_yday = yday; +#endif +#if defined(WE_HAVE_STRUCT_TM_WDAY) t->tm_wday = wday; +#endif +#if defined(WE_HAVE_STRUCT_TM_ISDST) t->tm_isdst = isdst; +#endif } #else extern "C" void diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ceec42b..6cef1dd 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,134 @@ +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-05-15 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.fortran/alloc-comp-4.f90: New test. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-05-14 Tobias Burnus <tburnus@baylibre.com> + + * target.c (gomp_attach_pointer): Return bool; accept additional + bool to optionally silence the fatal pointee-not-found error. + (gomp_map_vars_internal): If the pointee could not be found, + check whether it was mapped as GOMP_MAP_ZERO_LEN_ARRAY_SECTION. + * libgomp.h (gomp_attach_pointer): Update prototype. + * oacc-mem.c (acc_attach_async, goacc_enter_data_internal): Update + calls. + * testsuite/libgomp.c/target-map-zero-sized.c: New test. + * testsuite/libgomp.c/target-map-zero-sized-2.c: New test. + * testsuite/libgomp.c/target-map-zero-sized-3.c: New test. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-05-09 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.c/interop-cuda-full.c: Use 'link' instead + of 'run' when the default device is "! offload_device_nvptx". + * testsuite/libgomp.c/interop-cuda-libonly.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-full.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-no-headers.c: Likewise. + * testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c: Likewise. + * testsuite/libgomp.fortran/interop-hip-nvidia-full.F90: Likewise. + * testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90: Likewise. + * testsuite/libgomp.c/interop-hip-amd-full.c: Use 'link' instead + of 'run' when the default device is "! offload_device_gcn". + * testsuite/libgomp.c/interop-hip-amd-no-hip-header.c: Likewise. + * testsuite/libgomp.fortran/interop-hip-amd-full.F90: Likewise. + * testsuite/libgomp.fortran/interop-hip-amd-no-module.F90: Likewise. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-05-07 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.fortran/map-alloc-comp-9.f90: Process differently + when USE_USM_REQUIREMENT is set. + * testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90: New test. + +2025-05-19 Thomas Schwinge <tschwinge@baylibre.com> + + Backported from master: + 2025-05-05 Thomas Schwinge <tschwinge@baylibre.com> + + * testsuite/libgomp.c/interop-hsa.c: GCN offloading only. + +2025-05-19 Tobias Burnus <tobias@codesourcery.com> + + Backported from master: + 2025-05-01 Tobias Burnus <tobias@codesourcery.com> + + * testsuite/libgomp.fortran/allocate-8a.f90: New test. + +2025-05-19 Andrew Stubbs <ams@baylibre.com> + + Backported from master: + 2025-04-25 Andrew Stubbs <ams@baylibre.com> + + * testsuite/libgomp.c/interop-hsa.c: New test. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-04-24 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/lib/libgomp.exp + (check_effective_target_gomp_hip_header_nvidia): Compile with + "-Wno-deprecated-declarations". + * testsuite/libgomp.c/interop-hip-nvidia-full.c: Likewise. + * testsuite/libgomp.c/interop-hipblas-nvidia-full.c: Likewise. + * testsuite/libgomp.c/interop-hipblas.h: Add workarounds + when using the HIP headers with __HIP_PLATFORM_NVIDIA__. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-04-24 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/lib/libgomp.exp (check_effective_target_openacc_cublas, + check_effective_target_openacc_cudart): Update description as + the check requires more. + (check_effective_target_openacc_libcuda, + check_effective_target_openacc_libcublas, + check_effective_target_openacc_libcudart, + check_effective_target_gomp_hip_header_amd, + check_effective_target_gomp_hip_header_nvidia, + check_effective_target_gomp_hipfort_module, + check_effective_target_gomp_libamdhip64, + check_effective_target_gomp_libhipblas): New. + * testsuite/libgomp.c-c++-common/interop-2.c: New test. + * testsuite/libgomp.c/interop-cublas-full.c: New test. + * testsuite/libgomp.c/interop-cublas-libonly.c: New test. + * testsuite/libgomp.c/interop-cuda-full.c: New test. + * testsuite/libgomp.c/interop-cuda-libonly.c: New test. + * testsuite/libgomp.c/interop-hip-amd-full.c: New test. + * testsuite/libgomp.c/interop-hip-amd-no-hip-header.c: New test. + * testsuite/libgomp.c/interop-hip-nvidia-full.c: New test. + * testsuite/libgomp.c/interop-hip-nvidia-no-headers.c: New test. + * testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c: New test. + * testsuite/libgomp.c/interop-hip.h: New test. + * testsuite/libgomp.c/interop-hipblas-amd-full.c: New test. + * testsuite/libgomp.c/interop-hipblas-amd-no-hip-header.c: New test. + * testsuite/libgomp.c/interop-hipblas-nvidia-full.c: New test. + * testsuite/libgomp.c/interop-hipblas-nvidia-no-headers.c: New test. + * testsuite/libgomp.c/interop-hipblas-nvidia-no-hip-header.c: New test. + * testsuite/libgomp.c/interop-hipblas.h: New test. + * testsuite/libgomp.fortran/interop-hip-amd-full.F90: New test. + * testsuite/libgomp.fortran/interop-hip-amd-no-module.F90: New test. + * testsuite/libgomp.fortran/interop-hip-nvidia-full.F90: New test. + * testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90: New test. + * testsuite/libgomp.fortran/interop-hip.h: New test. + +2025-05-19 Tobias Burnus <tburnus@baylibre.com> + + Backported from master: + 2025-04-23 Tobias Burnus <tburnus@baylibre.com> + + * testsuite/libgomp.fortran/target-enter-data-8.f90: New test. + 2025-05-06 Tejas Belagod <tejas.belagod@arm.com> * testsuite/libgomp.c-target/aarch64/udr-sve.c: Fix test. diff --git a/libgomp/testsuite/libgomp.c/interop-hsa.c b/libgomp/testsuite/libgomp.c/interop-hsa.c index cf8bc90..21ac91c 100644 --- a/libgomp/testsuite/libgomp.c/interop-hsa.c +++ b/libgomp/testsuite/libgomp.c/interop-hsa.c @@ -1,5 +1,7 @@ /* { dg-additional-options "-ldl" } */ -/* { dg-require-effective-target offload_device_gcn } */ +/* { dg-require-effective-target offload_device_gcn } + The 'asm' insert is valid for GCN only: + { dg-additional-options -foffload=amdgcn-amdhsa } */ #include <stdio.h> #include <stdlib.h> diff --git a/libgomp/testsuite/libgomp.fortran/alloc-comp-4.f90 b/libgomp/testsuite/libgomp.fortran/alloc-comp-4.f90 new file mode 100644 index 0000000..d5e982b --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/alloc-comp-4.f90 @@ -0,0 +1,75 @@ +! +! Check that mapping with map(var%tiles(1)) works. +! +! This uses deep mapping to handle the allocatable +! derived-type components +! +! The tricky part is that GCC generates intermittently +! an SSA_NAME that needs to be resolved. +! +module m +type t + integer, allocatable :: den1(:,:), den2(:,:) +end type t + +type t2 + type(t), allocatable :: tiles(:) +end type t2 +end + +use m +use iso_c_binding +implicit none (type, external) +type(t2), target :: var +logical :: is_self_map +type(C_ptr) :: pden1, pden2, ptiles, ptiles1 + +allocate(var%tiles(1)) +var%tiles(1)%den1 = reshape([1,2,3,4],[2,2]) +var%tiles(1)%den2 = reshape([11,22,33,44],[2,2]) + +ptiles = c_loc(var%tiles) +ptiles1 = c_loc(var%tiles(1)) +pden1 = c_loc(var%tiles(1)%den1) +pden2 = c_loc(var%tiles(1)%den2) + + +is_self_map = .false. +!$omp target map(to: is_self_map) + is_self_map = .true. +!$omp end target + +!$omp target enter data map(var%tiles(1)) + +!$omp target firstprivate(ptiles, ptiles1, pden1, pden2) + if (any (var%tiles(1)%den1 /= reshape([1,2,3,4],[2,2]))) stop 1 + if (any (var%tiles(1)%den2 /= reshape([11,22,33,44],[2,2]))) stop 2 + var%tiles(1)%den1 = var%tiles(1)%den1 + 5 + var%tiles(1)%den2 = var%tiles(1)%den2 + 7 + + if (is_self_map) then + if (.not. c_associated (ptiles, c_loc(var%tiles))) stop 3 + if (.not. c_associated (ptiles1, c_loc(var%tiles(1)))) stop 4 + if (.not. c_associated (pden1, c_loc(var%tiles(1)%den1))) stop 5 + if (.not. c_associated (pden2, c_loc(var%tiles(1)%den2))) stop 6 + else + if (c_associated (ptiles, c_loc(var%tiles))) stop 3 + if (c_associated (ptiles1, c_loc(var%tiles(1)))) stop 4 + if (c_associated (pden1, c_loc(var%tiles(1)%den1))) stop 5 + if (c_associated (pden2, c_loc(var%tiles(1)%den2))) stop 6 + endif +!$omp end target + +if (is_self_map) then + if (any (var%tiles(1)%den1 /= 5 + reshape([1,2,3,4],[2,2]))) stop 7 + if (any (var%tiles(1)%den2 /= 7 + reshape([11,22,33,44],[2,2]))) stop 8 +else + if (any (var%tiles(1)%den1 /= reshape([1,2,3,4],[2,2]))) stop 7 + if (any (var%tiles(1)%den2 /= reshape([11,22,33,44],[2,2]))) stop 8 +endif + +!$omp target exit data map(var%tiles(1)) + +if (any (var%tiles(1)%den1 /= 5 + reshape([1,2,3,4],[2,2]))) stop 7 +if (any (var%tiles(1)%den2 /= 7 + reshape([11,22,33,44],[2,2]))) stop 8 +end diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90 new file mode 100644 index 0000000..90378c0 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9-usm.f90 @@ -0,0 +1,11 @@ +! { dg-additional-options "-cpp -DUSE_USM_REQUIREMENT=1 -Wno-openmp" } +! +! We silence the warning: +! Mapping of polymorphic list item '...' is unspecified behavior [-Wopenmp] +! +! Ensure that polymorphic mapping is diagnosed as undefined behavior +! Ensure that static access to polymorphic variables works + +! Run map-alloc-comp-9.f90 in unified-shared-memory mode + +#include "map-alloc-comp-9.f90" diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90 index 3cec392..26c73d7 100644 --- a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90 +++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90 @@ -1,8 +1,19 @@ +! { dg-additional-options "-cpp" } +! ! Ensure that polymorphic mapping is diagnosed as undefined behavior ! Ensure that static access to polymorphic variables works +! Some extended tests are only run with shared memory +! To enforce this (where possible) on the device side: +! #define USE_USM_REQUIREMENT +! which is done in map-alloc-comp-9-usm.f90 + subroutine test(case) implicit none(type, external) +#ifdef USE_USM_REQUIREMENT + !$omp requires unified_shared_memory +#endif + type t integer :: x(4) end type t @@ -73,10 +84,14 @@ var4%y2(2)%y%x%x = -7 * [1111,2222,3333,4444] var4%y2(2)%y%x2(1)%x = -8 * [1111,2222,3333,4444] var4%y2(2)%y%x2(2)%x = -9 * [1111,2222,3333,4444] +#ifdef USE_USM_REQUIREMENT +is_shared_mem = .true. +#else is_shared_mem = .false. !$omp target map(to: is_shared_mem) is_shared_mem = .true. !$omp end target +#endif if (case == 1) then ! implicit mapping @@ -532,6 +547,10 @@ end subroutine test program main use omp_lib implicit none(type, external) +#ifdef USE_USM_REQUIREMENT + !$omp requires unified_shared_memory +#endif + interface subroutine test(case) integer, value :: case diff --git a/libgomp/testsuite/libgomp.fortran/target-enter-data-8.f90 b/libgomp/testsuite/libgomp.fortran/target-enter-data-8.f90 new file mode 100644 index 0000000..c6d671c --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/target-enter-data-8.f90 @@ -0,0 +1,532 @@ +! { dg-additional-options "-cpp" } + +! FIXME: Some tests do not work yet. Those are for now in '#if 0' + +! Check that 'map(alloc:' properly works with +! - deferred-length character strings +! - arrays with array descriptors +! For those, the array descriptor / string length must be mapped with 'to:' + +program main +implicit none + +type t + integer :: ic(2:5), ic2 + character(len=11) :: ccstr(3:4), ccstr2 + character(len=11,kind=4) :: cc4str(3:7), cc4str2 + integer, pointer :: pc(:), pc2 + character(len=:), pointer :: pcstr(:), pcstr2 + character(len=:,kind=4), pointer :: pc4str(:), pc4str2 +end type t + +type(t) :: dt + +integer :: ii(5), ii2 +character(len=11) :: clstr(-1:1), clstr2 +character(len=11,kind=4) :: cl4str(0:3), cl4str2 +integer, pointer :: ip(:), ip2 +integer, allocatable :: ia(:), ia2 +character(len=:), pointer :: pstr(:), pstr2 +character(len=:), allocatable :: astr(:), astr2 +character(len=:,kind=4), pointer :: p4str(:), p4str2 +character(len=:,kind=4), allocatable :: a4str(:), a4str2 + + +allocate(dt%pc(5), dt%pc2) +allocate(character(len=2) :: dt%pcstr(2)) +allocate(character(len=4) :: dt%pcstr2) + +allocate(character(len=3,kind=4) :: dt%pc4str(2:3)) +allocate(character(len=5,kind=4) :: dt%pc4str2) + +allocate(ip(5), ip2, ia(8), ia2) +allocate(character(len=2) :: pstr(-2:0)) +allocate(character(len=4) :: pstr2) +allocate(character(len=6) :: astr(3:5)) +allocate(character(len=8) :: astr2) + +allocate(character(len=3,kind=4) :: p4str(2:4)) +allocate(character(len=5,kind=4) :: p4str2) +allocate(character(len=7,kind=4) :: a4str(-2:3)) +allocate(character(len=9,kind=4) :: a4str2) + + +! integer :: ic(2:5), ic2 + +!$omp target enter data map(alloc: dt%ic) +!$omp target map(alloc: dt%ic) + if (size(dt%ic) /= 4) error stop + if (lbound(dt%ic, 1) /= 2) error stop + if (ubound(dt%ic, 1) /= 5) error stop + dt%ic = [22, 33, 44, 55] +!$omp end target +!$omp target exit data map(from: dt%ic) +if (size(dt%ic) /= 4) error stop +if (lbound(dt%ic, 1) /= 2) error stop +if (ubound(dt%ic, 1) /= 5) error stop +if (any (dt%ic /= [22, 33, 44, 55])) error stop + +!$omp target enter data map(alloc: dt%ic2) +!$omp target map(alloc: dt%ic2) + dt%ic2 = 42 +!$omp end target +!$omp target exit data map(from: dt%ic2) +if (dt%ic2 /= 42) error stop + + +! character(len=11) :: ccstr(3:4), ccstr2 + +!$omp target enter data map(alloc: dt%ccstr) +!$omp target map(alloc: dt%ccstr) + if (len(dt%ccstr) /= 11) error stop + if (size(dt%ccstr) /= 2) error stop + if (lbound(dt%ccstr, 1) /= 3) error stop + if (ubound(dt%ccstr, 1) /= 4) error stop + dt%ccstr = ["12345678901", "abcdefghijk"] +!$omp end target +!$omp target exit data map(from: dt%ccstr) +if (len(dt%ccstr) /= 11) error stop +if (size(dt%ccstr) /= 2) error stop +if (lbound(dt%ccstr, 1) /= 3) error stop +if (ubound(dt%ccstr, 1) /= 4) error stop +if (any (dt%ccstr /= ["12345678901", "abcdefghijk"])) error stop + +!$omp target enter data map(alloc: dt%ccstr2) +!$omp target map(alloc: dt%ccstr2) + if (len(dt%ccstr2) /= 11) error stop + dt%ccstr2 = "ABCDEFGHIJK" +!$omp end target +!$omp target exit data map(from: dt%ccstr2) +if (len(dt%ccstr2) /= 11) error stop +if (dt%ccstr2 /= "ABCDEFGHIJK") error stop + + +! character(len=11,kind=4) :: cc4str(3:7), cc4str2 + +#if 0 +! Value check fails +!$omp target map(alloc: dt%cc4str) + if (len(dt%cc4str) /= 11) error stop + if (size(dt%cc4str) /= 5) error stop + if (lbound(dt%cc4str, 1) /= 3) error stop + if (ubound(dt%cc4str, 1) /= 7) error stop + dt%cc4str = [4_"12345678901", 4_"abcdefghijk", & + 4_"qerftcea6ds", 4_"a1f9g37ga4.", & + 4_"45ngwj56sj2"] +!$omp end target +!$omp target exit data map(from: dt%cc4str) +if (len(dt%cc4str) /= 11) error stop +if (size(dt%cc4str) /= 5) error stop +if (lbound(dt%cc4str, 1) /= 3) error stop +if (ubound(dt%cc4str, 1) /= 7) error stop +if (dt%cc4str(3) /= 4_"12345678901") error stop +if (dt%cc4str(4) /= 4_"abcdefghijk") error stop +if (dt%cc4str(5) /= 4_"qerftcea6ds") error stop +if (dt%cc4str(6) /= 4_"a1f9g37ga4.") error stop +if (dt%cc4str(7) /= 4_"45ngwj56sj2") error stop +#endif + +!$omp target enter data map(alloc: dt%cc4str2) +!$omp target map(alloc: dt%cc4str2) + if (len(dt%cc4str2) /= 11) error stop + dt%cc4str2 = 4_"ABCDEFGHIJK" +!$omp end target +!$omp target exit data map(from: dt%cc4str2) +if (len(dt%cc4str2) /= 11) error stop +if (dt%cc4str2 /= 4_"ABCDEFGHIJK") error stop + + +! integer, pointer :: pc(:), pc2 +! allocate(dt%pc(5), dt%pc2) + +!$omp target enter data map(alloc: dt%pc) +!$omp target map(alloc: dt%pc) + if (.not. associated(dt%pc)) error stop + if (size(dt%pc) /= 5) error stop + if (lbound(dt%pc, 1) /= 1) error stop + if (ubound(dt%pc, 1) /= 5) error stop + dt%pc = [11, 22, 33, 44, 55] +!$omp end target +!$omp target exit data map(from: dt%pc) +if (.not. associated(dt%pc)) error stop +if (size(dt%pc) /= 5) error stop +if (lbound(dt%pc, 1) /= 1) error stop +if (ubound(dt%pc, 1) /= 5) error stop +if (any (dt%pc /= [11, 22, 33, 44, 55])) error stop + +!$omp target enter data map(alloc: dt%pc2) +!$omp target map(alloc: dt%pc2) + if (.not. associated(dt%pc2)) error stop + dt%pc2 = 99 +!$omp end target +!$omp target exit data map(from: dt%pc2) +if (dt%pc2 /= 99) error stop +if (.not. associated(dt%pc2)) error stop + + +! character(len=:), pointer :: pcstr(:), pcstr2 +! allocate(character(len=2) :: dt%pcstr(2)) +! allocate(character(len=4) :: dt%pcstr2) + +!$omp target enter data map(alloc: dt%pcstr) +!$omp target map(alloc: dt%pcstr) + if (.not. associated(dt%pcstr)) error stop + if (len(dt%pcstr) /= 2) error stop + if (size(dt%pcstr) /= 2) error stop + if (lbound(dt%pcstr, 1) /= 1) error stop + if (ubound(dt%pcstr, 1) /= 2) error stop + dt%pcstr = ["01", "jk"] +!$omp end target +!$omp target exit data map(from: dt%pcstr) +if (.not. associated(dt%pcstr)) error stop +if (len(dt%pcstr) /= 2) error stop +if (size(dt%pcstr) /= 2) error stop +if (lbound(dt%pcstr, 1) /= 1) error stop +if (ubound(dt%pcstr, 1) /= 2) error stop +if (any (dt%pcstr /= ["01", "jk"])) error stop + + +!$omp target enter data map(alloc: dt%pcstr2) +!$omp target map(alloc: dt%pcstr2) + if (.not. associated(dt%pcstr2)) error stop + if (len(dt%pcstr2) /= 4) error stop + dt%pcstr2 = "HIJK" +!$omp end target +!$omp target exit data map(from: dt%pcstr2) +if (.not. associated(dt%pcstr2)) error stop +if (len(dt%pcstr2) /= 4) error stop +if (dt%pcstr2 /= "HIJK") error stop + + +! character(len=:,kind=4), pointer :: pc4str(:), pc4str2 +! allocate(character(len=3,kind=4) :: dt%pc4str(2:3)) +! allocate(character(len=5,kind=4) :: dt%pc4str2) + +!$omp target enter data map(alloc: dt%pc4str) +!$omp target map(alloc: dt%pc4str) + if (.not. associated(dt%pc4str)) error stop + if (len(dt%pc4str) /= 3) error stop + if (size(dt%pc4str) /= 2) error stop + if (lbound(dt%pc4str, 1) /= 2) error stop + if (ubound(dt%pc4str, 1) /= 3) error stop + dt%pc4str = [4_"456", 4_"tzu"] +!$omp end target +!$omp target exit data map(from: dt%pc4str) +if (.not. associated(dt%pc4str)) error stop +if (len(dt%pc4str) /= 3) error stop +if (size(dt%pc4str) /= 2) error stop +if (lbound(dt%pc4str, 1) /= 2) error stop +if (ubound(dt%pc4str, 1) /= 3) error stop +if (dt%pc4str(2) /= 4_"456") error stop +if (dt%pc4str(3) /= 4_"tzu") error stop + +!$omp target enter data map(alloc: dt%pc4str2) +!$omp target map(alloc: dt%pc4str2) + if (.not. associated(dt%pc4str2)) error stop + if (len(dt%pc4str2) /= 5) error stop + dt%pc4str2 = 4_"98765" +!$omp end target +!$omp target exit data map(from: dt%pc4str2) +if (.not. associated(dt%pc4str2)) error stop +if (len(dt%pc4str2) /= 5) error stop +if (dt%pc4str2 /= 4_"98765") error stop + + +! integer :: ii(5), ii2 + +!$omp target enter data map(alloc: ii) +!$omp target map(alloc: ii) + if (size(ii) /= 5) error stop + if (lbound(ii, 1) /= 1) error stop + if (ubound(ii, 1) /= 5) error stop + ii = [-1, -2, -3, -4, -5] +!$omp end target +!$omp target exit data map(from: ii) +if (size(ii) /= 5) error stop +if (lbound(ii, 1) /= 1) error stop +if (ubound(ii, 1) /= 5) error stop +if (any (ii /= [-1, -2, -3, -4, -5])) error stop + +!$omp target enter data map(alloc: ii2) +!$omp target map(alloc: ii2) + ii2 = -410 +!$omp end target +!$omp target exit data map(from: ii2) +if (ii2 /= -410) error stop + + +! character(len=11) :: clstr(-1:1), clstr2 + +!$omp target enter data map(alloc: clstr) +!$omp target map(alloc: clstr) + if (len(clstr) /= 11) error stop + if (size(clstr) /= 3) error stop + if (lbound(clstr, 1) /= -1) error stop + if (ubound(clstr, 1) /= 1) error stop + clstr = ["12345678901", "abcdefghijk", "ABCDEFGHIJK"] +!$omp end target +!$omp target exit data map(from: clstr) +if (len(clstr) /= 11) error stop +if (size(clstr) /= 3) error stop +if (lbound(clstr, 1) /= -1) error stop +if (ubound(clstr, 1) /= 1) error stop +if (any (clstr /= ["12345678901", "abcdefghijk", "ABCDEFGHIJK"])) error stop + +!$omp target enter data map(alloc: clstr2) +!$omp target map(alloc: clstr2) + if (len(clstr2) /= 11) error stop + clstr2 = "ABCDEFghijk" +!$omp end target +!$omp target exit data map(from: clstr2) +if (len(clstr2) /= 11) error stop +if (clstr2 /= "ABCDEFghijk") error stop + + +! character(len=11,kind=4) :: cl4str(0:3), cl4str2 + +!$omp target enter data map(alloc: cl4str) +!$omp target map(alloc: cl4str) + if (len(cl4str) /= 11) error stop + if (size(cl4str) /= 4) error stop + if (lbound(cl4str, 1) /= 0) error stop + if (ubound(cl4str, 1) /= 3) error stop + cl4str = [4_"12345678901", 4_"abcdefghijk", & + 4_"qerftcea6ds", 4_"a1f9g37ga4."] +!$omp end target +!$omp target exit data map(from: cl4str) +if (len(cl4str) /= 11) error stop +if (size(cl4str) /= 4) error stop +if (lbound(cl4str, 1) /= 0) error stop +if (ubound(cl4str, 1) /= 3) error stop +if (cl4str(0) /= 4_"12345678901") error stop +if (cl4str(1) /= 4_"abcdefghijk") error stop +if (cl4str(2) /= 4_"qerftcea6ds") error stop +if (cl4str(3) /= 4_"a1f9g37ga4.") error stop + +!$omp target enter data map(alloc: cl4str2) +!$omp target map(alloc: cl4str2) + if (len(cl4str2) /= 11) error stop + cl4str2 = 4_"ABCDEFGHIJK" +!$omp end target +!$omp target exit data map(from: cl4str2) +if (len(cl4str2) /= 11) error stop +if (cl4str2 /= 4_"ABCDEFGHIJK") error stop + + +! allocate(ip(5), ip2, ia(8), ia2) + +!$omp target enter data map(alloc: ip) +!$omp target map(alloc: ip) + if (.not. associated(ip)) error stop + if (size(ip) /= 5) error stop + if (lbound(ip, 1) /= 1) error stop + if (ubound(ip, 1) /= 5) error stop + ip = [11, 22, 33, 44, 55] +!$omp end target +!$omp target exit data map(from: ip) +if (.not. associated(ip)) error stop +if (size(ip) /= 5) error stop +if (lbound(ip, 1) /= 1) error stop +if (ubound(ip, 1) /= 5) error stop +if (any (ip /= [11, 22, 33, 44, 55])) error stop + +!$omp target enter data map(alloc: ip2) +!$omp target map(alloc: ip2) + if (.not. associated(ip2)) error stop + ip2 = 99 +!$omp end target +!$omp target exit data map(from: ip2) +if (ip2 /= 99) error stop +if (.not. associated(ip2)) error stop + + +! allocate(ip(5), ip2, ia(8), ia2) + +!$omp target enter data map(alloc: ia) +!$omp target map(alloc: ia) + if (.not. allocated(ia)) error stop + if (size(ia) /= 8) error stop + if (lbound(ia, 1) /= 1) error stop + if (ubound(ia, 1) /= 8) error stop + ia = [1,2,3,4,5,6,7,8] +!$omp end target +!$omp target exit data map(from: ia) +if (.not. allocated(ia)) error stop +if (size(ia) /= 8) error stop +if (lbound(ia, 1) /= 1) error stop +if (ubound(ia, 1) /= 8) error stop +if (any (ia /= [1,2,3,4,5,6,7,8])) error stop + +!$omp target enter data map(alloc: ia2) +!$omp target map(alloc: ia2) + if (.not. allocated(ia2)) error stop + ia2 = 102 +!$omp end target +!$omp target exit data map(from: ia2) +if (ia2 /= 102) error stop +if (.not. allocated(ia2)) error stop + + +! character(len=:), pointer :: pstr(:), pstr2 +! allocate(character(len=2) :: pstr(-2:0)) +! allocate(character(len=4) :: pstr2) + +!$omp target enter data map(alloc: pstr) +!$omp target map(alloc: pstr) + if (.not. associated(pstr)) error stop + if (len(pstr) /= 2) error stop + if (size(pstr) /= 3) error stop + if (lbound(pstr, 1) /= -2) error stop + if (ubound(pstr, 1) /= 0) error stop + pstr = ["01", "jk", "aq"] +!$omp end target +!$omp target exit data map(from: pstr) +if (.not. associated(pstr)) error stop +if (len(pstr) /= 2) error stop +if (size(pstr) /= 3) error stop +if (lbound(pstr, 1) /= -2) error stop +if (ubound(pstr, 1) /= 0) error stop +if (any (pstr /= ["01", "jk", "aq"])) error stop + +!$omp target enter data map(alloc: pstr2) +!$omp target map(alloc: pstr2) + if (.not. associated(pstr2)) error stop + if (len(pstr2) /= 4) error stop + pstr2 = "HIJK" +!$omp end target +!$omp target exit data map(from: pstr2) +if (.not. associated(pstr2)) error stop +if (len(pstr2) /= 4) error stop +if (pstr2 /= "HIJK") error stop + + +! character(len=:), allocatable :: astr(:), astr2 +! allocate(character(len=6) :: astr(3:5)) +! allocate(character(len=8) :: astr2) + + +!$omp target enter data map(alloc: astr) +!$omp target map(alloc: astr) + if (.not. allocated(astr)) error stop + if (len(astr) /= 6) error stop + if (size(astr) /= 3) error stop + if (lbound(astr, 1) /= 3) error stop + if (ubound(astr, 1) /= 5) error stop + astr = ["01db45", "jk$D%S", "zutg47"] +!$omp end target +!$omp target exit data map(from: astr) +if (.not. allocated(astr)) error stop +if (len(astr) /= 6) error stop +if (size(astr) /= 3) error stop +if (lbound(astr, 1) /= 3) error stop +if (ubound(astr, 1) /= 5) error stop +if (any (astr /= ["01db45", "jk$D%S", "zutg47"])) error stop + + +!$omp target enter data map(alloc: astr2) +!$omp target map(alloc: astr2) + if (.not. allocated(astr2)) error stop + if (len(astr2) /= 8) error stop + astr2 = "HIJKhijk" +!$omp end target +!$omp target exit data map(from: astr2) +if (.not. allocated(astr2)) error stop +if (len(astr2) /= 8) error stop +if (astr2 /= "HIJKhijk") error stop + + +! character(len=:,kind=4), pointer :: p4str(:), p4str2 +! allocate(character(len=3,kind=4) :: p4str(2:4)) +! allocate(character(len=5,kind=4) :: p4str2) + +! FAILS with value check + +!$omp target enter data map(alloc: p4str) +!$omp target map(alloc: p4str) + if (.not. associated(p4str)) error stop + if (len(p4str) /= 3) error stop + if (size(p4str) /= 3) error stop + if (lbound(p4str, 1) /= 2) error stop + if (ubound(p4str, 1) /= 4) error stop + p4str(:) = [4_"f85", 4_"8af", 4_"A%F"] +!$omp end target +!$omp target exit data map(from: p4str) +if (.not. associated(p4str)) error stop +if (len(p4str) /= 3) error stop +if (size(p4str) /= 3) error stop +if (lbound(p4str, 1) /= 2) error stop +if (ubound(p4str, 1) /= 4) error stop +if (p4str(2) /= 4_"f85") error stop +if (p4str(3) /= 4_"8af") error stop +if (p4str(4) /= 4_"A%F") error stop + +!$omp target enter data map(alloc: p4str2) +!$omp target map(alloc: p4str2) + if (.not. associated(p4str2)) error stop + if (len(p4str2) /= 5) error stop + p4str2 = 4_"9875a" +!$omp end target +!$omp target exit data map(from: p4str2) +if (.not. associated(p4str2)) error stop +if (len(p4str2) /= 5) error stop +if (p4str2 /= 4_"9875a") error stop + + +! character(len=:,kind=4), allocatable :: a4str(:), a4str2 +! allocate(character(len=7,kind=4) :: a4str(-2:3)) +! allocate(character(len=9,kind=4) :: a4str2) + +!$omp target enter data map(alloc: a4str) +!$omp target map(alloc: a4str) + if (.not. allocated(a4str)) error stop + if (len(a4str) /= 7) error stop + if (size(a4str) /= 6) error stop + if (lbound(a4str, 1) /= -2) error stop + if (ubound(a4str, 1) /= 3) error stop + ! See PR fortran/107508 why '(:)' is required + a4str(:) = [4_"sf456aq", 4_"3dtzu24", 4_"_4fh7sm", 4_"=ff85s7", 4_"j=8af4d", 4_".,A%Fsz"] +!$omp end target +!$omp target exit data map(from: a4str) +if (.not. allocated(a4str)) error stop +if (len(a4str) /= 7) error stop +if (size(a4str) /= 6) error stop +if (lbound(a4str, 1) /= -2) error stop +if (ubound(a4str, 1) /= 3) error stop +if (a4str(-2) /= 4_"sf456aq") error stop +if (a4str(-1) /= 4_"3dtzu24") error stop +if (a4str(0) /= 4_"_4fh7sm") error stop +if (a4str(1) /= 4_"=ff85s7") error stop +if (a4str(2) /= 4_"j=8af4d") error stop +if (a4str(3) /= 4_".,A%Fsz") error stop + +!$omp target enter data map(alloc: a4str2) +!$omp target map(alloc: a4str2) + if (.not. allocated(a4str2)) error stop + if (len(a4str2) /= 9) error stop + a4str2 = 4_"98765a23d" +!$omp end target +!$omp target exit data map(from: a4str2) +if (.not. allocated(a4str2)) error stop +if (len(a4str2) /= 9) error stop +if (a4str2 /= 4_"98765a23d") error stop + + +deallocate(dt%pc, dt%pc2) +deallocate(dt%pcstr) +deallocate(dt%pcstr2) + +deallocate(dt%pc4str) +deallocate(dt%pc4str2) + +deallocate(ip, ip2, ia, ia2) +deallocate(pstr) +deallocate(pstr2) +deallocate(astr) +deallocate(astr2) + +deallocate(p4str) +deallocate(p4str2) +deallocate(a4str) +deallocate(a4str2) + +end diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ac09899..311212d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,144 @@ +2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + * include/std/ranges (_ZipTransform::operator()): Remove name of + unused parameter. + (chunk_view::_Iterator, stride_view::_Iterator): Likewise. + (join_with_view): Declare _Iterator and _Sentinel as class + instead of struct. + (repeat_view): Declare _Iterator as class instead of struct. + +2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120293 + * include/bits/chrono_io.h (_M_format_to_ostream): Add special + case for local_time convertible to local_days. + * testsuite/std/time/clock/local/io.cc: Check formatting of + chrono::local_days. + +2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-06 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120029 + * src/c++17/fs_path.cc (path::operator+=(const path&)): Handle + parameters that alias the path or one of its components. + * testsuite/27_io/filesystem/path/concat/120029.cc: New test. + * testsuite/experimental/filesystem/path/concat/120029.cc: New + test. + +2025-05-19 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-15 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120190 + * include/std/format (format_kind): Adjust primary template to + not depend on itself. + * testsuite/std/format/ranges/format_kind_neg.cc: Adjust + expected errors. Check more invalid specializations. + +2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120187 + * include/c_global/ciso646: Only give deprecated warning for + C++20 and later. + * include/c_global/ccomplex: Add @since to Doxygen comment. + * include/c_global/cstdalign: Likewise. + * include/c_global/cstdbool: Likewise. + * include/c_global/ctgmath: Likewise. + * testsuite/18_support/headers/ciso646/macros.cc: Remove + dg-warning for c++17_only effective target. + * testsuite/18_support/headers/ciso646/macros-2.cc: New test. + +2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/120198 + * include/bits/version.def (scoped_lock): Do not depend on + gthreads or hosted. + * include/bits/version.h: Regenerate. + * include/std/mutex (scoped_lock): Update comment. + * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: + Remove dg-require-gthreads and use custom lockable type instead + of std::mutex. Check that typedef is only present for a single + template argument. + +2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + * doc/xml/manual/status_cxx2023.xml: Update status of proposals + implemented after GCC 14.2 release. + * doc/html/*: Regenerate. + +2025-05-12 Patrick Palka <ppalka@redhat.com> + + Backported from master: + 2025-05-12 Patrick Palka <ppalka@redhat.com> + + PR libstdc++/119714 + PR libstdc++/112490 + * include/std/expected (expected::operator==): Replace + non-dependent std::expected function parameter with a dependent + one of type expected<_Vp, _Er> where _Vp matches _Tp. + * testsuite/20_util/expected/119714.cc: New test. + +2025-05-12 Patrick Palka <ppalka@redhat.com> + + Backported from master: + 2025-04-29 Patrick Palka <ppalka@redhat.com> + + PR libstdc++/119427 + * include/std/flat_map (_Flat_map_impl::erase_if): Replace + this hidden friend with ... + (_Flat_map_impl::_M_erase_if): ... this member function. + (flat_map): Export _Flat_map_impl::_M_erase_if. + (erase_if(flat_map)): Define. + (flat_multimap): Export _Flat_map_impl::_M_erase_if. + (erase_if(flat_multimap)): Define. + * include/std/flat_set (_Flat_set_impl::erase_if): Replace + with ... + (_Flat_set_impl::_M_erase_if): ... this member function. + (flat_set): Export _Flat_set_impl::_M_erase_if. + (erase_if(flat_set)): Define. + (flat_multiset): Export _Flat_set_impl::_M_erase_if. + (erase_if(flat_multiset)): Define. + * testsuite/23_containers/flat_map/1.cc (test07): New test. + * testsuite/23_containers/flat_multimap/1.cc (test07): New test. + * testsuite/23_containers/flat_multiset/1.cc (test09): New test. + * testsuite/23_containers/flat_set/1.cc (test09): New test. + +2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/118260 + * python/hook.in: Suppress output from gdb.execute calls to + register skips. + +2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + Backported from master: + 2025-05-12 Jonathan Wakely <jwakely@redhat.com> + + * doc/xml/manual/status_cxx2017.xml: Update status for + std::to_chars and std::from_chars. + * doc/html/manual/*: Regenerate. + 2025-05-07 Jonathan Wakely <jwakely@redhat.com> Backported from master: diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html index 5075558..9bd477f 100644 --- a/libstdc++-v3/doc/html/faq.html +++ b/libstdc++-v3/doc/html/faq.html @@ -796,7 +796,7 @@ Libstdc++-v3 incorporates a lot of code from <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/" target="_top">the SGI STL</a> (the final merge was from - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/whats_new.html" target="_top">release 3.3</a>). + <a class="link" href="https://web.archive.org/web/20171206110416/http://www.sgi.com/tech/stl/whats_new.html" target="_top">release 3.3</a>). The code in libstdc++ contains many fixes and changes compared to the original SGI code. </p><p> diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html index 7035a94..dcd609a 100644 --- a/libstdc++-v3/doc/html/manual/containers.html +++ b/libstdc++-v3/doc/html/manual/containers.html @@ -11,7 +11,7 @@ Yes it is, at least using the <a class="link" href="using_dual_abi.html" title="Dual ABI">old ABI</a>, and that's okay. This is a decision that we preserved when we imported SGI's STL implementation. The following is - quoted from <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/FAQ.html" target="_top">their FAQ</a>: + quoted from <a class="link" href="https://web.archive.org/web/20161222192301/http://www.sgi.com/tech/stl/FAQ.html" target="_top">their FAQ</a>: </p><div class="blockquote"><blockquote class="blockquote"><p> The size() member function, for list and slist, takes time proportional to the number of elements in the list. This was a diff --git a/libstdc++-v3/doc/html/manual/ext_numerics.html b/libstdc++-v3/doc/html/manual/ext_numerics.html index 9b864e1..c3a5623 100644 --- a/libstdc++-v3/doc/html/manual/ext_numerics.html +++ b/libstdc++-v3/doc/html/manual/ext_numerics.html @@ -14,7 +14,7 @@ The operation functor must be associative. </p><p>The <code class="code">iota</code> function wins the award for Extension With the Coolest Name (the name comes from Ken Iverson's APL language.) As - described in the <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/iota.html" target="_top">SGI + described in the <a class="link" href="https://web.archive.org/web/20170201044840/http://www.sgi.com/tech/stl/iota.html" target="_top">SGI documentation</a>, it "assigns sequentially increasing values to a range. That is, it assigns <code class="code">value</code> to <code class="code">*first</code>, <code class="code">value + 1</code> to<code class="code"> *(first + 1)</code> and so on." diff --git a/libstdc++-v3/doc/html/manual/ext_sgi.html b/libstdc++-v3/doc/html/manual/ext_sgi.html index ae20629..2310857 100644 --- a/libstdc++-v3/doc/html/manual/ext_sgi.html +++ b/libstdc++-v3/doc/html/manual/ext_sgi.html @@ -28,12 +28,12 @@ and sets. </p><p>Each of the associative containers map, multimap, set, and multiset have a counterpart which uses a - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/HashFunction.html" target="_top">hashing + <a class="link" href="https://web.archive.org/web/20171230172024/http://www.sgi.com/tech/stl/HashFunction.html" target="_top">hashing function</a> to do the arranging, instead of a strict weak ordering function. The classes take as one of their template parameters a function object that will return the hash value; by default, an instantiation of - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/hash.html" target="_top">hash</a>. + <a class="link" href="https://web.archive.org/web/20171230172200/http://www.sgi.com/tech/stl/hash.html" target="_top">hash</a>. You should specialize this functor for your class, or define your own, before trying to use one of the hashing classes. </p><p>The hashing classes support all the usual associative container diff --git a/libstdc++-v3/doc/html/manual/using_concurrency.html b/libstdc++-v3/doc/html/manual/using_concurrency.html index d570d3a..98875f3 100644 --- a/libstdc++-v3/doc/html/manual/using_concurrency.html +++ b/libstdc++-v3/doc/html/manual/using_concurrency.html @@ -40,7 +40,7 @@ The standard places requirements on the library to ensure that no data races are caused by the library itself or by programs which use the library correctly (as described below). The C++11 memory model and library requirements are a more formal version -of the <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html" target="_top">SGI STL</a> definition of thread safety, which the library used +of the <a class="link" href="https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html" target="_top">SGI STL</a> definition of thread safety, which the library used prior to the 2011 standard. </p><p>The library strives to be thread-safe when all of the following conditions are met: @@ -243,10 +243,10 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) threaded and non-threaded code), see Chapter 17. </p><p>Two excellent pages to read when working with the Standard C++ containers and threads are - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html" target="_top">SGI's - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html</a> and - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/Allocators.html" target="_top">SGI's - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/Allocators.html</a>. + <a class="link" href="https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html" target="_top">SGI's + https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html</a> and + <a class="link" href="https://web.archive.org/web/20171108142526/http://www.sgi.com/tech/stl/Allocators.html" target="_top">SGI's + https://web.archive.org/web/20171108142526/http://www.sgi.com/tech/stl/Allocators.html</a>. </p><p><span class="emphasis"><em>However, please ignore all discussions about the user-level configuration of the lock implementation inside the STL container-memory allocator on those pages. For the sake of this diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html index 15c9a9d..1216b72 100644 --- a/libstdc++-v3/doc/html/manual/utilities.html +++ b/libstdc++-v3/doc/html/manual/utilities.html @@ -11,6 +11,6 @@ get slightly the wrong idea. In the interest of not reinventing the wheel, we will refer you to the introduction to the functor concept written by SGI as part of their STL, in - <a class="link" href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/functors.html" target="_top">their - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/functors.html</a>. + <a class="link" href="https://web.archive.org/web/20171209002754/http://www.sgi.com/tech/stl/functors.html" target="_top">their + https://web.archive.org/web/20171209002754/http://www.sgi.com/tech/stl/functors.html</a>. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="concept_checking.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="std_contents.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Concept Checking </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Pairs</td></tr></table></div></body></html>
\ No newline at end of file diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml index bccbb98..a1d6a21 100644 --- a/libstdc++-v3/doc/xml/faq.xml +++ b/libstdc++-v3/doc/xml/faq.xml @@ -1130,7 +1130,7 @@ Libstdc++-v3 incorporates a lot of code from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/">the SGI STL</link> (the final merge was from - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/whats_new.html">release 3.3</link>). + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171206110416/http://www.sgi.com/tech/stl/whats_new.html">release 3.3</link>). The code in libstdc++ contains many fixes and changes compared to the original SGI code. </para> diff --git a/libstdc++-v3/doc/xml/manual/containers.xml b/libstdc++-v3/doc/xml/manual/containers.xml index 6d9a387..1758762 100644 --- a/libstdc++-v3/doc/xml/manual/containers.xml +++ b/libstdc++-v3/doc/xml/manual/containers.xml @@ -28,7 +28,7 @@ Yes it is, at least using the <link linkend="manual.intro.using.abi">old ABI</link>, and that's okay. This is a decision that we preserved when we imported SGI's STL implementation. The following is - quoted from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/FAQ.html">their FAQ</link>: + quoted from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20161222192301/http://www.sgi.com/tech/stl/FAQ.html">their FAQ</link>: </para> <blockquote> <para> diff --git a/libstdc++-v3/doc/xml/manual/extensions.xml b/libstdc++-v3/doc/xml/manual/extensions.xml index d0460b0..a8b7088 100644 --- a/libstdc++-v3/doc/xml/manual/extensions.xml +++ b/libstdc++-v3/doc/xml/manual/extensions.xml @@ -227,12 +227,12 @@ extensions, be aware of two things: </para> <para>Each of the associative containers map, multimap, set, and multiset have a counterpart which uses a - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/HashFunction.html">hashing + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171230172024/http://www.sgi.com/tech/stl/HashFunction.html">hashing function</link> to do the arranging, instead of a strict weak ordering function. The classes take as one of their template parameters a function object that will return the hash value; by default, an instantiation of - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/hash.html">hash</link>. + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171230172200/http://www.sgi.com/tech/stl/hash.html">hash</link>. You should specialize this functor for your class, or define your own, before trying to use one of the hashing classes. </para> @@ -394,7 +394,7 @@ get_temporary_buffer(5, (int*)0); </para> <para>The <code>iota</code> function wins the award for Extension With the Coolest Name (the name comes from Ken Iverson's APL language.) As - described in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/iota.html">SGI + described in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20170201044840/http://www.sgi.com/tech/stl/iota.html">SGI documentation</link>, it "assigns sequentially increasing values to a range. That is, it assigns <code>value</code> to <code>*first</code>, <code>value + 1</code> to<code> *(first + 1)</code> and so on." diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml index bf92c49..4b8f53d 100644 --- a/libstdc++-v3/doc/xml/manual/using.xml +++ b/libstdc++-v3/doc/xml/manual/using.xml @@ -1951,7 +1951,7 @@ The standard places requirements on the library to ensure that no data races are caused by the library itself or by programs which use the library correctly (as described below). The C++11 memory model and library requirements are a more formal version -of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</link> definition of thread safety, which the library used +of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html">SGI STL</link> definition of thread safety, which the library used prior to the 2011 standard. </para> @@ -2236,10 +2236,10 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) </para> <para>Two excellent pages to read when working with the Standard C++ containers and threads are - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html">SGI's - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/thread_safety.html</link> and - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/Allocators.html">SGI's - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/Allocators.html</link>. + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html">SGI's + https://web.archive.org/web/20171221154911/http://www.sgi.com/tech/stl/thread_safety.html</link> and + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171108142526/http://www.sgi.com/tech/stl/Allocators.html">SGI's + https://web.archive.org/web/20171108142526/http://www.sgi.com/tech/stl/Allocators.html</link>. </para> <para><emphasis>However, please ignore all discussions about the user-level configuration of the lock implementation inside the STL diff --git a/libstdc++-v3/doc/xml/manual/utilities.xml b/libstdc++-v3/doc/xml/manual/utilities.xml index e155c8c..c2e013e 100644 --- a/libstdc++-v3/doc/xml/manual/utilities.xml +++ b/libstdc++-v3/doc/xml/manual/utilities.xml @@ -22,8 +22,8 @@ get slightly the wrong idea. In the interest of not reinventing the wheel, we will refer you to the introduction to the functor concept written by SGI as part of their STL, in - <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/functors.html">their - https://web.archive.org/web/20171225062613/http://www.sgi.com/tech/stl/functors.html</link>. + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://web.archive.org/web/20171209002754/http://www.sgi.com/tech/stl/functors.html">their + https://web.archive.org/web/20171209002754/http://www.sgi.com/tech/stl/functors.html</link>. </para> </section> diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h index f5aa8a3..7ab989f 100644 --- a/libstdc++-v3/include/bits/chrono_io.h +++ b/libstdc++-v3/include/bits/chrono_io.h @@ -782,6 +782,9 @@ namespace __format // sys_time with period greater or equal to days: if constexpr (is_convertible_v<_Tp, chrono::sys_days>) __os << _S_date(__t); + // Or a local_time with period greater or equal to days: + else if constexpr (is_convertible_v<_Tp, chrono::local_days>) + __os << _S_date(__t); else // Or it's formatted as "{:L%F %T}": { auto __days = chrono::floor<chrono::days>(__t); diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def index 737b3f4..a08b0b9 100644 --- a/libstdc++-v3/include/bits/version.def +++ b/libstdc++-v3/include/bits/version.def @@ -679,8 +679,6 @@ ftms = { values = { v = 201703; cxxmin = 17; - hosted = yes; - gthread = yes; }; }; diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h index 59ff0ce..3f1562c 100644 --- a/libstdc++-v3/include/bits/version.h +++ b/libstdc++-v3/include/bits/version.h @@ -751,7 +751,7 @@ #undef __glibcxx_want_parallel_algorithm #if !defined(__cpp_lib_scoped_lock) -# if (__cplusplus >= 201703L) && defined(_GLIBCXX_HAS_GTHREADS) && _GLIBCXX_HOSTED +# if (__cplusplus >= 201703L) # define __glibcxx_scoped_lock 201703L # if defined(__glibcxx_want_all) || defined(__glibcxx_want_scoped_lock) # define __cpp_lib_scoped_lock 201703L diff --git a/libstdc++-v3/include/c_global/ccomplex b/libstdc++-v3/include/c_global/ccomplex index 7044cf7..a39273f 100644 --- a/libstdc++-v3/include/c_global/ccomplex +++ b/libstdc++-v3/include/c_global/ccomplex @@ -24,6 +24,8 @@ /** @file include/ccomplex * This is a Standard C++ Library header. + * + * @since C++11 (removed in C++20) */ #ifndef _GLIBCXX_CCOMPLEX diff --git a/libstdc++-v3/include/c_global/ciso646 b/libstdc++-v3/include/c_global/ciso646 index a663e04..6dec7df 100644 --- a/libstdc++-v3/include/c_global/ciso646 +++ b/libstdc++-v3/include/c_global/ciso646 @@ -28,6 +28,8 @@ * * This is the C++ version of the Standard C Library header @c iso646.h, * which is empty in C++. + * + * @since C++11 (removed in C++20) */ #ifndef _GLIBCXX_CISO646 #define _GLIBCXX_CISO646 @@ -38,13 +40,15 @@ #include <bits/c++config.h> -#if __cplusplus >= 202002L && ! _GLIBCXX_USE_DEPRECATED -# error "<ciso646> is not a standard header in C++20, use <version> to detect implementation-specific macros" -#elif __cplusplus >= 201703L && defined __DEPRECATED -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wc++23-extensions" -# warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" -# pragma GCC diagnostic pop +#if __cplusplus >= 202002L +# if ! _GLIBCXX_USE_DEPRECATED +# error "<ciso646> is not a standard header since C++20, use <version> to detect implementation-specific macros" +# elif defined __DEPRECATED +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wc++23-extensions" +# warning "<ciso646> is not a standard header since C++20, use <version> to detect implementation-specific macros" +# pragma GCC diagnostic pop +# endif #endif #endif diff --git a/libstdc++-v3/include/c_global/cstdalign b/libstdc++-v3/include/c_global/cstdalign index 92e0ad6..41ce506 100644 --- a/libstdc++-v3/include/c_global/cstdalign +++ b/libstdc++-v3/include/c_global/cstdalign @@ -24,6 +24,8 @@ /** @file include/cstdalign * This is a Standard C++ Library header. + * + * @since C++11 (removed in C++20) */ #ifndef _GLIBCXX_CSTDALIGN diff --git a/libstdc++-v3/include/c_global/cstdbool b/libstdc++-v3/include/c_global/cstdbool index e75f56c..5933d7d 100644 --- a/libstdc++-v3/include/c_global/cstdbool +++ b/libstdc++-v3/include/c_global/cstdbool @@ -24,6 +24,8 @@ /** @file include/cstdbool * This is a Standard C++ Library header. + * + * @since C++11 (removed in C++20) */ #ifndef _GLIBCXX_CSTDBOOL diff --git a/libstdc++-v3/include/c_global/ctgmath b/libstdc++-v3/include/c_global/ctgmath index 0a5a0e7..b708878 100644 --- a/libstdc++-v3/include/c_global/ctgmath +++ b/libstdc++-v3/include/c_global/ctgmath @@ -24,6 +24,8 @@ /** @file include/ctgmath * This is a Standard C++ Library header. + * + * @since C++11 (removed in C++20) */ #ifndef _GLIBCXX_CTGMATH diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 7d30670..8beef93 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -5111,13 +5111,22 @@ namespace __format debug_string }; - /// @cond undocumented + /** @brief A constant determining how a range should be formatted. + * + * The primary template of `std::format_kind` cannot be instantiated. + * There is a partial specialization for input ranges and you can + * specialize the variable template for your own cv-unqualified types + * that satisfy the `ranges::input_range` concept. + * + * @since C++23 + */ template<typename _Rg> - constexpr auto format_kind = - __primary_template_not_defined( - format_kind<_Rg> // you can specialize this for non-const input ranges - ); + constexpr auto format_kind = []{ + static_assert(false, "cannot use primary template of 'std::format_kind'"); + return type_identity<_Rg>{}; + }(); + /// @cond undocumented template<typename _Tp> consteval range_format __fmt_kind() diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index b3f89c0..e575a81 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -733,7 +733,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } -#ifdef __cpp_lib_scoped_lock // C++ >= 17 && hosted && gthread +#ifdef __cpp_lib_scoped_lock // C++ >= 17 /** @brief A scoped lock type for multiple lockable objects. * * A scoped_lock controls mutex ownership within a scope, releasing diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 9300c36..210ac82 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -5336,7 +5336,7 @@ namespace views::__adaptor requires move_constructible<decay_t<_Fp>> && regular_invocable<decay_t<_Fp>&> && is_object_v<decay_t<invoke_result_t<decay_t<_Fp>&>>> constexpr auto - operator() [[nodiscard]] (_Fp&& __f) const + operator() [[nodiscard]] (_Fp&&) const { return views::empty<decay_t<invoke_result_t<decay_t<_Fp>&>>>; } @@ -6598,7 +6598,7 @@ namespace views::__adaptor } friend constexpr difference_type - operator-(default_sentinel_t __y, const _Iterator& __x) + operator-(default_sentinel_t, const _Iterator& __x) requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>> { return __detail::__div_ceil(__x._M_end - __x._M_current, __x._M_n); } @@ -7287,8 +7287,8 @@ namespace views::__adaptor using iterator_category = decltype(_S_iter_cat()); }; - template<bool> struct _Iterator; - template<bool> struct _Sentinel; + template<bool> class _Iterator; + template<bool> class _Sentinel; public: join_with_view() requires (default_initializable<_Vp> @@ -7743,7 +7743,7 @@ namespace views::__adaptor __detail::__box<_Tp> _M_value; [[no_unique_address]] _Bound _M_bound = _Bound(); - struct _Iterator; + class _Iterator; template<typename _Range> friend constexpr auto @@ -8303,7 +8303,7 @@ namespace views::__adaptor } friend constexpr difference_type - operator-(default_sentinel_t __y, const _Iterator& __x) + operator-(default_sentinel_t, const _Iterator& __x) requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>> { return __detail::__div_ceil(__x._M_end - __x._M_current, __x._M_stride); } diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc index 6582f10..215afa0 100644 --- a/libstdc++-v3/src/c++17/fs_path.cc +++ b/libstdc++-v3/src/c++17/fs_path.cc @@ -880,6 +880,16 @@ path::operator+=(const path& p) return *this; } + // Handle p += p which would otherwise access dangling pointers after + // reallocating _M_cmpts and _M_pathname. + if (&p == this) [[unlikely]] + return *this += p.native(); + // Handle p += *i where i is in [p.begin(),p.end()), for the same reason. + if (_M_type() == _Type::_Multi && p._M_type() != _Type::_Multi) + for (const path& cmpt : *this) + if (&cmpt == &p) [[unlikely]] + return *this += p.native(); + #if _GLIBCXX_FILESYSTEM_IS_WINDOWS if (_M_type() == _Type::_Root_name || (_M_type() == _Type::_Filename && _M_pathname.size() == 1)) diff --git a/libstdc++-v3/testsuite/18_support/headers/ciso646/macros-2.cc b/libstdc++-v3/testsuite/18_support/headers/ciso646/macros-2.cc new file mode 100644 index 0000000..a492924 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/headers/ciso646/macros-2.cc @@ -0,0 +1,7 @@ +// { dg-options " -Wdeprecated -fno-operator-names" } +// { dg-do preprocess } + +// Should get a warning for C++20 and up without -D_GLIBCXX_USE_DEPRECATED=0 +// { dg-warning "not a standard header" "" { target c++20 } 0 } + +#include "macros.cc" diff --git a/libstdc++-v3/testsuite/18_support/headers/ciso646/macros.cc b/libstdc++-v3/testsuite/18_support/headers/ciso646/macros.cc index ab3a041..0cb5168 100644 --- a/libstdc++-v3/testsuite/18_support/headers/ciso646/macros.cc +++ b/libstdc++-v3/testsuite/18_support/headers/ciso646/macros.cc @@ -3,7 +3,6 @@ #include <ciso646> -// { dg-warning "deprecated" "" { target c++17_only } 0 } // { dg-error "not a standard header" "" { target c++20 } 0 } #ifdef and diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/concat/120029.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/120029.cc new file mode 100644 index 0000000..5153d59 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/concat/120029.cc @@ -0,0 +1,72 @@ +// { dg-do run { target c++17 } } + +// Bug libstdc++/120029 +// Dangling iterator usage in path::operator+=(const path& p) when this == p + +#include <filesystem> +#include <testsuite_hooks.h> + +namespace fs = std::filesystem; + +void +test_root_dir() +{ + fs::path p = "/"; + p += p; + p += p; + VERIFY( p == "////" ); + p += p.filename(); + VERIFY( p == "////" ); + p += *std::prev(p.end()); + VERIFY( p == "////" ); +} + +void +test_root_name() +{ + fs::path p = "C:/"; + p += p; + p += p; + VERIFY( p == "C:/C:/C:/C:/" ); + p += p.filename(); + VERIFY( p == "C:/C:/C:/C:/" ); + p += *std::prev(p.end()); + VERIFY( p == "C:/C:/C:/C:/" ); +} + +void +test_filename() +{ + fs::path p = "file"; + p += p; + p += p; + VERIFY( p == "filefilefilefile" ); + p += p.filename(); + VERIFY( p == "filefilefilefilefilefilefilefile" ); + p += *std::prev(p.end()); + VERIFY( p == "filefilefilefilefilefilefilefilefilefilefilefilefilefilefilefile" ); +} + +void +test_multi() +{ + fs::path p = "/home/username/Documents/mu"; + p += p; + p += p; + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu" ); + p += p.filename(); + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mumu" ); + p += *std::prev(p.end()); + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mumumumu" ); + auto n = std::distance(p.begin(), p.end()); + for (int i = 0; i < n; ++i) + p += *std::next(p.begin(), i); +} + +int main() +{ + test_root_dir(); + test_root_name(); + test_filename(); + test_multi(); +} diff --git a/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc b/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc index 4cd07da..ba52b36 100644 --- a/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc @@ -1,5 +1,4 @@ // { dg-do compile { target c++17 } } -// { dg-require-gthreads "" } // { dg-add-options no_pch } // Copyright (C) 2017-2025 Free Software Foundation, Inc. @@ -29,9 +28,30 @@ # error "Feature-test macro for scoped_lock has wrong value" #endif +struct BasicLockable +{ + BasicLockable() = default; + ~BasicLockable() = default; + void lock() { } + void unlock() { } +}; + void test01() { - // Check for required typedefs - typedef std::scoped_lock<std::mutex> test_type; - typedef test_type::mutex_type mutex_type; + // Check for required typedef. + using test_type = std::scoped_lock<BasicLockable>; + static_assert(std::is_same_v<test_type::mutex_type, BasicLockable>); +} + +template<typename T, typename = void> +constexpr bool has_mutex_type = false; + +template<typename T> +constexpr bool has_mutex_type<T, std::void_t<typename T::mutex_type>> = true; + +void test02() +{ + // Check that typedef is absent as required. + using test_type = std::scoped_lock<BasicLockable, BasicLockable>; + static_assert(!has_mutex_type<test_type>); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/concat/120029.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/120029.cc new file mode 100644 index 0000000..209d968 --- /dev/null +++ b/libstdc++-v3/testsuite/experimental/filesystem/path/concat/120029.cc @@ -0,0 +1,74 @@ +// { dg-options "-DUSE_FILESYSTEM_TS -lstdc++fs" } +// { dg-do run { target c++11 } } +// { dg-require-filesystem-ts "" } + +// Bug libstdc++/120029 +// Dangling iterator usage in path::operator+=(const path& p) when this == p + +#include <experimental/filesystem> +#include <testsuite_hooks.h> + +namespace fs = std::experimental::filesystem; + +void +test_root_dir() +{ + fs::path p = "/"; + p += p; + p += p; + VERIFY( p == "////" ); + p += p.filename(); + VERIFY( p == "////////" ); + p += *std::prev(p.end()); + VERIFY( p == "////////////////" ); +} + +void +test_root_name() +{ + fs::path p = "C:/"; + p += p; + p += p; + VERIFY( p == "C:/C:/C:/C:/" ); + p += p.filename(); // For Filesystem TS the filename is "." + VERIFY( p == "C:/C:/C:/C:/." ); + p += *std::prev(p.end()); + VERIFY( p == "C:/C:/C:/C:/.." ); +} + +void +test_filename() +{ + fs::path p = "file"; + p += p; + p += p; + VERIFY( p == "filefilefilefile" ); + p += p.filename(); + VERIFY( p == "filefilefilefilefilefilefilefile" ); + p += *std::prev(p.end()); + VERIFY( p == "filefilefilefilefilefilefilefilefilefilefilefilefilefilefilefile" ); +} + +void +test_multi() +{ + fs::path p = "/home/username/Documents/mu"; + p += p; + p += p; + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu" ); + p += p.filename(); + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mumu" ); + p += *std::prev(p.end()); + VERIFY( p == "/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mu/home/username/Documents/mumumumu" ); + auto n = std::distance(p.begin(), p.end()); + for (int i = 0; i < n; ++i) + p += *std::next(p.begin(), i); +} + +int main() +{ + test_root_dir(); + test_root_name(); + test_filename(); + test_multi(); +} diff --git a/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc index bf8619d..0d761ae 100644 --- a/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc +++ b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc @@ -5,9 +5,14 @@ #include <format> -template<auto> struct Tester { }; +void test() +{ + (void) std::format_kind<void>; // { dg-error "here" } + (void) std::format_kind<const void>; // { dg-error "here" } + (void) std::format_kind<int>; // { dg-error "here" } + (void) std::format_kind<int&>; // { dg-error "here" } + (void) std::format_kind<const int(&)[10]>; // { dg-error "here" } + (void) std::format_kind<void()>; // { dg-error "here" } +} -Tester<std::format_kind<const int(&)[1]>> t; // { dg-error "here" } - -// { dg-error "use of 'std::format_kind" "" { target *-*-* } 0 } -// { dg-error "primary_template_not_defined" "" { target *-*-* } 0 } +// { dg-error "cannot use primary template of 'std::format_kind'" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/std/time/clock/local/io.cc b/libstdc++-v3/testsuite/std/time/clock/local/io.cc index b4d562f..67818e8 100644 --- a/libstdc++-v3/testsuite/std/time/clock/local/io.cc +++ b/libstdc++-v3/testsuite/std/time/clock/local/io.cc @@ -89,6 +89,9 @@ test_format() s = std::format("{}", local_seconds{}); VERIFY( s == "1970-01-01 00:00:00" ); + + s = std::format("{}", local_days{}); // PR libstdc++/120293 + VERIFY( s == "1970-01-01" ); } void |