This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add a prepare_pch_save target hook


On Dec 4, 2011, at 4:02 AM, Richard Sandiford <rdsandiford@googlemail.com> wrote:
> A while back I added the target_globals structure, to allow a backend
> to switch between two very different ISA modes without paying the full
> target_reinit penalty each time.  This made a huge difference to compile
> time, but had a drawback: the target_globals structure contained both
> GGC and non-GGC data.  This meant that secondary target_globals structures
> like mips16_globals couldn't be saved correctly in PCH files.

> +  /* We are called in a context where the current MIPS16 vs. non-MIPS16
> +     setting should be irrelevant.  The question then is: which setting
> +     makes most sense at load time?
> +
> +     The PCH is loaded before the first token is read.  We should never
> +     have switched into MIPS16 mode by that point,

If there is any way to say:

  #pragma mips16

to globally switch state into mips16 mode, then I believe the patch is wrong.  The pch file can have that directive in it to put the compiler into that mode, with all the resulting state that mode entails.  Now, if you store that one bit into the pch file, say, via a GTY int flag, then on reload, you can examine that flag, and enter that state.  Bear in mind, this 'slows' pch load time.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]