On Wed, 18 Jan 2012, Aldy Hernandez wrote: > On 01/18/12 03:09, Richard Guenther wrote: > > On Tue, 17 Jan 2012, Aldy Hernandez wrote: > > > > > > > > > > What I have in mind is to abstract out the initialization of TM > > > > > builtins > > > > > from > > > > > gtm-builtins.def (through its inclusion in builtins.def) into a > > > > > separate > > > > > function that we can call either in c_define_builtins() from the C-ish > > > > > front-ends, or from lto_define_builtins (once we encounter a TM > > > > > builtin > > > > > and > > > > > enable flag_tm appropriately). > > > > > > > > Hm? They are included in builtins.def, that looks appropriate for > > > > middle-end builtins. Thus they should be initialized by lto1, too. > > > > Are they not? > > > > > > Since flag_tm is NULL, when lto_define_builtins runs, the TM builtins do > > > not > > > get initialized. This is because DEF_TM_BUILTIN is predicated on flag_tm. > > > > Ok, so arrange that -fgnu-tm is enabled at link-time as soon as it was > > enabled in one TU. You can do that alongside handling of OPT_fPIC, etc. > > in lto-wrapper.c:merge_and_complain. > > The following patch fixes the problem. > > OK?
Ok. Thanks, Richard.