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: PR/15448: add a compiler timestamp to PCH files


Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:

> > While, this would be good, it isn't the fix to the problem you
> > describe.  The way to add better validation would be to add __TIME__
> > to the compiler and validate it across PCH usage.  This way, if the
> > compiler is ever rebuilt, we get a new timestamp, which then will
> > kill all PCH files.
> 
> Unless I am misunderstanding you, we were speaking of the same solution.

I think it would be simpler and more efficient to pick a set of
relevant compiler global variables and functions and hash their
addresses together.  If those are well chosen, it will be very
unlikely to generate a PCH with same hash code that will not work.

Ian


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