From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18997 invoked by alias); 9 Nov 2004 05:35:58 -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 18970 invoked by uid 48); 9 Nov 2004 05:35:52 -0000 Date: Tue, 09 Nov 2004 05:35:00 -0000 Message-ID: <20041109053552.18969.qmail@sourceware.org> From: "dmitrym at acres dot com dot au" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040803172636.16861.yosef@phys.utb.edu> References: <20040803172636.16861.yosef@phys.utb.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/16861] segfault with doubly used module X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg01011.txt.bz2 List-Id: ------- Additional Comments From dmitrym at acres dot com dot au 2004-11-09 05:35 ------- The bug 17764 was incorrectly linked to this (see comments in that entry). I simplified the 20k source file above to ~600 bytes. Compilation attempt (using gfortran as of Nov 09, 2004) still gives "Internal compiler error. Segmentation fault." Now, the simplified code is: --- snip --- module NullGrid_Vars implicit none ! INTEGER*4, parameter :: lsh = 10 INTEGER*4, save :: lsh end module NullGrid_Vars ! module NullInterp_InterpUtil implicit none contains subroutine NullInterp_Util_cinterp(J1) use NullGrid_Vars implicit none !input variables COMPLEX*16, dimension(lsh), intent(inout) :: J1 end subroutine NullInterp_Util_cinterp end module NullInterp_InterpUtil ! module NullInterp_Interp implicit none contains subroutine NullInterp_cinterp() use NullGrid_Vars use NullInterp_InterpUtil implicit none end subroutine NullInterp_cinterp end module NullInterp_Interp --- snip --- As you may see, the second module (NullInterp_InterpUtil) gives the dimension of its in/out array as the variable lsh from the first module (NullGrid_Vars). However, lsh is a variable (although SAVEd). I'm not a standard guru, but it seems to me that such behavior is wrong, as the array size cannot be known at compilation time. If lsh is made a parameter (uncomment the line, comment the save line), then the code compiles without a hitch. Summary: I believe this is a bug in Fortran source file submitted as a test case, and not a gfortran bug. The 17764 was a genuine gfortran bug, and it was corrected during the last couple days (I checked couple times a week, so cannot pinpoint the exact moment). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16861