From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29526 invoked by alias); 24 Jul 2010 05:38:57 -0000 Received: (qmail 29476 invoked by uid 48); 24 Jul 2010 05:38:43 -0000 Date: Sat, 24 Jul 2010 05:38:00 -0000 Message-ID: <20100724053843.29475.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/44945] [4.6 Regression] Wrong decl for module vars / FAIL: gfortran.dg/char_array_structure_constructor.f90 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dominiq at lps dot ens dot fr" 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: 2010-07/txt/msg02594.txt.bz2 ------- Comment #21 from dominiq at lps dot ens dot fr 2010-07-24 05:38 ------- In my opinion revision 162487 is only a partial fix of the problem. If I split a modified test case in two files: [macbook] f90/bug% cat char_array_structure_constructor_db_1.f90 MODULE global TYPE :: dt CHARACTER(4) a CHARACTER(4) b(2) END TYPE TYPE (dt), DIMENSION(:), ALLOCATABLE, SAVE :: c END MODULE global [macbook] f90/bug% cat char_array_structure_constructor_db_2.f90 program char_array_structure_constructor USE global call alloc (2) if (any (c%a /= "wxyz")) call abort () contains SUBROUTINE alloc (n) USE global ALLOCATE (c(n), STAT=IALLOC_FLAG) DO i = 1,n c (i) = dt ("wxyz",(/"abcd","efgh"/)) ENDDO end subroutine alloc END program char_array_structure_constructor and compile it with [macbook] f90/bug% gfc -fwhole-file -m32 -O3 -fomit-frame-pointer char_array_structure_constructor_db_1.f90 char_array_structure_constructor_db_2.f90 I still get [macbook] f90/bug% a.out Bus error Note that it is not surprising since -fwhole-file operates at the file level. However if the test is valid fortran, then it should not be miscompiled if split in two files. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44945