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]

Re: system include path warning


Zack Weinberg wrote:-

> When this stuff was originally implemented, there were two issues it was
> intended to solve:
> 
> 1: a correctness concern: since the reinclusion optimization used to look
> up headers by (path where found, file name) pairs, it would mistake one
> file for another if there were duplicate "paths where found".  I no longer
> remember the test case, but it was indeed possible to get it confused to
> the point where it would fail to include a file it should have.  IIRC
> Jakub Jelinek found the bug.
> 
> 2: a performance concern: in a context where you have both a very slow
> open(2) system call, and a long include path, the amount of time wasted
> looking up headers twice or more in the same directory can be substantial.
> An appropriate test case for that is compiling glibc with the source tree
> on an NFS partition, or (cross-)compiling glibc on a Solaris box (yes, I
> have done this...)
> 
> Both of these may now be addressed by the new file cache that looks up
> files by their actual pathname instead of (path, file) pairs.  I'd be
> curious to see some test results.

Or, under Unix at least, they might be solved by appropriate use of
inodes for the files, rather than paths like we do now.  Under
non-Unix, we'd need to stick to paths, but the issues tend to be less
since links don't exist.

Neil.


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