This is the mail archive of the
mailing list for the GCC project.
Re: ping: back end reinitialization hooks to support mixed mips16/nomips16 compilation in same file
Richard Sandiford <firstname.lastname@example.org> writes:
> From this point of view, I disagree that it's a clean-up as things stand.
> It seems to muddy the waters in some ways.
Unfortunately I have to agree with this. Sandra identified the
problem in her original post: we have too much global state, and too
many places which assume that data structures don't change during the
compilation. A function like backend_reinit which is called from the
backend looks like trouble to me.
Short of the ideal of encapsulating the global info in a structure, we
need a single function which initializes everything based on the
current target state. That function should be called at compiler
startup, and it may be called by the backend when appropriate. I
think that a _reinit function which is not called at startup is simply
going to rot over time.
I think this is more or less what Richard is suggesting as well.