aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <Thomas.Koenig@online.de>2007-02-19 20:49:10 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2007-02-19 20:49:10 +0000
commit567c915b047d488dbbe1a25bc3359ca4ce2ab994 (patch)
tree40c73c5243d3a275e9adee4142be718963ee6f81 /gcc
parentc116cd05fb0e993227162e466ba5f5093392e3e6 (diff)
downloadgcc-567c915b047d488dbbe1a25bc3359ca4ce2ab994.zip
gcc-567c915b047d488dbbe1a25bc3359ca4ce2ab994.tar.gz
gcc-567c915b047d488dbbe1a25bc3359ca4ce2ab994.tar.bz2
re PR libfortran/30533 ([4.1 only] minval, maxval missing for kind=1 and kind=2)
2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 PR libfortran/30765 * Makefile.am: Add $(srcdir) too all files in generated/. (i_maxloc0_c): Add maxloc0_4_i1.c, maxloc0_8_i1.c, maxloc0_16_i1.c, maxloc0_4_i2.c, maxloc0_8_i2.c and maxloc0_16_i2.c. (i_maxloc1_c): Add maxloc1_4_i1.c, maxloc1_8_i1.c, maxloc1_16_i1.c, maxloc1_4_i2.c, maxloc1_8_i2.c and maxloc1_16_i2.c. (i_maxval_c): Add maxval_i1.c and maxval_i2.c. (i_minloc0_c): Add minloc0_4_i1.c, minloc0_8_i1.c, minloc0_16_i1.c, minloc0_4_i2.c, minloc0_8_i2.c and minloc0_16_i2.c. (i_minloc_1.c): Add minloc1_4_i1.c, minloc1_8_i1.c, minloc1_16_i1.c, minloc1_4_i2.c, minloc1_8_i2.c and minloc1_16_i2.c. (i_minval_c): Add minval_i1.c and minval_i2.c. (i_sum_c): Add sum_i1.c and sum_i2.c. (i_product_c): Add product_i1.c and product_i2.c. (i_matmul_c): Add matmul_i1.c and matmul_i2.c. (gfor_built_specific_src): Remove $(srcdir) from target. (gfor_bulit_specific2_src): Likewise. Makefile.in: Regenerated. libgfortran.h: Add GFC_INTEGER_1_HUGE and GFC_INTEGER_2_HUGE. Add gfc_array_i1 and gfc_array_i2. * generated/matmul_i1.c: New file. * generated/matmul_i2.c: New file. * generated/maxloc0_16_i1.c: New file. * generated/maxloc0_16_i2.c: New file. * generated/maxloc0_4_i1.c: New file. * generated/maxloc0_4_i2.c: New file. * generated/maxloc0_8_i1.c: New file. * generated/maxloc0_8_i2.c: New file. * generated/maxloc1_16_i1.c: New file. * generated/maxloc1_16_i2.c: New file. * generated/maxloc1_4_i1.c: New file. * generated/maxloc1_4_i2.c: New file. * generated/maxloc1_8_i1.c: New file. * generated/maxloc1_8_i2.c: New file. * generated/maxval_i1.c: New file. * generated/maxval_i2.c: New file. * generated/minloc0_16_i1.c: New file. * generated/minloc0_16_i2.c: New file. * generated/minloc0_4_i1.c: New file. * generated/minloc0_4_i2.c: New file. * generated/minloc0_8_i1.c: New file. * generated/minloc0_8_i2.c: New file. * generated/minloc1_16_i1.c: New file. * generated/minloc1_16_i2.c: New file. * generated/minloc1_4_i1.c: New file. * generated/minloc1_4_i2.c: New file. * generated/minloc1_8_i1.c: New file. * generated/minloc1_8_i2.c: New file. * generated/minval_i1.c: New file. * generated/minval_i2.c: New file. * generated/product_i1.c: New file. * generated/product_i2.c: New file. * generated/sum_i1.c: New file. * generated/sum_i2.c: New file. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * fortran/iresolve.c(gfc_resolve_maxloc): Remove coercion of argument to default integer. (gfc_resolve_minloc): Likewise. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * gfortran.dg/intrinsic_intkinds_1.f90: New test. From-SVN: r122137
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/iresolve.c26
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_intkinds_1.f9020
4 files changed, 32 insertions, 26 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index af39568..1f2f26a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-19 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/30533
+ * fortran/iresolve.c(gfc_resolve_maxloc): Remove coercion of
+ argument to default integer.
+ (gfc_resolve_minloc): Likewise.
+
2007-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/30681
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 4ded73d..63741f2 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -1231,19 +1231,6 @@ gfc_resolve_maxloc (gfc_expr *f, gfc_expr *array, gfc_expr *dim,
else
name = "maxloc";
- /* If the rank of the function is nonzero, we are going to call
- a library function. Coerce the argument to one of the
- existing library functions for this case. */
-
- if (f->rank != 0 && array->ts.type == BT_INTEGER
- && array->ts.kind < gfc_default_integer_kind)
- {
- gfc_typespec ts;
- ts.type = BT_INTEGER;
- ts.kind = gfc_default_integer_kind;
- gfc_convert_type_warn (array, &ts, 2, 0);
- }
-
f->value.function.name
= gfc_get_string (PREFIX ("%s%d_%d_%c%d"), name, dim != NULL, f->ts.kind,
gfc_type_letter (array->ts.type), array->ts.kind);
@@ -1398,19 +1385,6 @@ gfc_resolve_minloc (gfc_expr *f, gfc_expr *array, gfc_expr *dim,
else
name = "minloc";
- /* If the rank of the function is nonzero, we are going to call
- a library function. Coerce the argument to one of the
- existing library functions for this case. */
-
- if (f->rank != 0 && array->ts.type == BT_INTEGER
- && array->ts.kind < gfc_default_integer_kind)
- {
- gfc_typespec ts;
- ts.type = BT_INTEGER;
- ts.kind = gfc_default_integer_kind;
- gfc_convert_type_warn (array, &ts, 2, 0);
- }
-
f->value.function.name
= gfc_get_string (PREFIX ("%s%d_%d_%c%d"), name, dim != NULL, f->ts.kind,
gfc_type_letter (array->ts.type), array->ts.kind);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1957a41..18be927 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-19 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/30533
+ * gfortran.dg/intrinsic_intkinds_1.f90: New test.
+
2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* gcc.dg/20031012-1.c: Replace -Walways-true with -Waddress.
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_intkinds_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_intkinds_1.f90
new file mode 100644
index 0000000..ea5057a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_intkinds_1.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+! Test assorted intrinsics for integer kinds 1 and 2
+program main
+ integer(kind=1), dimension(2,2) :: a
+ integer(kind=2), dimension(2,2) :: b
+ integer(kind=1), dimension(2) :: r1
+ integer(kind=2), dimension(2) :: r2
+ logical, dimension(2,2) :: ma
+ ma = .false.
+ a = reshape((/ 1_1, 2_1, 3_1, 4_1/), shape(a))
+ b = reshape((/ 1_2, 2_2, 3_2, 4_2/), shape(b))
+ if (any(sum(a,dim=2) /= (/ 4, 6 /))) call abort
+ if (any(sum(b,dim=2) /= (/ 4, 6 /))) call abort
+ if (any(product(a,dim=2) /= (/ 3, 8 /))) call abort
+ if (any(product(b,dim=2) /= (/ 3, 8 /))) call abort
+ if (any(matmul(a,a) /= reshape ( (/ 7, 10, 15, 22 /), shape(a)))) call abort
+ if (any(matmul(b,b) /= reshape ( (/ 7, 10, 15, 22 /), shape(b)))) call abort
+ if (any(maxval(a,dim=2,mask=ma) /= -128)) call abort
+ if (any(maxval(b,dim=2,mask=ma) /= -32768)) call abort
+end program main