https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113204
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- it's really odd, I don't see how it could fail. The only suspicious bit is int file_order1 = n1->lto_file_data ? n1->lto_file_data->order : -1; int file_order2 = n2->lto_file_data ? n2->lto_file_data->order : -1; /* Order files same way as they appeared in the command line to reduce seeking while copying sections. */ if (file_order1 != file_order2) return file_order1 - file_order2; the non-presence of n{1,2}->lto_file_data represented as -1 makes whether non-presence is first dependent on the value of the order of the other. Maybe explicitly spelling that out would be better. if (file_order1 != file_order2) { if (file_order1 == -1) return -1; if (file_order2 == -1) return 1; return file_order1 - file_order2; } or so.