diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-07-02 14:36:58 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-07-02 14:36:58 +0000 |
commit | 04f2b606255665f14665146c28f6236d6f932dab (patch) | |
tree | b292619ea2a0ca4884361d167cf56acc48f113a1 /gcc | |
parent | 795a337af630f9b03093c409d722f5cfe3343ddc (diff) | |
download | gcc-04f2b606255665f14665146c28f6236d6f932dab.zip gcc-04f2b606255665f14665146c28f6236d6f932dab.tar.gz gcc-04f2b606255665f14665146c28f6236d6f932dab.tar.bz2 |
re PR fortran/36590 (internal error: Can't convert LOGICAL(1) to LOGICAL(1))
2008-07-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36590
PR fortran/36681
* iresolve.c (resolve_mask_arg): Don't convert mask to
kind=1 logical if it is of that type already.
2008-07-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36590
PR fortran/36681
* gfortran.dg/count_mask_1.f90: New test.
From-SVN: r137355
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/iresolve.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/count_mask_1.f90 | 8 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a54a0b1..82c2392 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2008-07-02 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/36590 + PR fortran/36681 + * iresolve.c (resolve_mask_arg): Don't convert mask to + kind=1 logical if it is of that type already. + 2008-06-29 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36341 diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index a1e7622..64a24e8 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -106,7 +106,7 @@ resolve_mask_arg (gfc_expr *mask) /* In the library, we access the mask with a GFC_LOGICAL_1 argument. No need to waste memory if we are about to create a temporary array. */ - if (mask->expr_type == EXPR_OP) + if (mask->expr_type == EXPR_OP && mask->ts.kind != 1) { ts.type = BT_LOGICAL; ts.kind = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce0c2c6..ab606ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-07-02 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/36590 + PR fortran/36681 + * gfortran.dg/count_mask_1.f90: New test. + 2008-07-02 Ira Rosen <irar@il.ibm.com> * gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c: Add noinline diff --git a/gcc/testsuite/gfortran.dg/count_mask_1.f90 b/gcc/testsuite/gfortran.dg/count_mask_1.f90 new file mode 100644 index 0000000..f9859fa --- /dev/null +++ b/gcc/testsuite/gfortran.dg/count_mask_1.f90 @@ -0,0 +1,8 @@ +! { dg-do run } +! PR 36590, PR 36681 +program test + logical(kind=1),parameter :: t=.true.,f=.false. + logical(kind=1),dimension(9) :: hexa,hexb + data hexa/f,f,t,t,f,f,f,t,f/,hexb/f,t,f,f,f,t,t,f,f/ + isum=count(hexa(1:9).eqv.hexb(1:9)) +end program |