https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63577
Bug ID: 63577 Summary: [4.8/4.9/5? Regression]: Huge compile time and memory usage with -O and not -fPIC Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jfsoden at mpp dot mpg.de Created attachment 33749 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33749&action=edit Test program. The attached Fortran programs compiles slowly and needs lots of memory if compiled with basic optimization (-O) but without -fPIC. With -fPIC, memory usage and compile time are much shorter. $ gfortran abbrevd408h0.f90 -c -O needs 45s and 630MB RAM but $ gfortran abbrevd408h0.f90 -c -O -fPIC needs only 6s and 105MB RAM. $ gfortran abbrevd408h0.f90 -c works also quickly. The attached file is shortened. On the full file, the effect is more distinct (with gfortran 4.8.1: >8GB RAM usage, several minutes). With gfortran 4.7, the issue does not appear. Used version: GNU Fortran (Debian 4.9.1-17) 4.9.1 [~ SVN r216240] Also GNU Fortran (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388] GNU Fortran (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] are affected.