From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13219 invoked by alias); 2 Nov 2012 02:57:53 -0000 Received: (qmail 13178 invoked by uid 48); 2 Nov 2012 02:57:37 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55174] internal compiler error: Segmentation fault with bad array reference Date: Fri, 02 Nov 2012 02:57: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-11/txt/msg00108.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55174 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #1 from kargl at gcc dot gnu.org 2012-11-02 02:57:36 UTC --- (In reply to comment #0) > This 4-line Fortran program has an error at line 3, where array(*) is of course > not permitted as an argument of a function. > > implicit none > integer:: array(2)=(/42,666/) > print *, size(array(*)) > end > > Other compilers (g95, ifort) correctly diagnose the error but gfortran 4.8.0 > gives an internal compiler error: Segmentation fault and asks me to tell you. > My compile-time output follows. > > cayley[~/Jfh] % /local/scratch/gf/bin/gfortran -v trybadstar.f90 > Driving: /local/scratch/gf/bin/gfortran -v trybadstar.f90 -l gfortran -l m > -shared-libgcc > Using built-in specs. > COLLECT_GCC=/local/scratch/gf/bin/gfortran > COLLECT_LTO_WRAPPER=/local/scratch/gf/libexec/gcc/i686-pc-linux-gnu/4.8.0/lto-wrapper > Target: i686-pc-linux-gnu > Configured with: /local/scratch/gcc-4.8-20120701/configure > --prefix=/local/scratch/gf --enable-languages=c,fortran --disable-libada > --with-local-prefix=/local/scratch --with-gmp=/local/scratch > Thread model: posix > gcc version 4.8.0 20120701 (experimental) (GCC) John, It looks like it has been fixed on trunk (aka 4.8.0). For me, gfc4x is 4.8.0 20121002. gfortran 4.5.x seems to also work, so it appears that a regression crept in in the 4.6. development. troutmask:sgk[209] gfc4x -o z k.f90 k.f90:2.20: print *, size(array(*)) 1 Error: Expected array subscript at (1) troutmask:sgk[210] gfc47 -o z k.f90 f951: internal compiler error: Segmentation fault: 11 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. troutmask:sgk[211] gfc46 -o z k.f90 f951: internal compiler error: Segmentation fault: 11 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. troutmask:sgk[212] gfc45 -o z k.f90 k.f90:2.20: print *, size(array(*)) 1 Error: Expected array subscript at (1) A quick scan of gcc/fortran/ChangeLog did not reveal an obvious candidate for the revision that fixed the problem. We should probably add your test to the testsuite to make sure it does not get broken, again.