[PATCH] [compiler-rt] fix and simplify GetMaxVirtualAddress for ppc64*

Jay Foad jay.foad at gmail.com
Mon Nov 3 14:43:20 PST 2014


I can confirm that this works for me on big-endian PPC64 Fedora 19.

But the comments here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975#c27 suggest that with "ulimit -s unlimited", the stack might not be right up near the 1<<44 or 1<<46 byte limit, so maybe it would be a bit safer to do something like:

  if (GET_CURRENT_FRAME() < 1ULL << 44)
    return (1ULL << 44) - 1;
  else
    return (1ULL << 46) - 1;

In practice, on my machine, this doesn't seem to be a problem. Even with "ulimit -s unlimited" the stack is still very close to 1<<46.

http://reviews.llvm.org/D6044






More information about the llvm-commits mailing list