]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.h (get_pending_sizes): Remove prototype.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 5 May 2011 11:49:05 +0000 (11:49 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 5 May 2011 11:49:05 +0000 (11:49 +0000)
* 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

16 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/function.h
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/omp-low.c
gcc/stor-layout.c
gcc/tree-inline.c
gcc/tree-optimize.c
gcc/tree.h

index 838f6b04e740cb2bae973b68d7d821fc2670a5e4..88b6008244fb2d45a31a9091792c09833da66910 100644 (file)
@@ -1,3 +1,21 @@
+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"
index 5f234a2fb54f444525014a66deda35a73d333b73..315472e80810d01b20a73d749e6bed0a2b09b2b3 100644 (file)
@@ -1,3 +1,9 @@
+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
index 2e81c185bf2487a65e26fd05b24e4a1ada1f878a..57a62ab9bb6b530675130bffe604081824ba44f0 100644 (file)
@@ -1954,11 +1954,6 @@ begin_subprog_body (tree subprog_decl)
     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.  */
@@ -1973,10 +1968,6 @@ end_subprog_body (tree body)
   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;
 
index 6bc094892146b8149ef30bdd5ed47670eba5385f..cea26052a9e060421d3b36345c2f196c1feae1fb 100644 (file)
@@ -8173,12 +8173,6 @@ store_parm_decls (void)
      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
 
index 7586ea61b39bc3b8eefbbd23012d3d0075243b24..856e8c762b419a8397dc40e30357290babece6af 100644 (file)
@@ -1,3 +1,8 @@
+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
index e489caefd0b829a1e35cefa64e876cc52bf8bbdb..c5184e067731e976dd21008bbb82c78b63a5669c 100644 (file)
@@ -12494,12 +12494,6 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
   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 ();
 
index 382f1aae1565b73a8a6f6ed238922bd340327fdd..00774f4f7797cbf46beda6a6b2c47f54170eeaad 100644 (file)
@@ -1,3 +1,8 @@
+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.
index e597eb3179cf38cb772675ec0a9962e6fa91e67f..2452927628e34ea33e872c20107d932452315941 100644 (file)
@@ -2116,12 +2116,6 @@ trans_function_start (gfc_symbol * sym)
 
   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);
 }
index fa449585a4287ed3ee31d0f8262a3f2e9a2e443e..0e8bc74aaa59d6d8ec5df24cd6a1a3b41e638aae 100644 (file)
@@ -597,15 +597,6 @@ struct GTY(()) function {
   /* 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;
 
index 63fa5c0292bc6429c76eab9cc571fc88c26bc110..4070299f46cd4118c50429ac17733987f6d8c61d 100644 (file)
@@ -1251,7 +1251,6 @@ input_function (tree fn_decl, struct data_in *data_in,
   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);
index 61ca69a1a0a24d8797a9e02aa13548a22bc2aa2b..858bbf074621e00ebb59ea67d45eb059c91ac1ca 100644 (file)
@@ -1929,7 +1929,6 @@ output_function (struct cgraph_node *node)
   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);
index bc7bf4a15e1cdf4c87f3fc0ed4abf6c518d13e3b..fc2cff8548806797b28f3128e79c8185c299e55c 100644 (file)
@@ -6230,7 +6230,6 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
   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.  */
index 88c090b4681de22b7b2816d7fb9146be09aede6a..9ad0d0ae2f36e25932607034b947f399acf8f66f 100644 (file)
@@ -65,10 +65,6 @@ static int excess_unit_span (HOST_WIDE_INT, HOST_WIDE_INT, HOST_WIDE_INT,
 #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.  */
 
@@ -78,48 +74,12 @@ internal_reference_types (void)
   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;
@@ -135,26 +95,7 @@ variable_size (tree 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.  */
index 37776753ca3a1d8c02b84f5b8bfb27da2eef2bf9..49488d4158b799c150b12b800a414413492544c2 100644 (file)
@@ -2080,7 +2080,6 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count)
   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;
index e277277e7d5ec8e945b5bda88ffbedf7e34f3357..c46cf6c5458f569abae6c016f71eb880928aaf8f 100644 (file)
@@ -403,12 +403,6 @@ tree_rest_of_compilation (tree fndecl)
   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 (&reg_obstack); /* FIXME, only at RTL generation*/
index 5034b58545aaabfb06b1e9128fb3c65e27b0dc10..ef427606cde8a873dd08160f90c7329122ccc76c 100644 (file)
@@ -4638,9 +4638,6 @@ extern tree size_diffop_loc (location_t, tree, tree);
 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.  */