This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/84188] assume non-null malloc pointers are distinct


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

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Another test case for the guarantee that "...and moreover no pointers to valid
objects occur in any storage addressed by P."

void* __attribute__ ((malloc, returns_nonnull))
f (unsigned);

void g3 (unsigned n)
{
  void *p = f (n);
  void **q = f (n);

  if (p == *q)            // must be false
    __builtin_abort ();   // can be eliminated but isn't
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]