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] |
If true, another solution is to ensure that for any commutative operation that we're hashing, that we use a commutative hash. So instead of always
for each operand (op) { hash <<= n; hash ^= munge(op); }
do
if (commutative (operation)) { hash <<= n; hash ^= munge(operation); for each operand (op) { hash += munge(op); } } else { ... }
This works for the _hash function, but the _eq function still needs to somehow work out whether the two lists are really equivalent or just happen to have the same hash value.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |