This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/84188] assume non-null malloc pointers are distinct
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Feb 2018 00:36:54 +0000
- Subject: [Bug tree-optimization/84188] assume non-null malloc pointers are distinct
- Auto-submitted: auto-generated
- References: <bug-84188-4@http.gcc.gnu.org/bugzilla/>
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
}