PR fortran/34817
PR fortran/34838
* iresolve.c (gfc_resolve_all): Remove conversion of mask
argument to kind=1 by removing call to resolve_mask_arg().
(gfc_resolve_any): Likewise.
2008-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/34817
PR fortran/34838
* gfortran.dg/any_all_1.f90: New test.
* gfortran.dg/any_all_2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131660
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/34817
+ PR fortran/34838
+ * iresolve.c (gfc_resolve_all): Remove conversion of mask
+ argument to kind=1 by removing call to resolve_mask_arg().
+ (gfc_resolve_any): Likewise.
+
2008-01-19 Tobias Burnus <burnus@net-b.de>
PR fortran/34760
f->shape = gfc_copy_shape_excluding (mask->shape, mask->rank, dim);
}
- resolve_mask_arg (mask);
-
f->value.function.name
= gfc_get_string (PREFIX ("all_%c%d"), gfc_type_letter (mask->ts.type),
mask->ts.kind);
f->shape = gfc_copy_shape_excluding (mask->shape, mask->rank, dim);
}
- resolve_mask_arg (mask);
-
f->value.function.name
= gfc_get_string (PREFIX ("any_%c%d"), gfc_type_letter (mask->ts.type),
mask->ts.kind);
+2008-01-19 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/34817
+ PR fortran/34838
+ * gfortran.dg/any_all_1.f90: New test.
+ * gfortran.dg/any_all_2.f90: New test.
+
2008-01-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* g++.dg/eh/ia64-2.C: Place "dg-do run" statement before
--- /dev/null
+! { dg-do run }
+! PR 34817 - the wrong library function was called,
+! leading to garbage in the return value
+program main
+ real, dimension(2,2) :: a
+ logical(kind=4), dimension(2) :: b
+ integer, dimension(2) :: i
+ equivalence (b,i)
+ data a /1.0, 2.0, -0.1, -0.2 /
+
+ i = 16843009 ! Initialize i to put junk into b
+ b = any(a>0.5,dim=1)
+ if (b(2) .or. .not. b(1)) call abort
+
+ i = 16843009 ! Initialize i to put junk into b
+ b = all(a>0.5,dim=1)
+ if (b(2) .or. .not. b(1)) call abort
+end program main
--- /dev/null
+! { dg-do compile }
+! PR 34838 - this failed with "Can't convert LOGICAL(1) to LOGICAL(1)
+! Test case contributed by Manfred Schwab.
+program main
+ Logical(kind=1) :: bmp(1),bmpv(1)
+
+ bmp(1)=.false.
+ bmpv(1)=.true.
+
+ if ( ANY(bmp(1:1) .NEQV. bmpv(1:1)) ) then
+ print*,"hello"
+ end if
+
+ if ( ALL(bmp(1:1) .NEQV. bmpv(1:1)) ) then
+ print*,"hello"
+ end if
+
+end program main