Had the following problem happen: Create a LTO build of a program with a gcc git checkout Update to a slightly newer checkout The new checkout had one option in fortran more added Continue compiling the program without make clean with the new compiler LTO link failed with this assert failing:
392 else if (o->type == CL_COMMON) 393 gcc_assert (option->flag_var); I think what happened is that the lto-opts code wrote the option indexes into the object files and with the compiler update and the new option they all shifted and become different. In my case the assert happened because it was trying to set a fortran specific option in a C build. There's some version checking in the lto-opts code memset (&header, 0, sizeof (header)); header.lto_header.major_version = LTO_major_version; header.lto_header.minor_version = LTO_minor_version; header.lto_header.section_type = LTO_section_opts; but LTO_major/minor seems to be always just 1/0, so of course didn't catch this. -- Summary: lto option code breaks file format with each added option Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: andi-gcc at firstfloor dot org GCC host triplet: x86_64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44965