From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22950 invoked by alias); 16 Mar 2013 19:46:18 -0000 Received: (qmail 22511 invoked by uid 48); 16 Mar 2013 19:45:50 -0000 From: "ncc1701zzz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56638] New: Linker uses a lot of memory in Fortran 77 Date: Sat, 16 Mar 2013 19:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ncc1701zzz at gmail dot com 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: Message-ID: 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: 2013-03/txt/msg01192.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56638 Bug #: 56638 Summary: Linker uses a lot of memory in Fortran 77 Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: ncc1701zzz@gmail.com Hi. I hope this is not a repeated bug. I haven't found a similar bug. I'm using gfortran 4.6.3 in a Raspberry Pi (ARM architecture). When compiling a Fortran 77 file, I've noticed that in the linking process, it uses as much RAM as declared in all the variables. The executable generated is small and the execution doesn't uses so much RAM if the full array is not addressed. I have a software that reserves a lot of RAM (because Fortran 77 doesn't support dynamically assigned memory) but it won't address the entire range. I cannot compile it in the Raspberry Pi, but it compiles fine in a x86 linux and in Cygwin. Example program: PROGRAM BUG IMPLICIT NONE INTEGER LARGE(100000000) LARGE(1)=1 END Compile the object, this works fine: gfortran -c program.f Generate the executable. This uses over 400 MB of RAM (100.000.000 elements of 4 bytes): gfortran -o program program.f If you increase the length of the array LARGE in the code, it will use more and more RAM. Full output of the compiler version: $ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.6.3 (Debian 4.6.3-14+rpi1) Is this considered a bug? Thanks! Best regards.