PCH support on Solaris

Eric Botcazou ebotcazou@libertysurf.fr
Sat Apr 5 08:17:00 GMT 2003

> I don't think this is a performance issue, but a correctness issue.

Don't forget that we're only talking about heuristics, so it's fine if it 
just works.

> However, if you do not use MAP_FIXED, the OS will treat the address
> parameter as merely a hint, which it is free to ignore completely
> -- and in fact this is what in my experience (at least some versions)
> of Solaris tend to do.

I've attached a little test program that exercices Paolo's solution:
- we first ask mmap for the preferred location by passing NULL,
- then we pass it this preferred location with a zero offset.

We do so for sizes up to 1GB.

Tested on Solaris/Sparc 2.5.1, 2.6, 2.7, 2.8, 2.9, all clear.

> So it is easily possible that this mmap will always succeed, but never
> return guess == mmi.preferred_base. Using MAP_FIXED subsequently with the
> address guess doesn't then buy you anything ...

Note that, in the patch I posted, I explicitly check that we have the 
equality guess ==  mmi.preferred_base. And, according to the little test 
program, this seems to be true:
- if mmi.preferred_base is the preferred address returned by mmap(NULL, ...)
- and the offset is zero.

> This is why I don't quite see what the benefit of this mmap is
> supposed to be.

We work around the dependency upon the offset, which seems to be a feature of 

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solaris_pch.c
Type: text/x-csrc
Size: 1830 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030405/8ee46f43/attachment.bin>

More information about the Gcc-patches mailing list