From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10565 invoked by alias); 21 Apr 2010 13:08:37 -0000 Received: (qmail 7374 invoked by uid 48); 21 Apr 2010 13:08:15 -0000 Date: Wed, 21 Apr 2010 13:08:00 -0000 Message-ID: <20100421130815.7373.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43829] Scalarization of reductions In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg02181.txt.bz2 ------- Comment #2 from rguenth at gcc dot gnu dot org 2010-04-21 13:08 ------- Wade-through-the-code dump: gfc_trans_assignment_1 gets make_esss:esss(:) (+ make_esss:esss(:) _gfortran_sum_r8[[(((* make_esss:ix(: , __convert_i4_i8[[((make_esss:e_x(FULL)))]]) make_esss:iyz(: , __convert_i4_i8[[((make_esss:ii_ivec(FULL)))]]))) (_8) ((arg not-present)))]]) the first issue is that while we can properly scalarize subroutine test0(esss,Ix,Iyz) real(kind=kind(1.0d0)), intent(out) :: esss real(kind=kind(1.0d0)), dimension(:) :: Ix,Iyz esss = sum(Ix * Iyz, 0) end subroutine we can't handle subroutine test1(esss,Ix,Iyz) real(kind=kind(1.0d0)), dimension(:), intent(out) :: esss real(kind=kind(1.0d0)), dimension(:,:) :: Ix,Iyz esss = sum(Ix * Iyz, 0) end subroutine as gfc_conv_intrinsic_function does not handle expr->rank > 0 for inline expansion. The second issue is that for subroutine test0(esss,Ix,Iyz, e_x, ii_ivec) real(kind=kind(1.0d0)), dimension(:), intent(out) :: esss real(kind=kind(1.0d0)), dimension(:) :: Ix,Iyz integer(kind=kind(1)), dimension(:) :: e_x,ii_ivec esss = Ix(e_x) * Iyz(ii_ivec) end subroutine we create temporaries for e_x and ii_ivec. Even for subroutine test0(esss,Ix, e_x) real(kind=kind(1.0d0)), dimension(:), intent(out) :: esss real(kind=kind(1.0d0)), dimension(:) :: Ix integer(kind=kind(1)), dimension(:) :: e_x esss = Ix(e_x) end subroutine -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Scalarization of reductions |Scalarization of reductions |with Fortran array | |expressions | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43829