gcc/libgfortran/generated/maxloc2_16_s4.c

162 lines
4.2 KiB
C
Raw Normal View History

re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
/* Implementation of the MAXLOC intrinsic
Copyright (C) 2017-2020 Free Software Foundation, Inc.
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
Contributed by Thomas Koenig
This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
Libgfortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "libgfortran.h"
#include <stdlib.h>
#include <string.h>
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
#include <assert.h>
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC. (gfc_check_f): Add f6fl field. (gfc_simplify_f): Add f6 field. (gfc_resolve_f): Likewise. (gfc_type_letter): Add optional logical_equas_int flag. * check.c (intrinsic_type_check): New function. (gfc_check_findloc): New function. * intrinsics.c (gfc_type_letter): If logical_equals_int is set, act accordingly. (add_sym_5ml): Reformat comment. (add_sym_6fl): New function. (add_functions): Add findloc. (check_arglist): Add sixth argument, handle it. (resolve_intrinsic): Likewise. (check_specific): Handle findloc. * intrinsic.h (gfc_check_findloc): Add prototype. (gfc_simplify_findloc): Likewise. (gfc_resolve_findloc): Likewise. (MAX_INTRINSIC_ARGS): Adjust. * iresolve.c (gfc_resolve_findloc): New function. * simplify.c (gfc_simplify_minmaxloc): Make static. (simplify_findloc_to_scalar): New function. (simplify_findloc_nodim): New function. (simplify_findloc_to_array): New function. (gfc_simplify_findloc): New function. (gfc_conv_intrinsic_findloc): New function. (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC. (gfc_is_intrinsic_libcall): Likewise. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * Makefile.am: Add files for findloc. * Makefile.in: Regenerated. * libgfortran.h (gfc_array_index_type): Add. (gfc_array_s1): Add using GFC_UINTEGER_1. (gfc_array_s4): Likewise. Replace unnecessary comment. (HAVE_GFC_UINTEGER_1): Define. (HAVE_GFC_UINTEGER_4): Define. * m4/findloc0.m4: New file. * m4/findloc0s.m4: New file. * m4/findloc1.m4: New file. * m4/findloc1s.m4: New file. * m4/findloc2s.m4: New file. * m4/ifindloc0.m4: New file. * m4/ifindloc1.m4: New file. * m4/ifindloc2.m4: New file. * m4/iparm.m4: Use unsigned integer for characters. * generated/findloc0_c16.c: New file. * generated/findloc0_c4.c: New file. * generated/findloc0_c8.c: New file. * generated/findloc0_i1.c: New file. * generated/findloc0_i16.c: New file. * generated/findloc0_i2.c: New file. * generated/findloc0_i4.c: New file. * generated/findloc0_i8.c: New file. * generated/findloc0_r16.c: New file. * generated/findloc0_r4.c: New file. * generated/findloc0_r8.c: New file. * generated/findloc0_s1.c: New file. * generated/findloc0_s4.c: New file. * generated/findloc1_c16.c: New file. * generated/findloc1_c4.c: New file. * generated/findloc1_c8.c: New file. * generated/findloc1_i1.c: New file. * generated/findloc1_i16.c: New file. * generated/findloc1_i2.c: New file. * generated/findloc1_i4.c: New file. * generated/findloc1_i8.c: New file. * generated/findloc1_r16.c: New file. * generated/findloc1_r4.c: New file. * generated/findloc1_r8.c: New file. * generated/findloc1_s1.c: New file. * generated/findloc1_s4.c: New file. * generated/findloc2_s1.c: New file. * generated/findloc2_s4.c: New file. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/findloc_1.f90: New test. * gfortran.dg/findloc_2.f90: New test. * gfortran.dg/findloc_3.f90: New test. * gfortran.dg/findloc_4.f90: New test. * gfortran.dg/findloc_5.f90: New test. * gfortran.dg/findloc_6.f90: New test. From-SVN: r265570
2018-10-28 12:05:05 +01:00
#if defined (HAVE_GFC_UINTEGER_4) && defined (HAVE_GFC_INTEGER_16)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
static inline int
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC. (gfc_check_f): Add f6fl field. (gfc_simplify_f): Add f6 field. (gfc_resolve_f): Likewise. (gfc_type_letter): Add optional logical_equas_int flag. * check.c (intrinsic_type_check): New function. (gfc_check_findloc): New function. * intrinsics.c (gfc_type_letter): If logical_equals_int is set, act accordingly. (add_sym_5ml): Reformat comment. (add_sym_6fl): New function. (add_functions): Add findloc. (check_arglist): Add sixth argument, handle it. (resolve_intrinsic): Likewise. (check_specific): Handle findloc. * intrinsic.h (gfc_check_findloc): Add prototype. (gfc_simplify_findloc): Likewise. (gfc_resolve_findloc): Likewise. (MAX_INTRINSIC_ARGS): Adjust. * iresolve.c (gfc_resolve_findloc): New function. * simplify.c (gfc_simplify_minmaxloc): Make static. (simplify_findloc_to_scalar): New function. (simplify_findloc_nodim): New function. (simplify_findloc_to_array): New function. (gfc_simplify_findloc): New function. (gfc_conv_intrinsic_findloc): New function. (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC. (gfc_is_intrinsic_libcall): Likewise. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * Makefile.am: Add files for findloc. * Makefile.in: Regenerated. * libgfortran.h (gfc_array_index_type): Add. (gfc_array_s1): Add using GFC_UINTEGER_1. (gfc_array_s4): Likewise. Replace unnecessary comment. (HAVE_GFC_UINTEGER_1): Define. (HAVE_GFC_UINTEGER_4): Define. * m4/findloc0.m4: New file. * m4/findloc0s.m4: New file. * m4/findloc1.m4: New file. * m4/findloc1s.m4: New file. * m4/findloc2s.m4: New file. * m4/ifindloc0.m4: New file. * m4/ifindloc1.m4: New file. * m4/ifindloc2.m4: New file. * m4/iparm.m4: Use unsigned integer for characters. * generated/findloc0_c16.c: New file. * generated/findloc0_c4.c: New file. * generated/findloc0_c8.c: New file. * generated/findloc0_i1.c: New file. * generated/findloc0_i16.c: New file. * generated/findloc0_i2.c: New file. * generated/findloc0_i4.c: New file. * generated/findloc0_i8.c: New file. * generated/findloc0_r16.c: New file. * generated/findloc0_r4.c: New file. * generated/findloc0_r8.c: New file. * generated/findloc0_s1.c: New file. * generated/findloc0_s4.c: New file. * generated/findloc1_c16.c: New file. * generated/findloc1_c4.c: New file. * generated/findloc1_c8.c: New file. * generated/findloc1_i1.c: New file. * generated/findloc1_i16.c: New file. * generated/findloc1_i2.c: New file. * generated/findloc1_i4.c: New file. * generated/findloc1_i8.c: New file. * generated/findloc1_r16.c: New file. * generated/findloc1_r4.c: New file. * generated/findloc1_r8.c: New file. * generated/findloc1_s1.c: New file. * generated/findloc1_s4.c: New file. * generated/findloc2_s1.c: New file. * generated/findloc2_s4.c: New file. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/findloc_1.f90: New test. * gfortran.dg/findloc_2.f90: New test. * gfortran.dg/findloc_3.f90: New test. * gfortran.dg/findloc_4.f90: New test. * gfortran.dg/findloc_5.f90: New test. * gfortran.dg/findloc_6.f90: New test. From-SVN: r265570
2018-10-28 12:05:05 +01:00
compare_fcn (const GFC_UINTEGER_4 *a, const GFC_UINTEGER_4 *b, gfc_charlen_type n)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC. (gfc_check_f): Add f6fl field. (gfc_simplify_f): Add f6 field. (gfc_resolve_f): Likewise. (gfc_type_letter): Add optional logical_equas_int flag. * check.c (intrinsic_type_check): New function. (gfc_check_findloc): New function. * intrinsics.c (gfc_type_letter): If logical_equals_int is set, act accordingly. (add_sym_5ml): Reformat comment. (add_sym_6fl): New function. (add_functions): Add findloc. (check_arglist): Add sixth argument, handle it. (resolve_intrinsic): Likewise. (check_specific): Handle findloc. * intrinsic.h (gfc_check_findloc): Add prototype. (gfc_simplify_findloc): Likewise. (gfc_resolve_findloc): Likewise. (MAX_INTRINSIC_ARGS): Adjust. * iresolve.c (gfc_resolve_findloc): New function. * simplify.c (gfc_simplify_minmaxloc): Make static. (simplify_findloc_to_scalar): New function. (simplify_findloc_nodim): New function. (simplify_findloc_to_array): New function. (gfc_simplify_findloc): New function. (gfc_conv_intrinsic_findloc): New function. (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC. (gfc_is_intrinsic_libcall): Likewise. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * Makefile.am: Add files for findloc. * Makefile.in: Regenerated. * libgfortran.h (gfc_array_index_type): Add. (gfc_array_s1): Add using GFC_UINTEGER_1. (gfc_array_s4): Likewise. Replace unnecessary comment. (HAVE_GFC_UINTEGER_1): Define. (HAVE_GFC_UINTEGER_4): Define. * m4/findloc0.m4: New file. * m4/findloc0s.m4: New file. * m4/findloc1.m4: New file. * m4/findloc1s.m4: New file. * m4/findloc2s.m4: New file. * m4/ifindloc0.m4: New file. * m4/ifindloc1.m4: New file. * m4/ifindloc2.m4: New file. * m4/iparm.m4: Use unsigned integer for characters. * generated/findloc0_c16.c: New file. * generated/findloc0_c4.c: New file. * generated/findloc0_c8.c: New file. * generated/findloc0_i1.c: New file. * generated/findloc0_i16.c: New file. * generated/findloc0_i2.c: New file. * generated/findloc0_i4.c: New file. * generated/findloc0_i8.c: New file. * generated/findloc0_r16.c: New file. * generated/findloc0_r4.c: New file. * generated/findloc0_r8.c: New file. * generated/findloc0_s1.c: New file. * generated/findloc0_s4.c: New file. * generated/findloc1_c16.c: New file. * generated/findloc1_c4.c: New file. * generated/findloc1_c8.c: New file. * generated/findloc1_i1.c: New file. * generated/findloc1_i16.c: New file. * generated/findloc1_i2.c: New file. * generated/findloc1_i4.c: New file. * generated/findloc1_i8.c: New file. * generated/findloc1_r16.c: New file. * generated/findloc1_r4.c: New file. * generated/findloc1_r8.c: New file. * generated/findloc1_s1.c: New file. * generated/findloc1_s4.c: New file. * generated/findloc2_s1.c: New file. * generated/findloc2_s4.c: New file. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/findloc_1.f90: New test. * gfortran.dg/findloc_2.f90: New test. * gfortran.dg/findloc_3.f90: New test. * gfortran.dg/findloc_4.f90: New test. * gfortran.dg/findloc_5.f90: New test. * gfortran.dg/findloc_6.f90: New test. From-SVN: r265570
2018-10-28 12:05:05 +01:00
if (sizeof (GFC_UINTEGER_4) == 1)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
return memcmp (a, b, n);
else
return memcmp_char4 (a, b, n);
}
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
extern GFC_INTEGER_16 maxloc2_16_s4 (gfc_array_s4 * const restrict, GFC_LOGICAL_4 back,
gfc_charlen_type);
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
export_proto(maxloc2_16_s4);
GFC_INTEGER_16
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
maxloc2_16_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 back, gfc_charlen_type len)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
index_type ret;
index_type sstride;
index_type extent;
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC. (gfc_check_f): Add f6fl field. (gfc_simplify_f): Add f6 field. (gfc_resolve_f): Likewise. (gfc_type_letter): Add optional logical_equas_int flag. * check.c (intrinsic_type_check): New function. (gfc_check_findloc): New function. * intrinsics.c (gfc_type_letter): If logical_equals_int is set, act accordingly. (add_sym_5ml): Reformat comment. (add_sym_6fl): New function. (add_functions): Add findloc. (check_arglist): Add sixth argument, handle it. (resolve_intrinsic): Likewise. (check_specific): Handle findloc. * intrinsic.h (gfc_check_findloc): Add prototype. (gfc_simplify_findloc): Likewise. (gfc_resolve_findloc): Likewise. (MAX_INTRINSIC_ARGS): Adjust. * iresolve.c (gfc_resolve_findloc): New function. * simplify.c (gfc_simplify_minmaxloc): Make static. (simplify_findloc_to_scalar): New function. (simplify_findloc_nodim): New function. (simplify_findloc_to_array): New function. (gfc_simplify_findloc): New function. (gfc_conv_intrinsic_findloc): New function. (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC. (gfc_is_intrinsic_libcall): Likewise. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * Makefile.am: Add files for findloc. * Makefile.in: Regenerated. * libgfortran.h (gfc_array_index_type): Add. (gfc_array_s1): Add using GFC_UINTEGER_1. (gfc_array_s4): Likewise. Replace unnecessary comment. (HAVE_GFC_UINTEGER_1): Define. (HAVE_GFC_UINTEGER_4): Define. * m4/findloc0.m4: New file. * m4/findloc0s.m4: New file. * m4/findloc1.m4: New file. * m4/findloc1s.m4: New file. * m4/findloc2s.m4: New file. * m4/ifindloc0.m4: New file. * m4/ifindloc1.m4: New file. * m4/ifindloc2.m4: New file. * m4/iparm.m4: Use unsigned integer for characters. * generated/findloc0_c16.c: New file. * generated/findloc0_c4.c: New file. * generated/findloc0_c8.c: New file. * generated/findloc0_i1.c: New file. * generated/findloc0_i16.c: New file. * generated/findloc0_i2.c: New file. * generated/findloc0_i4.c: New file. * generated/findloc0_i8.c: New file. * generated/findloc0_r16.c: New file. * generated/findloc0_r4.c: New file. * generated/findloc0_r8.c: New file. * generated/findloc0_s1.c: New file. * generated/findloc0_s4.c: New file. * generated/findloc1_c16.c: New file. * generated/findloc1_c4.c: New file. * generated/findloc1_c8.c: New file. * generated/findloc1_i1.c: New file. * generated/findloc1_i16.c: New file. * generated/findloc1_i2.c: New file. * generated/findloc1_i4.c: New file. * generated/findloc1_i8.c: New file. * generated/findloc1_r16.c: New file. * generated/findloc1_r4.c: New file. * generated/findloc1_r8.c: New file. * generated/findloc1_s1.c: New file. * generated/findloc1_s4.c: New file. * generated/findloc2_s1.c: New file. * generated/findloc2_s4.c: New file. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/findloc_1.f90: New test. * gfortran.dg/findloc_2.f90: New test. * gfortran.dg/findloc_3.f90: New test. * gfortran.dg/findloc_4.f90: New test. * gfortran.dg/findloc_5.f90: New test. * gfortran.dg/findloc_6.f90: New test. From-SVN: r265570
2018-10-28 12:05:05 +01:00
const GFC_UINTEGER_4 *src;
const GFC_UINTEGER_4 *maxval;
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
index_type i;
extent = GFC_DESCRIPTOR_EXTENT(array,0);
if (extent <= 0)
return 0;
sstride = GFC_DESCRIPTOR_STRIDE(array,0) * len;
ret = 1;
src = array->base_addr;
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * check.c (gfc_check_minmaxloc): Remove error for BACK not being implemented. Use gfc_logical_4_kind for BACK. * simplify.c (min_max_choose): Add optional argument back_val. Handle it. (simplify_minmaxloc_to_scalar): Add argument back_val. Pass back_val to min_max_choose. (simplify_minmaxloc_to_nodim): Likewise. (simplify_minmaxloc_to_array): Likewise. (gfc_simplify_minmaxloc): Add argument back, handle it. Pass back_val to specific simplification functions. (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back, pass it on to gfc_simplify_minmaxloc. (gfc_simplify_maxloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust comment. If BACK is true, use greater or equal (or lesser or equal) insteal of greater (or lesser). Mark the condition of having found a value which exceeds the limit as unlikely. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iforeach-s.m4: Remove assertion that back is zero. * m4/iforeach.m4: Likewise. Remove leading 'do' before implementation start. * m4/ifunction-s.m4: Remove assertion that back is zero. * m4/ifunction.m4: Likewise. Remove for loop if HAVE_BACK_ARG is defined. * m4/maxloc0.m4: Reorganize loops. Split loops between >= and =, depending if back is true. Mark the condition of having found a value which exceeds the limit as unlikely. * m4/minloc0.m4: Likewise. * m4/maxloc1.m4: Likewise. * m4/minloc1.m4: Likewise. * m4/maxloc1s.m4: Handle back argument. * m4/minloc1s.m4: Likewise. * m4/maxloc2s.m4: Remove assertion that back is zero. Remove special handling of loop start. Handle back argument. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_12.f90: New test case. * gfortran.dg/minmaxloc_13.f90: New test case. From-SVN: r260023
2018-05-08 09:47:19 +02:00
maxval = NULL;
for (i=1; i<=extent; i++)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * check.c (gfc_check_minmaxloc): Remove error for BACK not being implemented. Use gfc_logical_4_kind for BACK. * simplify.c (min_max_choose): Add optional argument back_val. Handle it. (simplify_minmaxloc_to_scalar): Add argument back_val. Pass back_val to min_max_choose. (simplify_minmaxloc_to_nodim): Likewise. (simplify_minmaxloc_to_array): Likewise. (gfc_simplify_minmaxloc): Add argument back, handle it. Pass back_val to specific simplification functions. (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back, pass it on to gfc_simplify_minmaxloc. (gfc_simplify_maxloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust comment. If BACK is true, use greater or equal (or lesser or equal) insteal of greater (or lesser). Mark the condition of having found a value which exceeds the limit as unlikely. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iforeach-s.m4: Remove assertion that back is zero. * m4/iforeach.m4: Likewise. Remove leading 'do' before implementation start. * m4/ifunction-s.m4: Remove assertion that back is zero. * m4/ifunction.m4: Likewise. Remove for loop if HAVE_BACK_ARG is defined. * m4/maxloc0.m4: Reorganize loops. Split loops between >= and =, depending if back is true. Mark the condition of having found a value which exceeds the limit as unlikely. * m4/minloc0.m4: Likewise. * m4/maxloc1.m4: Likewise. * m4/minloc1.m4: Likewise. * m4/maxloc1s.m4: Handle back argument. * m4/minloc1s.m4: Likewise. * m4/maxloc2s.m4: Remove assertion that back is zero. Remove special handling of loop start. Handle back argument. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_12.f90: New test case. * gfortran.dg/minmaxloc_13.f90: New test case. From-SVN: r260023
2018-05-08 09:47:19 +02:00
if (maxval == NULL || (back ? compare_fcn (src, maxval, len) >= 0 :
compare_fcn (src, maxval, len) > 0))
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
ret = i;
maxval = src;
}
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * check.c (gfc_check_minmaxloc): Remove error for BACK not being implemented. Use gfc_logical_4_kind for BACK. * simplify.c (min_max_choose): Add optional argument back_val. Handle it. (simplify_minmaxloc_to_scalar): Add argument back_val. Pass back_val to min_max_choose. (simplify_minmaxloc_to_nodim): Likewise. (simplify_minmaxloc_to_array): Likewise. (gfc_simplify_minmaxloc): Add argument back, handle it. Pass back_val to specific simplification functions. (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back, pass it on to gfc_simplify_minmaxloc. (gfc_simplify_maxloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust comment. If BACK is true, use greater or equal (or lesser or equal) insteal of greater (or lesser). Mark the condition of having found a value which exceeds the limit as unlikely. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iforeach-s.m4: Remove assertion that back is zero. * m4/iforeach.m4: Likewise. Remove leading 'do' before implementation start. * m4/ifunction-s.m4: Remove assertion that back is zero. * m4/ifunction.m4: Likewise. Remove for loop if HAVE_BACK_ARG is defined. * m4/maxloc0.m4: Reorganize loops. Split loops between >= and =, depending if back is true. Mark the condition of having found a value which exceeds the limit as unlikely. * m4/minloc0.m4: Likewise. * m4/maxloc1.m4: Likewise. * m4/minloc1.m4: Likewise. * m4/maxloc1s.m4: Handle back argument. * m4/minloc1s.m4: Likewise. * m4/maxloc2s.m4: Remove assertion that back is zero. Remove special handling of loop start. Handle back argument. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_12.f90: New test case. * gfortran.dg/minmaxloc_13.f90: New test case. From-SVN: r260023
2018-05-08 09:47:19 +02:00
src += sstride;
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
}
return ret;
}
extern GFC_INTEGER_16 mmaxloc2_16_s4 (gfc_array_s4 * const restrict,
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
gfc_array_l1 *const restrict mask, GFC_LOGICAL_4 back,
gfc_charlen_type);
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
export_proto(mmaxloc2_16_s4);
GFC_INTEGER_16
mmaxloc2_16_s4 (gfc_array_s4 * const restrict array,
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
gfc_array_l1 * const restrict mask, GFC_LOGICAL_4 back,
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
gfc_charlen_type len)
{
index_type ret;
index_type sstride;
index_type extent;
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC. (gfc_check_f): Add f6fl field. (gfc_simplify_f): Add f6 field. (gfc_resolve_f): Likewise. (gfc_type_letter): Add optional logical_equas_int flag. * check.c (intrinsic_type_check): New function. (gfc_check_findloc): New function. * intrinsics.c (gfc_type_letter): If logical_equals_int is set, act accordingly. (add_sym_5ml): Reformat comment. (add_sym_6fl): New function. (add_functions): Add findloc. (check_arglist): Add sixth argument, handle it. (resolve_intrinsic): Likewise. (check_specific): Handle findloc. * intrinsic.h (gfc_check_findloc): Add prototype. (gfc_simplify_findloc): Likewise. (gfc_resolve_findloc): Likewise. (MAX_INTRINSIC_ARGS): Adjust. * iresolve.c (gfc_resolve_findloc): New function. * simplify.c (gfc_simplify_minmaxloc): Make static. (simplify_findloc_to_scalar): New function. (simplify_findloc_nodim): New function. (simplify_findloc_to_array): New function. (gfc_simplify_findloc): New function. (gfc_conv_intrinsic_findloc): New function. (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC. (gfc_is_intrinsic_libcall): Likewise. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * Makefile.am: Add files for findloc. * Makefile.in: Regenerated. * libgfortran.h (gfc_array_index_type): Add. (gfc_array_s1): Add using GFC_UINTEGER_1. (gfc_array_s4): Likewise. Replace unnecessary comment. (HAVE_GFC_UINTEGER_1): Define. (HAVE_GFC_UINTEGER_4): Define. * m4/findloc0.m4: New file. * m4/findloc0s.m4: New file. * m4/findloc1.m4: New file. * m4/findloc1s.m4: New file. * m4/findloc2s.m4: New file. * m4/ifindloc0.m4: New file. * m4/ifindloc1.m4: New file. * m4/ifindloc2.m4: New file. * m4/iparm.m4: Use unsigned integer for characters. * generated/findloc0_c16.c: New file. * generated/findloc0_c4.c: New file. * generated/findloc0_c8.c: New file. * generated/findloc0_i1.c: New file. * generated/findloc0_i16.c: New file. * generated/findloc0_i2.c: New file. * generated/findloc0_i4.c: New file. * generated/findloc0_i8.c: New file. * generated/findloc0_r16.c: New file. * generated/findloc0_r4.c: New file. * generated/findloc0_r8.c: New file. * generated/findloc0_s1.c: New file. * generated/findloc0_s4.c: New file. * generated/findloc1_c16.c: New file. * generated/findloc1_c4.c: New file. * generated/findloc1_c8.c: New file. * generated/findloc1_i1.c: New file. * generated/findloc1_i16.c: New file. * generated/findloc1_i2.c: New file. * generated/findloc1_i4.c: New file. * generated/findloc1_i8.c: New file. * generated/findloc1_r16.c: New file. * generated/findloc1_r4.c: New file. * generated/findloc1_r8.c: New file. * generated/findloc1_s1.c: New file. * generated/findloc1_s4.c: New file. * generated/findloc2_s1.c: New file. * generated/findloc2_s4.c: New file. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. 2017-10-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/findloc_1.f90: New test. * gfortran.dg/findloc_2.f90: New test. * gfortran.dg/findloc_3.f90: New test. * gfortran.dg/findloc_4.f90: New test. * gfortran.dg/findloc_5.f90: New test. * gfortran.dg/findloc_6.f90: New test. From-SVN: r265570
2018-10-28 12:05:05 +01:00
const GFC_UINTEGER_4 *src;
const GFC_UINTEGER_4 *maxval;
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
index_type i, j;
GFC_LOGICAL_1 *mbase;
int mask_kind;
index_type mstride;
extent = GFC_DESCRIPTOR_EXTENT(array,0);
if (extent <= 0)
return 0;
sstride = GFC_DESCRIPTOR_STRIDE(array,0) * len;
mask_kind = GFC_DESCRIPTOR_SIZE (mask);
mbase = mask->base_addr;
if (mask_kind == 1 || mask_kind == 2 || mask_kind == 4 || mask_kind == 8
#ifdef HAVE_GFC_LOGICAL_16
|| mask_kind == 16
#endif
)
mbase = GFOR_POINTER_TO_L1 (mbase, mask_kind);
else
internal_error (NULL, "Funny sized logical array");
mstride = GFC_DESCRIPTOR_STRIDE_BYTES(mask,0);
/* Search for the first occurrence of a true element in mask. */
for (j=0; j<extent; j++)
{
if (*mbase)
break;
mbase += mstride;
}
if (j == extent)
return 0;
ret = j + 1;
src = array->base_addr + j * sstride;
maxval = src;
for (i=j+1; i<=extent; i++)
{
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * check.c (gfc_check_minmaxloc): Remove error for BACK not being implemented. Use gfc_logical_4_kind for BACK. * simplify.c (min_max_choose): Add optional argument back_val. Handle it. (simplify_minmaxloc_to_scalar): Add argument back_val. Pass back_val to min_max_choose. (simplify_minmaxloc_to_nodim): Likewise. (simplify_minmaxloc_to_array): Likewise. (gfc_simplify_minmaxloc): Add argument back, handle it. Pass back_val to specific simplification functions. (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back, pass it on to gfc_simplify_minmaxloc. (gfc_simplify_maxloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust comment. If BACK is true, use greater or equal (or lesser or equal) insteal of greater (or lesser). Mark the condition of having found a value which exceeds the limit as unlikely. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iforeach-s.m4: Remove assertion that back is zero. * m4/iforeach.m4: Likewise. Remove leading 'do' before implementation start. * m4/ifunction-s.m4: Remove assertion that back is zero. * m4/ifunction.m4: Likewise. Remove for loop if HAVE_BACK_ARG is defined. * m4/maxloc0.m4: Reorganize loops. Split loops between >= and =, depending if back is true. Mark the condition of having found a value which exceeds the limit as unlikely. * m4/minloc0.m4: Likewise. * m4/maxloc1.m4: Likewise. * m4/minloc1.m4: Likewise. * m4/maxloc1s.m4: Handle back argument. * m4/minloc1s.m4: Likewise. * m4/maxloc2s.m4: Remove assertion that back is zero. Remove special handling of loop start. Handle back argument. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxloc2_16_s1.c: Regenerated. * generated/maxloc2_16_s4.c: Regenerated. * generated/maxloc2_4_s1.c: Regenerated. * generated/maxloc2_4_s4.c: Regenerated. * generated/maxloc2_8_s1.c: Regenerated. * generated/maxloc2_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minloc2_16_s1.c: Regenerated. * generated/minloc2_16_s4.c: Regenerated. * generated/minloc2_4_s1.c: Regenerated. * generated/minloc2_4_s4.c: Regenerated. * generated/minloc2_8_s1.c: Regenerated. * generated/minloc2_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_12.f90: New test case. * gfortran.dg/minmaxloc_13.f90: New test case. From-SVN: r260023
2018-05-08 09:47:19 +02:00
if (*mbase && (back ? compare_fcn (src, maxval, len) >= 0 :
compare_fcn (src, maxval, len) > 0))
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
ret = i;
maxval = src;
}
src += sstride;
mbase += mstride;
}
return ret;
}
extern GFC_INTEGER_16 smaxloc2_16_s4 (gfc_array_s4 * const restrict,
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type);
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
export_proto(smaxloc2_16_s4);
GFC_INTEGER_16
smaxloc2_16_s4 (gfc_array_s4 * const restrict array,
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
GFC_LOGICAL_4 *mask, GFC_LOGICAL_4 back, gfc_charlen_type len)
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
{
if (mask)
re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.h (gfc_check_f): Rename f4ml to f5ml. (gfc_logical_4_kind): New macro * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument. (gfc_simplify_maxloc): Likewise. (gfc_resolve_maxloc): Likewise. (gfc_resolve_minloc): Likewise. * check.c (gfc_check_minloc_maxloc): Add checking for "back" argument; also raise error if it is used (for now). Add it if it isn't present. * intrinsic.c (add_sym_4ml): Rename to (add_sym_5ml), adjust for extra argument. (add_functions): Add "back" constant. Adjust maxloc and minloc for back argument. * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is not of gfc_logical_4_kind, convert. (gfc_resolve_minloc): Likewise. * simplify.c (gfc_simplify_minloc): Add back argument. (gfc_simplify_maxloc): Likewise. * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last argument to %VAL to ensure passing by value. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc also for library calls. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * m4/iparm.m4: Add back_arg macro if in minloc or maxloc. * m4/iforeach-s.m4: Add optional argument back with back_arg macro. Improve m4 quoting. If HAVE_BACK_ARG is defined, assert that back is non-true. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction.m4: Likewise. * m4/maxloc0.m4: Include assert.h * m4/minloc0.m4: Likewise. * m4/maxloc0s.m4: #define HAVE_BACK_ARG. * m4/minloc0s.m4: Likewise. * m4/maxloc1s.m4: Likewise. * m4/minloc1s.m4: Likewise. * m4/maxloc1.m4: Include assert.h, #define HAVE_BACK_ARG. * m4/minloc1.m4: Likewise. * m4/maxloc2s.m4: Add assert.h, add back_arg, assert that back is non-true. * m4/minloc2s.m4: Likewise. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/parity_l1.c: Regenerated. * generated/parity_l16.c: Regenerated. * generated/parity_l2.c: Regenerated. * generated/parity_l4.c: Regenerated. * generated/parity_l8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/54613 * gfortran.dg/minmaxloc_9.f90: New test. * gfortran.dg/minmaxloc_10.f90: New test. * gfortran.dg/minmaxloc_11.f90: New test. From-SVN: r256705
2018-01-15 19:35:13 +01:00
return maxloc2_16_s4 (array, len, back);
re PR fortran/36313 ([F03] {MIN,MAX}{LOC,VAL} should accept character arguments) 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * Makefile.am: Add i_maxloc0s_c, i_maxloc1s_c, i_maxloc2s_c, i_minloc0s_c, i_minloc1s_c and i_minloc2s_c. * Makefile.in: Regenerated. * generated/maxloc0_16_s1.c: New file. * generated/maxloc0_16_s4.c: New file. * generated/maxloc0_4_s1.c: New file. * generated/maxloc0_4_s4.c: New file. * generated/maxloc0_8_s1.c: New file. * generated/maxloc0_8_s4.c: New file. * generated/maxloc1_16_s1.c: New file. * generated/maxloc1_16_s4.c: New file. * generated/maxloc1_4_s1.c: New file. * generated/maxloc1_4_s4.c: New file. * generated/maxloc1_8_s1.c: New file. * generated/maxloc1_8_s4.c: New file. * generated/maxloc2_16_s1.c: New file. * generated/maxloc2_16_s4.c: New file. * generated/maxloc2_4_s1.c: New file. * generated/maxloc2_4_s4.c: New file. * generated/maxloc2_8_s1.c: New file. * generated/maxloc2_8_s4.c: New file. * generated/minloc0_16_s1.c: New file. * generated/minloc0_16_s4.c: New file. * generated/minloc0_4_s1.c: New file. * generated/minloc0_4_s4.c: New file. * generated/minloc0_8_s1.c: New file. * generated/minloc0_8_s4.c: New file. * generated/minloc1_16_s1.c: New file. * generated/minloc1_16_s4.c: New file. * generated/minloc1_4_s1.c: New file. * generated/minloc1_4_s4.c: New file. * generated/minloc1_8_s1.c: New file. * generated/minloc1_8_s4.c: New file. * generated/minloc2_16_s1.c: New file. * generated/minloc2_16_s4.c: New file. * generated/minloc2_4_s1.c: New file. * generated/minloc2_4_s4.c: New file. * generated/minloc2_8_s1.c: New file. * generated/minloc2_8_s4.c: New file. * m4/iforeach-s.m4: New file. * m4/ifunction-s.m4: New file. * m4/maxloc0s.m4: New file. * m4/maxloc1s.m4: New file. * m4/maxloc2s.m4: New file. * m4/minloc0s.m4: New file. * m4/minloc1s.m4: New file. * m4/minloc2s.m4: New file. * gfortran.map: Add new functions. * libgfortran.h: Add gfc_array_s1 and gfc_array_s4. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * check.c (int_or_real_or_char_check_f2003): New function. * iresolve.c (gfc_resolve_maxloc): Add number "2" for character arguments and rank-zero return value. (gfc_resolve_minloc): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of character arguments and rank-zero return value by removing unneeded arguments and calling the library function. 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36313 * gfortran.dg/maxloc_string_1.f90: New test. * gfortran.dg/minloc_string_1.f90: New test. From-SVN: r255070
2017-11-22 19:08:07 +01:00
else
return 0;
}
#endif