* tree.h (get_pending_sizes): Remove prototype.
(put_pending_size): Likewise.
(put_pending_sizes): Likewise.
* stor-layout.c (pending_sizes): Delete.
(get_pending_sizes): Likewise.
(put_pending_size): Likewise.
(put_pending_sizes): Likewise.
(variable_size): Do not call put_pending_size and tidy up.
* function.h (struct function): Remove dont_save_pending_sizes_p.
* lto-streamer-in.c (input_function): Do not stream it.
* lto-streamer-out.c (output_function): Likewise.
* tree-inline.c (initialize_cfun): Do not copy it.
* c-decl.c (store_parm_decls): Do not set it.
* omp-low.c (create_task_copyfn): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
cp/
* decl.c (start_preparsed_function): Likewise.
fortran/
* trans-decl.c (trans_function_start): Likewise.
ada/
* gcc-interface/utils.c (begin_subprog_body): Do not call
get_pending_sizes.
(end_subprog_body): Likewise.
From-SVN: r173424
+2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.h (get_pending_sizes): Remove prototype.
+ (put_pending_size): Likewise.
+ (put_pending_sizes): Likewise.
+ * stor-layout.c (pending_sizes): Delete.
+ (get_pending_sizes): Likewise.
+ (put_pending_size): Likewise.
+ (put_pending_sizes): Likewise.
+ (variable_size): Do not call put_pending_size and tidy up.
+ * function.h (struct function): Remove dont_save_pending_sizes_p.
+ * lto-streamer-in.c (input_function): Do not stream it.
+ * lto-streamer-out.c (output_function): Likewise.
+ * tree-inline.c (initialize_cfun): Do not copy it.
+ * c-decl.c (store_parm_decls): Do not set it.
+ * omp-low.c (create_task_copyfn): Likewise.
+ * tree-optimize.c (tree_rest_of_compilation): Likewise.
+
2011-05-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*movdf_internal_rex64): Simplify nested "if"
+2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (begin_subprog_body): Do not call
+ get_pending_sizes.
+ (end_subprog_body): Likewise.
+
2011-05-04 Richard Guenther <rguenther@suse.de>
* gcc-interface/trans.c (gnat_to_gnu): Remove zero notrunc argument to
DECL_CONTEXT (param_decl) = subprog_decl;
make_decl_rtl (subprog_decl);
-
- /* We handle pending sizes via the elaboration of types, so we don't need to
- save them. This causes them to be marked as part of the outer function
- and then discarded. */
- get_pending_sizes ();
}
/* Finish the definition of the current subprogram BODY and finalize it. */
DECL_INITIAL (fndecl) = current_binding_level->block;
gnat_poplevel ();
- /* We handle pending sizes via the elaboration of types, so we don't
- need to save them. */
- get_pending_sizes ();
-
/* Mark the RESULT_DECL as being in this subprogram. */
DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
other pending sizes would be handled by gimplify_parameters. */
if (arg_info->pending_sizes)
add_stmt (arg_info->pending_sizes);
-
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- cfun->dont_save_pending_sizes_p = 1;
}
\f
+2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (start_preparsed_function): Do not set
+ dont_save_pending_sizes_p.
+
2011-05-05 Joseph Myers <joseph@codesourcery.com>
* parser.c (cp_parser_objc_method_definition_list): Update call to
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
current_binding_level = bl;
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- cfun->dont_save_pending_sizes_p = 1;
-
/* Start the statement-tree, start the tree now. */
DECL_SAVED_TREE (decl1) = push_stmt_list ();
+2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * trans-decl.c (trans_function_start): Do not set
+ dont_save_pending_sizes_p.
+
2011-05-04 Nathan Froyd <froydnj@codesourcery.com>
* trans.h (gfc_chainon_list): Delete.
init_function_start (fndecl);
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- cfun->dont_save_pending_sizes_p = 1;
-
/* function.c requires a push at the start of the function. */
pushlevel (0);
}
/* Nonzero if current function uses stdarg.h or equivalent. */
unsigned int stdarg : 1;
- /* Nonzero if the back-end should not keep track of expressions that
- determine the size of variable-sized objects. Normally, such
- expressions are saved away, and then expanded when the next
- function is started. For example, if a parameter has a
- variable-sized type, then the size of the parameter is computed
- when the function body is entered. However, some front-ends do
- not desire this behavior. */
- unsigned int dont_save_pending_sizes_p : 1;
-
unsigned int after_inlining : 1;
unsigned int always_inline_functions_inlined : 1;
fn->can_throw_non_call_exceptions = bp_unpack_value (&bp, 1);
fn->always_inline_functions_inlined = bp_unpack_value (&bp, 1);
fn->after_inlining = bp_unpack_value (&bp, 1);
- fn->dont_save_pending_sizes_p = bp_unpack_value (&bp, 1);
fn->stdarg = bp_unpack_value (&bp, 1);
fn->has_nonlocal_label = bp_unpack_value (&bp, 1);
fn->calls_alloca = bp_unpack_value (&bp, 1);
bp_pack_value (&bp, fn->can_throw_non_call_exceptions, 1);
bp_pack_value (&bp, fn->always_inline_functions_inlined, 1);
bp_pack_value (&bp, fn->after_inlining, 1);
- bp_pack_value (&bp, fn->dont_save_pending_sizes_p, 1);
bp_pack_value (&bp, fn->stdarg, 1);
bp_pack_value (&bp, fn->has_nonlocal_label, 1);
bp_pack_value (&bp, fn->calls_alloca, 1);
child_fn = gimple_omp_task_copy_fn (task_stmt);
child_cfun = DECL_STRUCT_FUNCTION (child_fn);
gcc_assert (child_cfun->cfg == NULL);
- child_cfun->dont_save_pending_sizes_p = 1;
DECL_SAVED_TREE (child_fn) = alloc_stmt_list ();
/* Reset DECL_CONTEXT on function arguments. */
#endif
extern void debug_rli (record_layout_info);
\f
-/* SAVE_EXPRs for sizes of types and decls, waiting to be expanded. */
-
-static GTY(()) VEC(tree,gc) *pending_sizes;
-
/* Show that REFERENCE_TYPES are internal and should use address_mode.
Called only by front end. */
reference_types_internal = 1;
}
-/* Get a VEC of all the objects put on the pending sizes list. */
-
-VEC(tree,gc) *
-get_pending_sizes (void)
-{
- VEC(tree,gc) *chain = pending_sizes;
-
- pending_sizes = 0;
- return chain;
-}
-
-/* Add EXPR to the pending sizes list. */
-
-void
-put_pending_size (tree expr)
-{
- /* Strip any simple arithmetic from EXPR to see if it has an underlying
- SAVE_EXPR. */
- expr = skip_simple_arithmetic (expr);
-
- if (TREE_CODE (expr) == SAVE_EXPR)
- VEC_safe_push (tree, gc, pending_sizes, expr);
-}
-
-/* Put a chain of objects into the pending sizes list, which must be
- empty. */
-
-void
-put_pending_sizes (VEC(tree,gc) *chain)
-{
- gcc_assert (!pending_sizes);
- pending_sizes = chain;
-}
-
/* Given a size SIZE that may not be a constant, return a SAVE_EXPR
to serve as the actual size-expression for a type or decl. */
tree
variable_size (tree size)
{
- tree save;
-
/* Obviously. */
if (TREE_CONSTANT (size))
return size;
if (lang_hooks.decls.global_bindings_p () < 0)
return size;
- size = save_expr (size);
-
- /* If an array with a variable number of elements is declared, and
- the elements require destruction, we will emit a cleanup for the
- array. That cleanup is run both on normal exit from the block
- and in the exception-handler for the block. Normally, when code
- is used in both ordinary code and in an exception handler it is
- `unsaved', i.e., all SAVE_EXPRs are recalculated. However, we do
- not wish to do that here; the array-size is the same in both
- places. */
- save = skip_simple_arithmetic (size);
-
- if (cfun && cfun->dont_save_pending_sizes_p)
- /* The front-end doesn't want us to keep a list of the expressions
- that determine sizes for variable size objects. Trust it. */
- return size;
-
- put_pending_size (save);
-
- return size;
+ return save_expr (size);
}
/* An array of functions used for self-referential size computation. */
cfun->va_list_fpr_size = src_cfun->va_list_fpr_size;
cfun->has_nonlocal_label = src_cfun->has_nonlocal_label;
cfun->stdarg = src_cfun->stdarg;
- cfun->dont_save_pending_sizes_p = src_cfun->dont_save_pending_sizes_p;
cfun->after_inlining = src_cfun->after_inlining;
cfun->can_throw_non_call_exceptions
= src_cfun->can_throw_non_call_exceptions;
input_location = DECL_SOURCE_LOCATION (fndecl);
init_function_start (fndecl);
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- cfun->dont_save_pending_sizes_p = 1;
-
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (®_obstack); /* FIXME, only at RTL generation*/
extern tree round_up_loc (location_t, tree, int);
#define round_down(T,N) round_down_loc (UNKNOWN_LOCATION, T, N)
extern tree round_down_loc (location_t, tree, int);
-extern VEC(tree,gc) *get_pending_sizes (void);
-extern void put_pending_size (tree);
-extern void put_pending_sizes (VEC(tree,gc) *);
extern void finalize_size_functions (void);
/* Type for sizes of data-type. */