From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32815 invoked by alias); 1 May 2015 11:25:11 -0000 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 Received: (qmail 32747 invoked by uid 48); 1 May 2015 11:25:05 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/37131] inline matmul for small matrix sizes Date: Fri, 01 May 2015 11:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.4.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00020.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37131 --- Comment #24 from Dominique d'Humieres --- Reduced test module tst implicit none contains subroutine bar (a, b, n, m) integer, dimension(:), allocatable, intent(inout) :: a integer, dimension(:), pointer, intent(inout) :: b integer, intent(out) :: n, m n = lbound(a,1) m = lbound(b,1) end subroutine bar end module tst program main use tst implicit none integer, dimension(:), allocatable :: x ! integer, dimension(:), allocatable, target :: x integer, dimension(:), pointer :: y integer :: n,m allocate (x(0)) ! y => x call bar (x, y, n, m) ! print *, m, n if (n .ne. 1 .or. m .ne. 1) call abort end program main gives Program aborted. Backtrace: #0 0x1020a0472 #1 0x1020a1612 #2 0x102176428 #3 0x102098ecb Abort The program runs without abort if (1) I uncomment the line ! print *, m, n (2) I uncomment the lines ! integer, dimension(:), allocatable, target :: x and ! y => x and I comment the line integer, dimension(:), allocatable :: x I wonder if the above code is valid Fortran.