aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-27 03:52:44 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-08-27 03:52:44 +0000
commit078a76c8a059f7a0ff4db84234279e1b0e3ef770 (patch)
tree8fc4367a5288669568674822c79d54faf4a1fa28
parentb122caababcbf0e800b3e252c5a6440560245b9f (diff)
downloadgcc-078a76c8a059f7a0ff4db84234279e1b0e3ef770.zip
gcc-078a76c8a059f7a0ff4db84234279e1b0e3ef770.tar.gz
gcc-078a76c8a059f7a0ff4db84234279e1b0e3ef770.tar.bz2
decl.c (store_parm_decls): Reset immediate_size_expand.
* decl.c (store_parm_decls): Reset immediate_size_expand. (finish_function): Likewise. From-SVN: r28914
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/decl.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3885353..0d1bec3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,6 @@
1999-08-26 Mark Mitchell <mark@codesourcery.com>
- * tree.c (store_parm_decls): Reset immediate_size_expand.
+ * decl.c (store_parm_decls): Reset immediate_size_expand.
(finish_function): Likewise.
* tree.c (cplus_unsave_expr_now): Don't return a value.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 8d929ad..f25400a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13232,6 +13232,12 @@ store_parm_decls ()
/* Initialize RTL machinery. */
init_function_start (fndecl, input_filename, lineno);
+ /* 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. */
+ immediate_size_expand = 0;
+ get_pending_sizes ();
/* Create a binding level for the parms. */
expand_start_bindings (0);
@@ -13819,6 +13825,12 @@ finish_function (lineno, flags, nested)
expand_label (no_return_label);
}
+ /* We hard-wired immediate_size_expand to zero in
+ start_function. Expand_function_end will decrement this
+ variable. So, we set the variable to one here, so that after
+ the decrement it will remain zero. */
+ immediate_size_expand = 0;
+
/* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 1);
}