The patch for PR 34671 created an optimization opportunity that is currently missed.
The "any" and "all" functions with dim=1 now accept an argument that can be any logical type. Only the lowest-order byte is used for evaluation. Now consider the following: program main logical(kind=1), dimension(2,2) :: a logical, dimension(2) :: b data a / .false., .true., .false., .false. / b = any(a,dim=1) end program main This gets translated to _gfortran_any_l1 (&atmp.2, &parm.1, &C.511); { integer(kind=4) S.4; S.4 = 0; while (1) { if (S.4 > 1) goto L.1; b[S.4] = (logical(kind=4)) (*(logical(kind=1)[2] *) atmp.2.data)[S.4]; S.4 = S.4 + 1; } L.1:; } } where a simple call to _gfortran_any_l4 would have been enough. -- Summary: logical kinds for any and all Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34816