[Bug ipa/103080] LTO alters the ordering of static constructors/destructors in pass_ipa_cdtor_merge.

hubicka at kam dot mff.cuni.cz gcc-bugzilla@gcc.gnu.org
Thu Nov 4 14:21:31 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103080

--- Comment #1 from hubicka at kam dot mff.cuni.cz ---
The cdtor merging code is predating LTO - it is also used for collect2
path on targets w/o cdtor sections.

I guess the DECL_UID compare is not very safe things to do since it
depends on the tree merging decisions.  We do not record declaration
order to LTO time, however we have order of definitions which would be
cgraph_node::get (f1)->order

Honza


More information about the Gcc-bugs mailing list