This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, committed] Fix PR 36681 and 36590


Hello world,

the following was committed after Jerry's approval in the PR.

Thanks!

	Thomas

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.

Index: /home/ig25/gcc/trunk/gcc/fortran/iresolve.c
===================================================================
--- /home/ig25/gcc/trunk/gcc/fortran/iresolve.c	(revision 137255)
+++ /home/ig25/gcc/trunk/gcc/fortran/iresolve.c	(working copy)
@@ -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;
! { 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   

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]