Hi all,

I think src/mem/ruby/common/Set.hh has a bug.

It has the following lines:
    static const int LONG_BITS = std::numeric_limits<long>::digits;
    static const int INDEX_SHIFT = LONG_BITS == 64 ? 6 : 5;

Since "long" by default is signed, LONG_BITS will always be 31 or 63, depending on the machine (not 32 or 64).
This means that INDEX_SHIFT will always be set to 5.

I tried setting --num-cpus to 128 and ran a tester, and observed a bunch of glibc errors.
A gdb backtrace pointed me to Set.hh (via ruby/common/NetDest.hh).
I changed "long" to "unsigned long" and that fixed the issue.

Is this a fine fix and should I send out a patch?

Thanks,
Tushar


_______________________________________________
gem5-dev mailing list
gem5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to