On Wed, Jan 18, 2023 at 4:07 PM Jan Hubicka <hubi...@ucw.cz> wrote: > > > No unwind tables are generated, as if -funwind-tables is ignored. If > > LTO is disabled, everything works as expected. > I think it is because dwaf2out_do_eh_frame is called out of function > context at the end of compilation. At that time cfun is NULL > and the flag is read from global settings that are wrong. > So we need to bookkeep if we saw function that needs EH tables and not.
I think we do that with the do_eh_frame variable which was introduced to fix a similar problem (PR81351). But then dwarf2out_do_eh_frame seems to be used both at a function and at the TU level and the latter now should check do_eh_frame? (and not be called early). That is, the caller in dwarf2out_do_frame wants to check that variable. I see the first invocation of the function with cfun == null from c_cpp_builtins but all others seem to have cfun set? Richard. > Honza > > > > -- > > Andreas Schwab, SUSE Labs, sch...@suse.de > > GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 > > "And now for something completely different."