On Thu, Sep 16, 2021 at 3:12 PM Martin Liška <mli...@suse.cz> wrote: > > This patch comes up with asm_out_state and a new global variable casm. > > Tested on all cross compilers. > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed?
* output.h (struct asm_out_file): New struct that replaces a ^^^ asm_out_state? You replace a lot of asm_out_file - do we still need the macro then? (I'd have simplified the patch leaving that replacement out at first) You leave quite some global state out of the struct that is obviously related, in the diff I see object_block_htab for example. Basically everything initialized in init_varasm_once is a candidate (which then shows const_desc_htab and shared_constant_pool as well as pending_assemble_externals_set). For the goal of outputting early DWARF to another file the state CTOR could have a mode to not initialize those parts or we could have asm-out-state-with-sections as base of asm-out-state. In the end there will be a target part of the state so I think construction needs to be defered to the target which can derive from asm-out-state and initialize the part it needs. That's currently what targetm.asm_out.init_sections () does and we'd transform that to a targetm.asm_out.create () or so. That might already be necessary for the DWARF stuff. That said, dealing with the target stuff piecemail is OK, but maybe try to make sure that init_varasm_once is actually identical to what the CTOR does? Richard. > Thanks, > Martin