Skip to content
Snippets Groups Projects
Commit c8b3e92f authored by Richard Guenther's avatar Richard Guenther Committed by Richard Biener
Browse files

tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_MALLOC.

2009-12-04  Richard Guenther  <rguenther@suse.de>

	* 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
parent 321e10dd
No related branches found
No related tags found
No related merge requests found
2009-12-04 Richard Guenther <rguenther@suse.de>
* 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 <doko@ubuntu.com> 2009-12-04 Matthias Klose <doko@ubuntu.com>
John David Anglin <dave.anglin@nrc-cnrc.gc.ca> John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
   
...@@ -963,6 +963,7 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref) ...@@ -963,6 +963,7 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
} }
/* The following builtins do not read from memory. */ /* The following builtins do not read from memory. */
case BUILT_IN_FREE: case BUILT_IN_FREE:
case BUILT_IN_MALLOC:
case BUILT_IN_MEMSET: case BUILT_IN_MEMSET:
case BUILT_IN_FREXP: case BUILT_IN_FREXP:
case BUILT_IN_FREXPF: case BUILT_IN_FREXPF:
...@@ -1187,6 +1188,10 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref) ...@@ -1187,6 +1188,10 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
size); size);
return refs_may_alias_p_1 (&dref, ref, false); 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 /* Freeing memory kills the pointed-to memory. More importantly
the call has to serve as a barrier for moving loads and stores the call has to serve as a barrier for moving loads and stores
across it. */ across it. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment