summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 12:19:28 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 12:19:28 +0000
commitca793672b4340554dea5d28ba72d024633b6d6f9 (patch)
tree37469c49ec7265d49916385efd0f288cc4709c98
parent29d7200db1f331ccc81e86252185b4ce06412586 (diff)
downloadgcc-ca793672b4340554dea5d28ba72d024633b6d6f9.tar.gz
2011-04-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48590 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_ALLOCA, BUILT_IN_STACK_SAVE and BUILT_IN_STACK_RESTORE. (call_may_clobber_ref_p_1): Handle BUILT_IN_ALLOCA and BUILT_IN_STACK_SAVE. * tree-ssa-dce.c (propagate_necessity): Handle BUILT_IN_ALLOCA, BUILT_IN_STACK_SAVE and BUILT_IN_STACK_RESTORE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172427 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/tree-ssa-alias.c6
-rw-r--r--gcc/tree-ssa-dce.c5
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6ce7314151..40fdfea4c07 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-04-14 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/48590
+ * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle
+ BUILT_IN_ALLOCA, BUILT_IN_STACK_SAVE and BUILT_IN_STACK_RESTORE.
+ (call_may_clobber_ref_p_1): Handle BUILT_IN_ALLOCA and
+ BUILT_IN_STACK_SAVE.
+ * tree-ssa-dce.c (propagate_necessity): Handle
+ BUILT_IN_ALLOCA, BUILT_IN_STACK_SAVE and BUILT_IN_STACK_RESTORE.
+
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_class_declaration): Updated call to
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 4edacb56ba6..1e80f49c5a0 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1196,6 +1196,9 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
case BUILT_IN_FREE:
case BUILT_IN_MALLOC:
case BUILT_IN_CALLOC:
+ case BUILT_IN_ALLOCA:
+ case BUILT_IN_STACK_SAVE:
+ case BUILT_IN_STACK_RESTORE:
case BUILT_IN_MEMSET:
case BUILT_IN_FREXP:
case BUILT_IN_FREXPF:
@@ -1432,6 +1435,9 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
&& targetm.ref_may_alias_errno (ref))
return true;
return false;
+ case BUILT_IN_STACK_SAVE:
+ case BUILT_IN_ALLOCA:
+ 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. */
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index c46836da108..6dc8a57f5c8 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -824,7 +824,10 @@ propagate_necessity (struct edge_list *el)
&& DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL
&& (DECL_FUNCTION_CODE (callee) == BUILT_IN_MEMSET
|| DECL_FUNCTION_CODE (callee) == BUILT_IN_MALLOC
- || DECL_FUNCTION_CODE (callee) == BUILT_IN_FREE))
+ || DECL_FUNCTION_CODE (callee) == BUILT_IN_FREE
+ || DECL_FUNCTION_CODE (callee) == BUILT_IN_ALLOCA
+ || DECL_FUNCTION_CODE (callee) == BUILT_IN_STACK_SAVE
+ || DECL_FUNCTION_CODE (callee) == BUILT_IN_STACK_RESTORE))
continue;
/* Calls implicitly load from memory, their arguments