From c9e3181516f1c0786f81b9c813581bf986a6300a Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 12 May 2025 11:53:03 -0400 Subject: c+: -Wabi false positive [PR120012] The warning compares the position of a field depending on whether or not the previous base/field is considered a POD for layout, but failed to consider whether the previous base/field is empty; layout of an empty base doesn't consider PODness. PR c++/120012 gcc/cp/ChangeLog: * class.cc (check_non_pod_aggregate): Check is_empty_class. gcc/testsuite/ChangeLog: * g++.dg/abi/base-defaulted2.C: New test. (cherry picked from commit b4b4dfbd22e06877052bd4cc4b191d9d138155cf) --- gcc/cp/class.cc | 6 ++++-- gcc/testsuite/g++.dg/abi/base-defaulted2.C | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/abi/base-defaulted2.C (limited to 'gcc') 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/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" } +}; -- cgit v1.1 From 530380a0af7f620d5c113b963527fe0e3030c058 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 13 May 2025 00:24:47 +0000 Subject: Daily bump. --- gcc/DATESTAMP | 2 +- gcc/cp/ChangeLog | 8 ++++++++ gcc/po/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 823f45b..83f5cb2 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250512 +20250513 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f950c61..377d1ba 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2025-05-12 Jason Merrill + + Backported from master: + 2025-05-12 Jason Merrill + + PR c++/120012 + * class.cc (check_non_pod_aggregate): Check is_empty_class. + 2025-05-07 Jason Merrill Backported from master: diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index f78bda3..028b87f 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2025-05-12 Joseph Myers + + * sv.po: Update. + 2025-04-30 Joseph Myers * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da60a95..848def7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2025-05-12 Jason Merrill + + Backported from master: + 2025-05-12 Jason Merrill + + PR c++/120012 + * g++.dg/abi/base-defaulted2.C: New test. + 2025-05-11 Richard Biener PR tree-optimization/120211 -- cgit v1.1 From a09774a9bbfca578f79e8fae3da4cfc99ddb120b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 May 2025 14:14:55 +0200 Subject: fortran: Fix up minloc/maxloc lowering [PR120191] We need to drop the kind argument from what is passed to the library, but need to do it not only when one uses the argument name for it (so kind=4 etc.) but also when one passes all the arguments to the intrinsics. The following patch uses what gfc_conv_intrinsic_findloc uses, which looks more efficient and cleaner, we already set automatic vars to point to the kind and back actual arguments, so we can just free/clear expr on the former and set name to "%VAL" on the latter. And similarly clears dim argument for the BT_CHARACTER case when using maxloc2/minloc2, again regardless of whether it was named or not. 2025-05-13 Jakub Jelinek Daniil Kochergin Tobias Burnus 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. * gfortran.dg/pr120191_1.f90: New test. (cherry picked from commit ec249be3c287c6f1dfb328712ac9c39e6fa95eca) --- gcc/fortran/trans-intrinsic.cc | 51 +-- gcc/testsuite/gfortran.dg/pr120191_1.f90 | 614 +++++++++++++++++++++++++++++++ 2 files changed, 629 insertions(+), 36 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr120191_1.f90 (limited to 'gcc') 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/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 -- cgit v1.1 From 65a8260c19834511034fb62c73139aa304f7eac4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 May 2025 14:18:10 +0200 Subject: libfortran: Fix up _gfortran_s{max,min}loc2_{4,8,16}_s{1,4} [PR120191] I've tried to write a testcase for the BT_CHARACTER maxloc/minloc with named or unnamed arguments and indeed the just posted patch fixed the arguments in there in multiple cases to match what the library expects. But the testcase still fails, due to library problems. One dealt with in this patch are _gfortran_s{max,min}loc2_{4,8,16}_s{1,4} functions. Those are trivial wrappers around _gfortrani_{max,min}loc2_{4,8,16}_s{1,4} which should call those functions if the scalar mask is true and just return 0 otherwise. The two bugs I see there is that the back, len arguments are swapped, which means that it always acts as back=.true. and for len will use character length of 1 or 0 instead of the desired one. The _gfortrani_{max,min}loc2_{4,8,16}_s{1,4} functions have prototypes like GFC_INTEGER_4 maxloc2_4_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 back, gfc_charlen_type len) so back comes before len, ditto for the GFC_INTEGER_4 smaxloc2_4_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len) The other problem is that it was just testing if (mask). In my limited Fortran understanding that means that the optional argument mask was supplied but nothing about its actual value. Other scalar mask generated routines use if (mask == NULL || *mask) as the condition when to call the non-masked function, i.e. when mask is not supplied (then it should act like .true. mask) or when it is supplied and evaluates to .true.). 2025-05-13 Jakub Jelinek 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. * gfortran.dg/pr120191_2.f90: New test. (cherry picked from commit 482f2192d4ef6af55acae2dc3e0df00b8487cc7d) --- gcc/testsuite/gfortran.dg/pr120191_2.f90 | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/pr120191_2.f90 (limited to 'gcc') 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 -- cgit v1.1 From ad998962ccc8cd190da2d85f0274bbb7bb9f6cae Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 May 2025 14:19:25 +0200 Subject: libfortran: Fix up _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} [PR120191] There is a bug in _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} which the following testcase shows. The functions return but then crash in the caller. Seems that is because buffer overflows, I believe those functions for if (mask == NULL || *mask) condition being false are supposed to fill in the result array with all zeros (or allocate it and fill it with zeros). My understanding is the result array in that case is integer(kind={4,8,16}) and should have the extents the character input array has. The problem is that it uses * string_len in the extent multiplication: extent[n] = GFC_DESCRIPTOR_EXTENT(array,n) * string_len; and extent[n] = GFC_DESCRIPTOR_EXTENT(array,n + 1) * string_len; which is I guess fine and desirable for the extents of the character array, but not for the extents of the destination array. Yet the code uses that extent array for that purpose (and no other purposes). Here it uses it to set the dimensions for the case where it needs to allocate (as well as size): for (n = 0; n < rank; n++) { if (n == 0) str = 1; else str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1]; GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str); } Here it uses it for bounds checking of the destination: if (unlikely (compile_options.bounds_check)) { for (n=0; n < rank; n++) { index_type ret_extent; ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); if (extent[n] != ret_extent) runtime_error ("Incorrect extent in return value of" " MAXLOC intrinsic in dimension %ld:" " is %ld, should be %ld", (long int) n + 1, (long int) ret_extent, (long int) extent[n]); } } and here to find out how many retarray elements to actually fill in each dimension: while(1) { *dest = 0; count[0]++; dest += dstride[0]; n = 0; while (count[n] == extent[n]) { /* When we get to the end of a dimension, reset it and increment the next dimension. */ count[n] = 0; /* We could precalculate these products, but this is a less frequently used path so probably not worth it. */ dest -= dstride[n] * extent[n]; Seems maxloc1s.m4 and minloc1s.m4 are the only users of ifunction-s.m4, so we can change SCALAR_ARRAY_FUNCTION in there without breaking anything else. 2025-05-13 Jakub Jelinek 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. * gfortran.dg/pr120191_3.f90: New test. (cherry picked from commit 781cfc454b8dc24952fe7f4c5c409296dca505e1) --- gcc/testsuite/gfortran.dg/pr120191_3.f90 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/pr120191_3.f90 (limited to 'gcc') 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 -- cgit v1.1 From c84a951a8ee151cb4d80dd84f75f421c5f60fa05 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 May 2025 14:20:22 +0200 Subject: libfortran: Fix up _gfortran_{,m,s}findloc2_s{1,4} [PR120196] As mentioned in the PR, _gfortran_{,m,s}findloc2_s{1,4} iterate too many times in the back case if nothing is found. For !back, the loops are for (i = 1; i <= extent; i++) so i is in the body [1, extent] if nothing is found, but for back it is for (i = extent; i >= 0; i--) so i is in the body [0, extent] and compares one element before the start of the array. Note, findloc1_s{1,4} uses for (n = len; n > 0; n--, src -= delta * len_array) for the back loop and for (n = 1; n <= len; n++, src += delta * len_array) for !back. This patch fixes that. The testcase fails under valgrind without the libgfortran changes and succeeds with those. 2025-05-13 Jakub Jelinek 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. * gfortran.dg/pr120196.f90: New test. (cherry picked from commit 748a7bc4624e7b000f6fdb93a8cf7da73ff193bb) --- gcc/testsuite/gfortran.dg/pr120196.f90 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/pr120196.f90 (limited to 'gcc') 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 -- cgit v1.1 From df1407f2122ec6e670d700c090e765d0a06859ee Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 13 May 2025 16:48:52 +0100 Subject: [PATCH] PR modula2/120188: documented example does not work assignvalue m2plugin This patch corrects the gm2 command line used in the documentation to invoke the m2-plugin. The patch also includes the documentation example in dejagnu test code with an expect script to check whether plugins were enabled. gcc/ChangeLog: PR modula2/120188 * doc/gm2.texi (Semantic checking): Add -fm2-plugin command line option. gcc/testsuite/ChangeLog: 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. (cherry picked from commit 9ce4c801e8275fcf0336ae2fb548f6ebb3ca068b) Signed-off-by: Gaius Mulley --- gcc/doc/gm2.texi | 2 +- .../doc/examples/plugin/fail/assignvalue.mod | 25 +++++++++++++++ .../plugin/fail/doc-examples-plugin-fail.exp | 25 +++++++++++++++ gcc/testsuite/lib/gm2-dg.exp | 37 +++++++++++++++++++++- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gm2.dg/doc/examples/plugin/fail/assignvalue.mod create mode 100644 gcc/testsuite/gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp (limited to 'gcc') 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/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..8a41ff8 --- /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 { ![gm2-dg-frontend-configure-check "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/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 + } +} -- cgit v1.1 From c220b8e7b422ed04b6aaa1b9243b550df913f476 Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 13 May 2025 16:51:06 +0100 Subject: [PATCH] PR modula2/120188: Use existing test for plugin This is a cleanup patch which to use the existing plugin test rather than check the configure build options. gcc/testsuite/ChangeLog: 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. (cherry picked from commit f1f94e79dbcfa4b33267db27780870ea7810cd21) Signed-off-by: Gaius Mulley --- .../gm2.dg/doc/examples/plugin/fail/doc-examples-plugin-fail.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') 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 index 8a41ff8..6ddf2d5 100644 --- 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 @@ -11,7 +11,7 @@ gm2_init_pim4 $srcdir/$subdir dg-init # If the --enable-plugin has not been enabled during configure, bail. -if { ![gm2-dg-frontend-configure-check "enable-plugin" ] } { +if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { return } -- cgit v1.1 From b8032bec831a4a48636e7ffd771e76efc1ff27ea Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 13 May 2025 17:51:22 +0100 Subject: [PATCH] PR modula2/119914 No error message generated when passing a Ztype to an unbounded array This patch detects constants ZType, RType, CType being passed to unbounded arrays and generates an error message highlighting the formal and actual parameters in error. gcc/m2/ChangeLog: 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. gcc/testsuite/ChangeLog: PR modula2/119914 * gm2/pim/fail/constintarraybyte.mod: New test. (cherry picked from commit e9a81addd5b7d018e173fa8d59aafc2f84e41d8b) Signed-off-by: Gaius Mulley --- gcc/m2/gm2-compiler/M2Check.mod | 21 +++- gcc/m2/gm2-compiler/M2Quads.mod | 10 +- gcc/m2/gm2-compiler/M2Range.mod | 43 ++++++- gcc/m2/gm2-compiler/SymbolTable.def | 16 +++ gcc/m2/gm2-compiler/SymbolTable.mod | 137 ++++++++++++++++++++--- gcc/testsuite/gm2/pim/fail/constintarraybyte.mod | 10 ++ 6 files changed, 217 insertions(+), 20 deletions(-) create mode 100644 gcc/testsuite/gm2/pim/fail/constintarraybyte.mod (limited to 'gcc') 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/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/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..551bbec 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. *) 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. -- cgit v1.1 From 07c5d7ce0daccc8110953a8e65861ffc17ed92aa Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 13 May 2025 18:04:57 +0100 Subject: [PATCH] PR modula2/119915: Sprintf1 repeats the entire format string if it starts with a directive This bugfix is for FormatStrings to ensure that in the case of %x, %u the procedure function PerformFormatString uses Copy rather than Slice to avoid the case on an upper bound of zero in Slice. Oddly the %d case had the correct code. gcc/m2/ChangeLog: 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. gcc/testsuite/ChangeLog: PR modula2/119915 * gm2/pimlib/run/pass/format2.mod: New test. (cherry picked from commit 7a4f7a92770db4e739e76a06175454ba38d60b22) Signed-off-by: Gaius Mulley --- gcc/m2/gm2-libs/FormatStrings.mod | 4 +- gcc/testsuite/gm2/pimlib/run/pass/format2.mod | 63 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gm2/pimlib/run/pass/format2.mod (limited to 'gcc') 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/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. -- cgit v1.1 From 61fada934e894c7fb4a1f1626ea0d0f1f1f1d2f4 Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 13 May 2025 19:42:39 +0100 Subject: [PATCH] PR modula2/120117: ICE when attempting to obtain the MAX of an aliased set type The ICE occurred because of a bug in M2GenGCC.mod:FoldBecomes which attempted to remove the same quadruple twice. Thereafter cc1gm2 generated an erroneous error type error as PCSymBuild did not skip an aliased set type. The type of the const was set incorrectly (as a set type) rather than the type of the set element. gcc/m2/ChangeLog: 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. gcc/testsuite/ChangeLog: PR modula2/120117 * gm2/pim/pass/highbit.mod: New test. * gm2/pim/pass/highbit2.mod: New test. (cherry picked from commit bb83283e5c5c55eab7493a58c5e415aa56f5940c) Signed-off-by: Gaius Mulley --- gcc/m2/gm2-compiler/M2GenGCC.mod | 3 --- gcc/m2/gm2-compiler/PCSymBuild.mod | 13 +++++++------ gcc/m2/gm2-compiler/SymbolTable.mod | 1 + gcc/testsuite/gm2/pim/pass/highbit.mod | 13 +++++++++++++ gcc/testsuite/gm2/pim/pass/highbit2.mod | 13 +++++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gm2/pim/pass/highbit.mod create mode 100644 gcc/testsuite/gm2/pim/pass/highbit2.mod (limited to 'gcc') 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/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.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index 551bbec..ff661dc 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -7265,6 +7265,7 @@ VAR pSym: PtrToSymbol ; BEGIN pSym := GetPsym(Sym) ; + CheckBreak (Sym) ; WITH pSym^ DO CASE SymbolType OF 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. -- cgit v1.1 From a3eed34d75ce8fe13e3cdc28c42849ada26c316f Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Sun, 11 May 2025 07:40:23 +0200 Subject: Do not generate formal arglist from actual if we have already resolved it. This bug was another case of generating a formal arglist from an actual one where we should not have done so. The fix is straightforward: If we have resolved the formal arglist, we should not generare a new one. OK for trunk and backport? gcc/fortran/ChangeLog: 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. gcc/testsuite/ChangeLog: PR fortran/120163 * gfortran.dg/interface_61.f90: New test. --- gcc/fortran/gfortran.h | 3 +++ gcc/fortran/resolve.cc | 7 ++++--- gcc/testsuite/gfortran.dg/interface_61.f90 | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/interface_61.f90 (limited to 'gcc') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5ef7037..ad4f8b3 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2028,6 +2028,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 f03708e..1db886e 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/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 -- cgit v1.1 From 7925d3263950585c5e081b039e59e26bec539cac Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 14 May 2025 00:25:57 +0000 Subject: Daily bump. --- gcc/ChangeLog | 8 +++++ gcc/DATESTAMP | 2 +- gcc/fortran/ChangeLog | 24 ++++++++++++++ gcc/m2/ChangeLog | 57 +++++++++++++++++++++++++++++++++ gcc/testsuite/ChangeLog | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f52642..8af941d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2025-05-13 Gaius Mulley + + Backported from master: + 2025-05-12 Gaius Mulley + + PR modula2/120188 + * doc/gm2.texi (Semantic checking): Add -fm2-plugin command line option. + 2025-05-11 Richard Biener PR tree-optimization/120211 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 83f5cb2..cfb9239 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250513 +20250514 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2697deb..3181168 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,27 @@ +2025-05-13 Thomas Koenig + + 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 + + Backported from master: + 2025-05-13 Jakub Jelinek + Daniil Kochergin + Tobias Burnus + + 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 PR fortran/119928 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 + + Backported from master: + 2025-05-05 Gaius Mulley + + 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 + + Backported from master: + 2025-04-24 Gaius Mulley + + 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 + + Backported from master: + 2025-04-24 Gaius Mulley + + 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/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 848def7..2977f75 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,88 @@ +2025-05-13 Thomas Koenig + + PR fortran/120163 + * gfortran.dg/interface_61.f90: New test. + +2025-05-13 Gaius Mulley + + Backported from master: + 2025-05-05 Gaius Mulley + + PR modula2/120117 + * gm2/pim/pass/highbit.mod: New test. + * gm2/pim/pass/highbit2.mod: New test. + +2025-05-13 Gaius Mulley + + Backported from master: + 2025-04-24 Gaius Mulley + + PR modula2/119915 + * gm2/pimlib/run/pass/format2.mod: New test. + +2025-05-13 Gaius Mulley + + Backported from master: + 2025-04-24 Gaius Mulley + + PR modula2/119914 + * gm2/pim/fail/constintarraybyte.mod: New test. + +2025-05-13 Gaius Mulley + + Backported from master: + 2025-05-13 Gaius Mulley + + 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 + + Backported from master: + 2025-05-12 Gaius Mulley + + 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 + + Backported from master: + 2025-05-13 Jakub Jelinek + + PR libfortran/120196 + * gfortran.dg/pr120196.f90: New test. + +2025-05-13 Jakub Jelinek + + Backported from master: + 2025-05-13 Jakub Jelinek + + PR fortran/120191 + * gfortran.dg/pr120191_3.f90: New test. + +2025-05-13 Jakub Jelinek + + Backported from master: + 2025-05-13 Jakub Jelinek + + PR fortran/120191 + * gfortran.dg/pr120191_2.f90: New test. + +2025-05-13 Jakub Jelinek + + Backported from master: + 2025-05-13 Jakub Jelinek + Daniil Kochergin + Tobias Burnus + + PR fortran/120191 + * gfortran.dg/pr120191_1.f90: New test. + 2025-05-12 Jason Merrill Backported from master: -- cgit v1.1 From 53690a84a35b905403126be66210d21e89f53ac6 Mon Sep 17 00:00:00 2001 From: Nathaniel Shead Date: Mon, 21 Apr 2025 20:40:29 +1000 Subject: c++: Fix OpenMP support with C++20 modules [PR119864] In r15-2799-gf1bfba3a9b3f31, a new kind of global constructor was added. Unfortunately this broke C++20 modules, as both the host and target constructors were given the same mangled name. This patch ensures that only the host constructor gets the module name mangling for now, and stops forcing the creation of the target constructor even when no such initialization is required. PR c++/119864 gcc/cp/ChangeLog: * 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. gcc/testsuite/ChangeLog: * g++.dg/modules/openmp-1.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill (cherry picked from commit 79b7e37ea3fbbc43958190f69f6da3be3d809c9c) --- gcc/cp/decl2.cc | 14 +++++++------- gcc/testsuite/g++.dg/modules/openmp-1.C | 9 +++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/openmp-1.C (limited to 'gcc') diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 21156f1..a137e88 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -4184,7 +4184,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) @@ -5876,12 +5880,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/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(); -- cgit v1.1 From 6dfc5d1fc86fe6aaed6e7c476286f7a5f0ffc867 Mon Sep 17 00:00:00 2001 From: Nathaniel Shead Date: Thu, 8 May 2025 23:06:13 +1000 Subject: c++/modules: Fix handling of -fdeclone-ctor-dtor with explicit instantiations [PR120125] The attached testcase ICEs in maybe_thunk_body because we haven't created a node in the cgraph for an imported explicit instantiation yet. We in fact really shouldn't be emitting calls at all, since an imported explicit instantiation always exists in the TU we imported it from. So this patch adjusts DECL_NOT_REALLY_EXTERN handling to account for this. PR c++/120125 gcc/cp/ChangeLog: * 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. gcc/testsuite/ChangeLog: * g++.dg/modules/clone-4_a.C: New test. * g++.dg/modules/clone-4_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill (cherry picked from commit d787bc4fd372298e9ed5b11cb3050fd3707070f6) --- gcc/cp/module.cc | 6 +++++- gcc/cp/optimize.cc | 4 ++-- gcc/testsuite/g++.dg/modules/clone-4_a.C | 12 ++++++++++++ gcc/testsuite/g++.dg/modules/clone-4_b.C | 12 ++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/clone-4_a.C create mode 100644 gcc/testsuite/g++.dg/modules/clone-4_b.C (limited to 'gcc') diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index f562bf8..e778262 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -12638,7 +12638,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/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 struct __shared_ptr { + inline __shared_ptr() { foo(); } +}; + +template class __shared_ptr; 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 s1; + __shared_ptr s2; +} + +// { dg-final { scan-assembler-not {_ZNW1M12__shared_ptrIiEC[1-4]Ev:} } } +// { dg-final { scan-assembler {_ZNW1M12__shared_ptrIdEC2Ev:} } } -- cgit v1.1 From 02e95abdde9742cecd7d1211e572549c1e56b8b1 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Tue, 13 May 2025 20:26:26 -0700 Subject: dwarf2out: Propagate dtprel into the .debug_addr table in resolve_addr_in_expr For a debugger to display statically-allocated[0] TLS variables the compiler must communicate information[1] that can be used in conjunction with knowledge of the runtime enviroment[2] to calculate a location for the variable for each thread. That need gives rise to dw_loc_dtprel in dwarf2out, a flag tracking whether the location description is dtprel, or relative to the "dynamic thread pointer". Location descriptions in the .debug_info section for TLS variables need to be relocated by the static linker accordingly, and dw_loc_dtprel controls emission of the needed relocations. This is further complicated by -gsplit-dwarf. -gsplit-dwarf is designed to allow as much debugging information as possible to bypass the static linker to improve linking performance. One of the ways that is done is by introducing a layer of indirection for relocatable values[3]. That gives rise to addr_index_table which ultimately results in the .debug_addr section. While the code handling addr_index_table clearly contemplates the existence of dtprel entries[4] resolve_addr_in_expr does not, and the result is that when using -gsplit-dwarf the DWARF for TLS variables contains an address[5] rather than an offset, and debuggers can't work with that. This is visible on a trivial example. Compile ``` static __thread int tls_var; int main(void) { tls_var = 42; return 0; } ``` with -g and -g -gsplit-dwarf. Run the program under gdb. When examining the value of tls_var before and after the assignment, -g behaves as one would expect but -g -gsplit-dwarf does not. If the user is lucky and the miscalculated address is not mapped, gdb will print "Cannot access memory at address ...". If the user is unlucky and the miscalculated address is mapped, gdb will simply give the wrong value. You can further confirm that the issue is the address calculation by asking gdb for the address of tls_var and comparing that to what one would expect.[6] Thankfully this is trivial to fix by modifying resolve_addr_in_expr to propagate the dtprel character of the location where necessary. gdb begins working as expected and the diff in the generated assembly is clear. ``` .section .debug_addr,"",@progbits .long 0x14 .value 0x5 .byte 0x8 .byte 0 .Ldebug_addr0: - .quad tls_var + .long tls_var@dtpoff, 0 .quad .LFB0 ``` [0] Referring to e.g. __thread as statically-allocated vs. e.g. a dynamically-allocated pthread_key_create() call. [1] Generally an offset in a TLS block. [2] With glibc, provided by libthread_db.so. [3] Relocatable values are moved to a table in the .debug_addr section, those values in .debug_info are replaced with special values that look up indexes in that table, and then the static linker elsewhere assigns a single per-CU starting index in the .debug_addr section, allowing those special values to remain permanently fixed and the resulting data to be ignored by the linker. [4] ate_kind_rtx_dtprel exists, after all, and new_addr_loc_descr does produce it where appropriate. [5] e.g. an address in the .tbss/.tdata section. [6] e.g. on x86-64 by examining %fsbase and the offset in the assembly 2025-05-01 Kyle Huey * dwarf2out.cc (resolve_addr_in_expr): Propagate dtprel into the address table when appropriate. --- gcc/dwarf2out.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 69e9d77..2437610 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -31068,7 +31068,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: -- cgit v1.1 From 535404956cf8f0c3d248298ca0f0ae7887c20d08 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 14 May 2025 21:12:34 +0000 Subject: Update gcc sv.po * sv.po: Update. --- gcc/po/sv.po | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'gcc') 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 \n" "Language-Team: Swedish \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 "%-klausulens händelsehandtag har typen %qT istället för %" -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" -- cgit v1.1 From ee372251cdb157d241b4caa4ba2cf7350edef141 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 15 May 2025 00:26:03 +0000 Subject: Daily bump. --- gcc/ChangeLog | 5 +++++ gcc/DATESTAMP | 2 +- gcc/cp/ChangeLog | 22 ++++++++++++++++++++++ gcc/po/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 17 +++++++++++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8af941d..32479e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2025-05-14 Kyle Huey + + * dwarf2out.cc (resolve_addr_in_expr): Propagate dtprel into the address + table when appropriate. + 2025-05-13 Gaius Mulley Backported from master: diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index cfb9239..63e8d5b 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250514 +20250515 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 377d1ba..1c21fb5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,25 @@ +2025-05-14 Nathaniel Shead + + Backported from master: + 2025-05-14 Nathaniel Shead + + 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 + + Backported from master: + 2025-05-14 Nathaniel Shead + + 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 Backported from master: diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 028b87f..6abdf24 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2025-05-14 Joseph Myers + + * sv.po: Update. + 2025-05-12 Joseph Myers * sv.po: Update. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2977f75..ee69077 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,20 @@ +2025-05-14 Nathaniel Shead + + Backported from master: + 2025-05-14 Nathaniel Shead + + 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 + + Backported from master: + 2025-05-14 Nathaniel Shead + + PR c++/119864 + * g++.dg/modules/openmp-1.C: New test. + 2025-05-13 Thomas Koenig PR fortran/120163 -- cgit v1.1 From c6ec3a9bddb4224a2369b0284ade4b474cd4b0ce Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Tue, 13 May 2025 19:02:06 +0200 Subject: Do not dump non-interoperable types with -fc-prototypes. gcc/fortran/ChangeLog: PR fortran/120107 * dump-parse-tree.cc (write_type): Do not dump non-interoperable types. (cherry picked from commit fa0dff8e99e81bc7a3db1dc57d4fc340e0525b1d) --- gcc/fortran/dump-parse-tree.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 9501bcc..558a285 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -4380,10 +4380,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); -- cgit v1.1 From a85776f7f64271d628ae0a04f02717ee6572e6e8 Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Wed, 14 May 2025 20:11:48 +0200 Subject: Fix explicit arrays with non-constant size for -fc-prototypes. gcc/fortran/ChangeLog: PR fortran/120139 * dump-parse-tree.cc (get_c_type_name): If no constant size of an array exists, output an asterisk. (cherry picked from commit 4f9c7b5258f2af89bba8e954c277981d2e2ee1ef) --- gcc/fortran/dump-parse-tree.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 558a285..3c10603 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -4336,6 +4336,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; } -- cgit v1.1 From 2384010230d48767a184fa6e245979e44dc8153d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 15 May 2025 18:04:00 +0000 Subject: Update gcc zh_CN.po * zh_CN.po: Update. --- gcc/po/zh_CN.po | 341 ++++++++++++++++++++++++-------------------------------- 1 file changed, 145 insertions(+), 196 deletions(-) (limited to 'gcc') 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 , 2005-2014. # Jeff Bai , 2015. # Mingye Wang (Arthur2e5) , 2015, 2016. -# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2024. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023-2025. # Zixing Zhou , 2023. # Zhanhaoxiang Zhang , 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 \n" +"PO-Revision-Date: 2025-05-15 13:53-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" "Language-Team: Chinese (simplified) \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 \tWrite dependency output to the given file" +#, no-c-format msgid "-Xf \tWrite JSON output to the given ." -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 %" -msgstr "" +msgstr "安装错误,无法找到 %" #: lto-wrapper.cc:1380 #, fuzzy @@ -31178,10 +31141,9 @@ msgid "environment variable % 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 "% failed" -msgstr "atexit 失败" +msgstr "% 失败" #: multiple_target.cc:72 #, fuzzy, gcc-internal-format @@ -31744,9 +31705,9 @@ msgid "location of OpenACC %" 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 %" -msgstr "" +msgstr "无法定位 MCU 数据文件 %" #: 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 "% 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 %" -msgstr "%q#T重定义" +msgstr "% 的重定义" #: config/pru/pru-pragma.cc:67 #, gcc-internal-format msgid "% base address is not a multiple of 256" -msgstr "" +msgstr "% 基地址不是 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 -- cgit v1.1 From 488c997aeb6669c333287a1f0063ce5fb706a8b5 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Thu, 15 May 2025 11:07:53 -0400 Subject: c++: unifying specializations of non-primary tmpls [PR120161] Here unification of P=Wrap::type, A=Wrap::type wrongly succeeds ever since r14-4112 which made the RECORD_TYPE case of unify no longer recurse into template arguments for non-primary templates (since they're a non-deduced context) and so the int/long mismatch that makes the two types distinct goes unnoticed. In the case of (comparing specializations of) a non-primary template, unify should still go on to compare the types directly before returning success. PR c++/120161 gcc/cp/ChangeLog: * pt.cc (unify) : When comparing specializations of a non-primary template, still perform a type comparison. gcc/testsuite/ChangeLog: * g++.dg/template/unify13.C: New test. Reviewed-by: Jason Merrill (cherry picked from commit 0c430503f2849ebb20105695b8ad40d43d797c7b) --- gcc/cp/pt.cc | 6 +++--- gcc/testsuite/g++.dg/template/unify13.C | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/unify13.C (limited to 'gcc') diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 96230b4..be9af50 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -25797,10 +25797,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/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 +struct mp_list { }; + +template +struct Wrap { struct type { }; }; + +struct A : mp_list::type, void> + , mp_list::type, void> { }; + +template +void f(mp_list::type, U>*); + +int main() { + A a; + f(&a); +} -- cgit v1.1 From a87bd3cca4e990c9151a3f713f68a07bff650b8f Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 16 May 2025 00:25:41 +0000 Subject: Daily bump. --- gcc/DATESTAMP | 2 +- gcc/cp/ChangeLog | 9 +++++++++ gcc/fortran/ChangeLog | 18 ++++++++++++++++++ gcc/po/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 8 ++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 63e8d5b..e01bdfb 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250515 +20250516 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1c21fb5..ae663cd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2025-05-15 Patrick Palka + + Backported from master: + 2025-05-15 Patrick Palka + + PR c++/120161 + * pt.cc (unify) : When comparing specializations + of a non-primary template, still perform a type comparison. + 2025-05-14 Nathaniel Shead Backported from master: diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3181168..dd5929d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,21 @@ +2025-05-15 Thomas Koenig + + Backported from master: + 2025-05-14 Thomas Koenig + + 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 + + Backported from master: + 2025-05-14 Thomas Koenig + + PR fortran/120107 + * dump-parse-tree.cc (write_type): Do not dump non-interoperable + types. + 2025-05-13 Thomas Koenig PR fortran/120163 diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 6abdf24..1db7cd5 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2025-05-15 Joseph Myers + + * zh_CN.po: Update. + 2025-05-14 Joseph Myers * sv.po: Update. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee69077..d6c0ac9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2025-05-15 Patrick Palka + + Backported from master: + 2025-05-15 Patrick Palka + + PR c++/120161 + * g++.dg/template/unify13.C: New test. + 2025-05-14 Nathaniel Shead Backported from master: -- cgit v1.1 From e968c7311c628f36871b0e0d9cf7f42b5a8956ac Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Fri, 16 May 2025 17:18:53 +0100 Subject: Alpha: Fix base block alignment calculation regression In determination of base block alignment we only examine a COMPONENT_REF tree node at hand without ever checking if its ultimate alignment has been reduced by the combined offset going back to the outermost object. Consequently cases have been observed where quadword accesses have been produced for a memory location referring a nested struct member only aligned to the longword boundary, causing emulation to trigger. Address this issue by recursing into COMPONENT_REF tree nodes until the outermost one has been reached, which is supposed to be a MEM_REF one, accumulating the offset as we go, fixing a commit e0dae4da4c45 ("Alpha: Also use tree information to get base block alignment") regression. Bail out and refrain from using tree information for alignment if we end up at something different or we are unable to calculate the offset at any point. gcc/ * config/alpha/alpha.cc (alpha_get_mem_rtx_alignment_and_offset): Recurse into COMPONENT_REF nodes. gcc/testsuite/ * gcc.target/alpha/memcpy-nested-offset-long.c: New file. * gcc.target/alpha/memcpy-nested-offset-quad.c: New file. (cherry picked from commit 1dd769b3d0d9251649dcb645d7ed6c4ba2202306) --- gcc/config/alpha/alpha.cc | 23 +++---- .../gcc.target/alpha/memcpy-nested-offset-long.c | 76 ++++++++++++++++++++++ .../gcc.target/alpha/memcpy-nested-offset-quad.c | 64 ++++++++++++++++++ 3 files changed, 150 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c create mode 100644 gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c (limited to 'gcc') 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/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 } } */ -- cgit v1.1 From 4ed18795fb4f128ede2b7c610c28f108b42c606d Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 17 May 2025 00:23:30 +0000 Subject: Daily bump. --- gcc/ChangeLog | 9 +++++++++ gcc/DATESTAMP | 2 +- gcc/testsuite/ChangeLog | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32479e9..4c214df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2025-05-16 Maciej W. Rozycki + + Backported from master: + 2025-04-19 Maciej W. Rozycki + + * config/alpha/alpha.cc + (alpha_get_mem_rtx_alignment_and_offset): Recurse into + COMPONENT_REF nodes. + 2025-05-14 Kyle Huey * dwarf2out.cc (resolve_addr_in_expr): Propagate dtprel into the address diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index e01bdfb..f5d7faa 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250516 +20250517 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d6c0ac9..cc21173 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2025-05-16 Maciej W. Rozycki + + Backported from master: + 2025-04-19 Maciej W. Rozycki + + * 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 Backported from master: -- cgit v1.1 From dc21caefbc2d63be1315ca062e977affa74eacc2 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Mon, 5 May 2025 20:05:22 -0700 Subject: Fortran: Fix ICE with use of c_associated. PR fortran/120049 gcc/fortran/ChangeLog: * check.cc (gfc_check_c_associated): Modify checks to avoid ICE and allow use, intrinsic :: iso_c_binding from a separate module file. gcc/testsuite/ChangeLog: * gfortran.dg/pr120049_a.f90: New test. * gfortran.dg/pr120049_b.f90: New test. (cherry picked from commit d0571638a6bad932b226ada98b167fa47a47d838) --- gcc/fortran/check.cc | 42 ++++++++++++++++++++------------ gcc/testsuite/gfortran.dg/pr120049_a.f90 | 15 ++++++++++++ gcc/testsuite/gfortran.dg/pr120049_b.f90 | 8 ++++++ 3 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr120049_a.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr120049_b.f90 (limited to 'gcc') 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/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 -- cgit v1.1 From 848e7b119cc4558aec8f473dced811ae8b54829f Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 18 May 2025 00:23:11 +0000 Subject: Daily bump. --- gcc/DATESTAMP | 2 +- gcc/fortran/ChangeLog | 10 ++++++++++ gcc/testsuite/ChangeLog | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index f5d7faa..b206730 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250517 +20250518 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dd5929d..65973f1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2025-05-17 Jerry DeLisle + + Backported from master: + 2025-05-06 Jerry DeLisle + + 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 Backported from master: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc21173..c8b0bad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2025-05-17 Jerry DeLisle + + Backported from master: + 2025-05-06 Jerry DeLisle + + PR fortran/120049 + * gfortran.dg/pr120049_a.f90: New test. + * gfortran.dg/pr120049_b.f90: New test. + 2025-05-16 Maciej W. Rozycki Backported from master: -- cgit v1.1 From f53afae90768520c31f88aea5eaca8dfe583dabb Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 19 May 2025 00:23:06 +0000 Subject: Daily bump. --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index b206730..2333b0d 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250518 +20250519 -- cgit v1.1 From 57f73c3956572f30f3e0f7a350d958985b11daa5 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 15 May 2025 09:15:21 +0200 Subject: OpenMP/Fortran: Fix allocatable-component mapping of derived-type array comps The check whether the location expression in map clause has allocatable components was failing for some derived-type array expressions such as map(var%tiles(1)) as the compiler produced _4 = var.tiles; MEMREF(_4, _5); This commit now also handles this case. gcc/fortran/ChangeLog: * trans-openmp.cc (gfc_omp_deep_mapping_do): Handle SSA_NAME if a def_stmt is available. libgomp/ChangeLog: * testsuite/libgomp.fortran/alloc-comp-4.f90: New test. (cherry picked from commit f99017c3125f4400cf6a098cf5b33d32fe3e6645) --- gcc/fortran/trans-openmp.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gcc') diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc index 0b8150f..2a48d4a 100644 --- a/gcc/fortran/trans-openmp.cc +++ b/gcc/fortran/trans-openmp.cc @@ -2478,6 +2478,26 @@ gfc_omp_deep_mapping_do (bool is_cnt, const 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) -- cgit v1.1 From fedf81ef7b98e5c9ac899b8641bb670746c51205 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 20 May 2025 00:25:44 +0000 Subject: Daily bump. --- gcc/DATESTAMP | 2 +- gcc/fortran/ChangeLog | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 2333b0d..4ea9877 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250519 +20250520 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 65973f1..3116650 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2025-05-19 Tobias Burnus + + Backported from master: + 2025-05-15 Tobias Burnus + + * trans-openmp.cc (gfc_omp_deep_mapping_do): Handle SSA_NAME if + a def_stmt is available. + 2025-05-17 Jerry DeLisle Backported from master: -- cgit v1.1 From 3ba1b0ac7ccbe7b01811302dc1d50dcdbd7dc2ac Mon Sep 17 00:00:00 2001 From: Nathaniel Shead Date: Mon, 19 May 2025 23:17:16 +1000 Subject: c++/modules: Always mark tinfo vars as TREE_ADDRESSABLE [PR120350] We need to mark type info decls as addressable if we take them by reference; this is done by walking the declaration during parsing and marking the decl as needed. However, with modules we don't stream tinfo decls directly; rather we stream just their name and type and reconstruct them in the importer directly. This means that any addressable flags are not propagated, and we error because TREE_ADDRESSABLE is not set despite taking its address. But tinfo decls should always have TREE_ADDRESSABLE set, as any attempt to use the tinfo decl will go through build_address anyway. So this patch fixes the issue by eagerly marking the constructed decl as TREE_ADDRESSABLE so that modules gets this flag correctly set as well. PR c++/120350 gcc/cp/ChangeLog: * rtti.cc (get_tinfo_decl_direct): Mark TREE_ADDRESSABLE. gcc/testsuite/ChangeLog: * g++.dg/modules/tinfo-3_a.H: New test. * g++.dg/modules/tinfo-3_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill (cherry picked from commit 9a6e5a437f0416627ee516f6ef5929cb30c5e498) --- gcc/cp/rtti.cc | 1 + gcc/testsuite/g++.dg/modules/tinfo-3_a.H | 7 +++++++ gcc/testsuite/g++.dg/modules/tinfo-3_b.C | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/modules/tinfo-3_a.H create mode 100644 gcc/testsuite/g++.dg/modules/tinfo-3_b.C (limited to 'gcc') 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/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 +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); +} -- cgit v1.1 From 2d1244a5b2dca62b97656cdfa28cd99af583aaa8 Mon Sep 17 00:00:00 2001 From: Nathaniel Shead Date: Sat, 17 May 2025 23:51:07 +1000 Subject: c++/modules: Fix ICE on merge of instantiation with partial spec [PR120013] When we import a pending instantiation that matches an existing partial specialisation, we don't find the slot in the entity map because for partial specialisations we register the TEMPLATE_DECL but for normal implicit instantiations we instead register the inner TYPE_DECL. Because the DECL_MODULE_ENTITY_P flag is set we correctly realise that it is in the entity map, but ICE when attempting to use that slot in partition handling. This patch fixes the issue by detecting this case and instead looking for the slot for the TEMPLATE_DECL. It doesn't matter that we never add a slot for the inner decl because we're about to discard it anyway. PR c++/120013 gcc/cp/ChangeLog: * module.cc (trees_in::install_entity): Handle re-registering the inner TYPE_DECL of a partial specialisation. gcc/testsuite/ChangeLog: * g++.dg/modules/partial-8.h: New test. * g++.dg/modules/partial-8_a.C: New test. * g++.dg/modules/partial-8_b.C: New test. * g++.dg/modules/partial-8_c.C: New test. * g++.dg/modules/partial-8_d.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill (cherry picked from commit b0de7297f2b5670386472229ab795a577c288ecf) --- gcc/cp/module.cc | 41 ++++++++++++++++++++++-------- gcc/testsuite/g++.dg/modules/partial-8.h | 8 ++++++ gcc/testsuite/g++.dg/modules/partial-8_a.C | 10 ++++++++ gcc/testsuite/g++.dg/modules/partial-8_b.C | 8 ++++++ gcc/testsuite/g++.dg/modules/partial-8_c.C | 7 +++++ gcc/testsuite/g++.dg/modules/partial-8_d.C | 9 +++++++ 6 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/partial-8.h create mode 100644 gcc/testsuite/g++.dg/modules/partial-8_a.C create mode 100644 gcc/testsuite/g++.dg/modules/partial-8_b.C create mode 100644 gcc/testsuite/g++.dg/modules/partial-8_c.C create mode 100644 gcc/testsuite/g++.dg/modules/partial-8_d.C (limited to 'gcc') diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index e778262..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; 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 struct tuple_element; +template tuple_element get(T); + +// This case wasn't an issue for the PR, but worth double-checking +template constexpr int var = 123; +template void foo(T, int = var); 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 struct tuple_element; +template constexpr int var = 456; +module m:a; +template 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 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; -- cgit v1.1