Enhance std::hash for pointers

2015-05-06 Thread François Dumont
Hi Following Marc Glisse comment #4 on:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65641 I would like to propose this enhancement to the hash functor for pointers. It simply gets rid of the irrelevant bits on pointers hash code based on memory alignment of the pointed type. The only draw

Re: Enhance std::hash for pointers

2015-05-08 Thread Richard Biener
On Wed, May 6, 2015 at 10:10 PM, François Dumont wrote: > Hi > > Following Marc Glisse comment #4 > on:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65641 I would like to > propose this enhancement to the hash functor for pointers. It simply gets > rid of the irrelevant bits on pointers hash co

Re: Enhance std::hash for pointers

2015-05-08 Thread François Dumont
On 08/05/2015 10:02, Richard Biener wrote: On Wed, May 6, 2015 at 10:10 PM, François Dumont wrote: Hi Following Marc Glisse comment #4 on:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65641 I would like to propose this enhancement to the hash functor for pointers. It simply gets rid of the

Re: Enhance std::hash for pointers

2015-05-08 Thread Christopher Jefferson
My concern with accepting this patch is that many of libstdc++'s hash functions are awful from a mixing point of view -- you would get exactly the same problem from users who have integers which are always a multiple of a power of 2 (which is in practice not uncommon). This would give exactly the s

Re: Enhance std::hash for pointers

2015-05-11 Thread François Dumont
My proposal should be consider out of any context. We don't know what std::hash is used for in user code, this is why I am proposing this patch even if for the moment it doesn't make any difference considering only our usage of it. Your remark would make more sens if we were talking ab