https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703

--- Comment #3 from Krister Walfridsson <kristerw at gcc dot gnu.org> ---
Oops. I messed up the test case...  It "works", but the actual values does not
make sense...

The following is better:

int main()
{
  long pgsz = sysconf (_SC_PAGESIZE);
  void *p = mmap (NULL, pgsz * 2, PROT_READ|PROT_WRITE,
     MAP_ANONYMOUS|MAP_PRIVATE, 0, 0);
  if (p == MAP_FAILED)
    return 0;
  mprotect (p+pgsz, pgsz, PROT_NONE);
  uintptr_t n = -2 - (uintptr_t)(p+pgsz);
  f1 (p+pgsz, -2, n);
  return 0;
}

Reply via email to