From: Richard Guenther Date: Fri, 4 Dec 2009 14:42:23 +0000 (+0000) Subject: tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_MALLOC. X-Git-Tag: releases/gcc-4.5.0~1795 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8b3e92f208415d758fcd6cf28ebe1b8202a36b9;p=thirdparty%2Fgcc.git tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_MALLOC. 2009-12-04 Richard Guenther * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_MALLOC. (call_may_clobber_ref_p_1): Likewise. From-SVN: r154979 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a59bd51ae13..6319ca920390 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-12-04 Richard Guenther + + * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle + BUILT_IN_MALLOC. + (call_may_clobber_ref_p_1): Likewise. + 2009-12-04 Matthias Klose John David Anglin diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index e7137087625f..cbb43b5bfea3 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -963,6 +963,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_MEMSET: case BUILT_IN_FREXP: case BUILT_IN_FREXPF: @@ -1187,6 +1188,10 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref) size); return refs_may_alias_p_1 (&dref, ref, false); } + /* Allocating memory does not have any side-effects apart from + being the definition point for the pointer. */ + case BUILT_IN_MALLOC: + return false; /* Freeing memory kills the pointed-to memory. More importantly the call has to serve as a barrier for moving loads and stores across it. */