From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22269 invoked by alias); 25 Apr 2005 20:31:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22011 invoked by alias); 25 Apr 2005 20:31:15 -0000 Date: Mon, 25 Apr 2005 20:31:00 -0000 Message-ID: <20050425203115.22010.qmail@sourceware.org> From: "paulthomas2 at wanadoo dot fr" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041206185831.18857.paulthomas2@wanadoo.fr> References: <20041206185831.18857.paulthomas2@wanadoo.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/18857] MATMUL failing with ALLOCATED matrices, unless base indices given X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg03636.txt.bz2 List-Id: ------- Additional Comments From paulthomas2 at wanadoo dot fr 2005-04-25 20:31 ------- Subject: Re: MATMUL failing with ALLOCATED matrices, unless base indices given Tobi, Does this do it for you? - it works with those assertions eliminated. !{ dg-do run } ! Test MATMUL for various kinds of array. ! provided by Paul Thomas - pault@gcc.gnu.org Program test_matmul integer, parameter :: N = 5 integer, parameter :: T = 4 real(kind=T), dimension(:,:), allocatable, Target :: a, b, c real(kind=T), dimension(:,:), POINTER :: d, e real(kind=T), dimension(N,N) :: x, y, z allocate (a(2*N, N), b(N, N), c(2*N, N)) a = 1.0_T a(1:N,:) = 2.0_T b = 4.0_T x = 1.0_T y = 2.0_T z = 0.0_T z = matmul (x, y) if (sum (z) /= 250.0_T) call abort () c = 0.0_T c = matmul (a, b) if (sum (c) /= 1500.0_T) call abort () c = 0.0_T d => a(1 : N, 1:N) c = matmul (d, b) if (sum (c) /= 1000.0_T) call abort () c = 0.0_T d => a(N+1 : 2*N, 1:N) c = matmul (d, b) if (sum (c) /= 500.0_T) call abort () c = 0.0_T e => c(N+1 : 2*N, 1 : N) e = matmul (d, b) if (sum (c(1 : N, 1 : N)) /= 0.0_T) call abort () if (sum (c(N+1 : 2*N, 1 : N)) /= 500.0_T) call abort () call doitagain (a ,b ,c ,x ,y ,z ) deallocate (a, b, c) contains subroutine doitagain (a ,b ,c ,x ,y ,z ) real(kind=T), dimension(5:, 5:) :: a ,b ,c ,x ,y ,z z = 0.0_T z = matmul (x, y) if (sum (z) /= 250.0_T) call abort () c = 0.0_T c = matmul (a, b) if (sum (c) /= 1500.0_T) call abort () end subroutine doitagain end program test_matmul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18857