summaryrefslogtreecommitdiff
path: root/gcc/tree-mudflap.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-11 04:16:07 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-11 04:16:07 +0000
commitafcf285eb542beb5277cd17c3f0ef4d3b525bb10 (patch)
treee57fc8a325147e3d2f9c065e1b28d63cdcb6c70a /gcc/tree-mudflap.c
parent3112fa0515c4d2cf9741bad078a54f0fee4b6d8d (diff)
downloadgcc-afcf285eb542beb5277cd17c3f0ef4d3b525bb10.tar.gz
* builtins.def (BUILT_IN_STACK_ALLOC): Remove.
* builtins.c (expand_builtin) <BUILT_IN_STACK_ALLOC>: Remove. * dwarf2out.c (loc_descriptor): Handle PARALLEL here ... (add_location_or_const_value_attribute): ... not here. Use loc_descriptor_from_tree if possible. (loc_descriptor_from_tree_1): Rename from loc_descriptor_from_tree. Simplify address handling. Handle DECL_VALUE_EXPR. Handle register values specially. (loc_descriptor_from_tree): New. Update callers. * expr.c (expand_var): Ignore DECL_VALUE_EXPR variables. * gimplify.c (gimplify_decl_expr): Lower variable sized types to pointer plus dereference. Set DECL_VALUE_EXPR. Set save_stack. (gimplify_call_expr): Do not recognize BUILT_IN_STACK_ALLOC and BUILT_IN_STACK_RESTORE. (gimplify_expr): Lower DECL_VALUE_EXPR decls. * stmt.c (expand_stack_alloc): Remove. * tree-mudflap.c (mx_register_decls): Don't look for BUILT_IN_STACK_ALLOC. * tree-nested.c (convert_local_reference): Likewise. * tree.h (DECL_VALUE_EXPR): New. ada/ * utils.c (gnat_install_builtins): Remove __builtin_stack_alloc, add __builtin_alloca. fortran/ * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_stack_alloc, add __builtin_alloca. * trans-array.c (gfc_trans_auto_array_allocation): Use DECL_EXPR. * trans-decl.c (gfc_trans_auto_character_variable): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-mudflap.c')
-rw-r--r--gcc/tree-mudflap.c70
1 files changed, 3 insertions, 67 deletions
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index bd176200530..4f8e1742f2d 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -897,6 +897,8 @@ mx_register_decls (tree decl, tree *stmt_list)
&& TREE_ADDRESSABLE (decl)
/* The type of the variable must be complete. */
&& COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (decl))
+ /* The decl hasn't been decomposed somehow. */
+ && DECL_VALUE_EXPR (decl) == NULL
/* Don't process the same decl twice. */
&& ! mf_marked_p (decl))
{
@@ -904,73 +906,7 @@ mx_register_decls (tree decl, tree *stmt_list)
tree unregister_fncall, unregister_fncall_params;
tree register_fncall, register_fncall_params;
- if (DECL_DEFER_OUTPUT (decl))
- {
- /* Oh no ... it's probably a variable-length array (VLA).
- The size and address cannot be computed by merely
- looking at the DECL. See gimplify_decl_stmt for the
- method by which VLA declarations turn into calls to
- BUILT_IN_STACK_ALLOC. We assume that multiple
- VLAs declared later in the same block get allocation
- code later than the others. */
- tree stack_alloc_call = NULL_TREE;
-
- while(! tsi_end_p (initially_stmts))
- {
- tree t = tsi_stmt (initially_stmts);
-
- tree call = NULL_TREE;
- if (TREE_CODE (t) == CALL_EXPR)
- call = t;
- else if (TREE_CODE (t) == MODIFY_EXPR &&
- TREE_CODE (TREE_OPERAND (t, 1)) == CALL_EXPR)
- call = TREE_OPERAND (t, 1);
- else if (TREE_CODE (t) == TRY_FINALLY_EXPR)
- {
- /* We hope that this is the try/finally block sometimes
- constructed by gimplify_bind_expr() for a BIND_EXPR
- that contains VLAs. This very naive recursion
- appears to be sufficient. */
- initially_stmts = tsi_start (TREE_OPERAND (t, 0));
- }
-
- if (call != NULL_TREE)
- {
- if (TREE_CODE (TREE_OPERAND(call, 0)) == ADDR_EXPR &&
- TREE_OPERAND (TREE_OPERAND (call, 0), 0) ==
- implicit_built_in_decls [BUILT_IN_STACK_ALLOC])
- {
- tree stack_alloc_args = TREE_OPERAND (call, 1);
- tree stack_alloc_op1 = TREE_VALUE (stack_alloc_args);
- tree stack_alloc_op2 = TREE_VALUE (TREE_CHAIN (stack_alloc_args));
-
- if (TREE_CODE (stack_alloc_op1) == ADDR_EXPR &&
- TREE_OPERAND (stack_alloc_op1, 0) == decl)
- {
- /* Got it! */
- size = stack_alloc_op2;
- stack_alloc_call = call;
- /* Advance iterator to point past this allocation call. */
- tsi_next (&initially_stmts);
- break;
- }
- }
- }
-
- tsi_next (&initially_stmts);
- }
-
- if (stack_alloc_call == NULL_TREE)
- {
- warning ("mudflap cannot handle variable-sized declaration `%s'",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- break;
- }
- }
- else
- {
- size = convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (decl)));
- }
+ size = convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (decl)));
/* (& VARIABLE, sizeof (VARIABLE), __MF_TYPE_STACK) */
unregister_fncall_params =