This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2008 22:36:14 -0000
- Subject: [Bug fortran/34817] [4.3 regression] mixed-kind "any" and "all" intrinsics with expressions
- References: <bug-34817-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from tkoenig at gcc dot gnu dot org 2008-01-16 22:36 -------
Here's a real test case:
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)) print *,b
i = 16843009 ! Initialize i to put junk into b
b = all(a>0.5,dim=1)
if (b(2) .or. .not. b(1)) print *,b
end program main
This patch works:
Index: iresolve.c
===================================================================
--- iresolve.c (revision 131577)
+++ iresolve.c (working copy)
@@ -256,8 +256,6 @@ gfc_resolve_all (gfc_expr *f, gfc_expr *
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);
@@ -306,8 +304,6 @@ gfc_resolve_any (gfc_expr *f, gfc_expr *
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);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34817