From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2651 invoked by alias); 2 Apr 2006 18:41:32 -0000 Received: (qmail 2632 invoked by uid 48); 2 Apr 2006 18:41:31 -0000 Date: Sun, 02 Apr 2006 18:41:00 -0000 Message-ID: <20060402184131.2631.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/26985] incorrect matmul result In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tkoenig at gcc dot gnu dot org" 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 X-SW-Source: 2006-04/txt/msg00111.txt.bz2 List-Id: ------- Comment #2 from tkoenig at gcc dot gnu dot org 2006-04-02 18:41 ------- The test case also exposes a problem with the way that the result is stored. Look at this: $ cat matmul.f90 program main implicit none real(8) :: a(2,9), b(9,7), c(2,7) integer :: i, j a = 1.d0 b = 2.d0 c = 1789789.d0 c(:,1:7:2) = matmul(a,b(:,1:7:2)) do i = 1, 7 print *, c(:,i) end do end program main $ gfortran matmul.f90 && ./a.out 18.0000000000000 18.0000000000000 0.00000000000000 0.00000000000000 18.0000000000000 18.0000000000000 0.00000000000000 0.00000000000000 1789807.00000000 1789807.00000000 1789789.00000000 1789789.00000000 1789807.00000000 1789807.00000000 $ ifort matmul.f90 && ./a.out 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 1789789.00000000 1789789.00000000 18.0000000000000 18.0000000000000 -- tkoenig at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26985