https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92522
--- Comment #2 from John <johnilacqua at hotmail dot com> --- (In reply to Richard Biener from comment #1) > Isn't this undefined since you require 'test' to be constructed before > 'sample' > but the order of global CTORs is undefined between translation units? > > IIRC there's a duplicate bugreport with further suggetions as to how to > try to mimic non-LTO behavior here (sort CTORs in "link order"). Sorry, you're right, I completely missed that. Apologies, can close this as not a bug. This is probably something that's difficult to identify and warn on, isn't it?