diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-10 18:07:31 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-10 18:07:31 +0000 |
commit | fe34354e72b674130ffcf5a67e2d0b3b7307383e (patch) | |
tree | ca6f19ee04949a3bcd2ab0374a056dcb46fc2056 /gcc/tree-ssa-alias.c | |
parent | 8b3716ff7532ddf9cb6f3ae6beac038506b70941 (diff) | |
parent | bf62ed7307453c4f8d35c952fba2c2a5d990b1a4 (diff) | |
download | gcc-fe34354e72b674130ffcf5a67e2d0b3b7307383e.tar.gz |
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@207666 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d52a8f42759..fa086b0a793 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1518,6 +1518,7 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref) /* The following builtins do not read from memory. */ case BUILT_IN_FREE: case BUILT_IN_MALLOC: + case BUILT_IN_POSIX_MEMALIGN: case BUILT_IN_CALLOC: case BUILT_IN_ALLOCA: case BUILT_IN_ALLOCA_WITH_ALIGN: @@ -1841,6 +1842,18 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref) case BUILT_IN_ALLOCA_WITH_ALIGN: case BUILT_IN_ASSUME_ALIGNED: return false; + /* But posix_memalign stores a pointer into the memory pointed to + by its first argument. */ + case BUILT_IN_POSIX_MEMALIGN: + { + tree ptrptr = gimple_call_arg (call, 0); + ao_ref dref; + ao_ref_init_from_ptr_and_size (&dref, ptrptr, + TYPE_SIZE_UNIT (ptr_type_node)); + return (refs_may_alias_p_1 (&dref, ref, false) + || (flag_errno_math + && targetm.ref_may_alias_errno (ref))); + } /* Freeing memory kills the pointed-to memory. More importantly the call has to serve as a barrier for moving loads and stores across it. */ |