From 078a76c8a059f7a0ff4db84234279e1b0e3ef770 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 27 Aug 1999 03:52:44 +0000 Subject: [PATCH] decl.c (store_parm_decls): Reset immediate_size_expand. * decl.c (store_parm_decls): Reset immediate_size_expand. (finish_function): Likewise. From-SVN: r28914 --- gcc/cp/ChangeLog | 2 +- gcc/cp/decl.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3885353460f..0d1bec3a9e3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,6 +1,6 @@ 1999-08-26 Mark Mitchell - * 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 8d929aded99..f25400a4af0 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); } -- 2.30.2