http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56706
Bug #: 56706 Summary: failure building CP2K at -flto -O3 Classification: Unclassified Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: joost.vandevond...@mat.ethz.ch The 4.8.1 branch fails to build CP2K in LTO mode. At linking, the following error message appears: /data/vjoost/clean/cp2k/cp2k/makefiles/../src/dbcsr_lib/dbcsr_blas_operations.F:64: error: undefined reference to 'iseed.2556.979179.13933' /data/vjoost/clean/cp2k/cp2k/makefiles/../src/dbcsr_lib/dbcsr_blas_operations.F:62: error: undefined reference to 'iseed.2556.979179.13933' /data/vjoost/clean/cp2k/cp2k/makefiles/../src/dbcsr_lib/dbcsr_blas_operations.F:58: error: undefined reference to 'iseed.2556.979179.13933' /data/vjoost/clean/cp2k/cp2k/makefiles/../src/dbcsr_lib/dbcsr_blas_operations.F:60: error: undefined reference to 'iseed.2556.979179.13933' collect2: error: ld returned 1 exit status The error is absent if the optimization options used are -flto -O1 instead of -flto -O2. I have not been able to reduce this to a small testcase, so I'll post as simple as possible build instructions in a next comment