decl.c (store_parm_decls): Reset immediate_size_expand.
authorMark Mitchell <mark@codesourcery.com>
Fri, 27 Aug 1999 03:52:44 +0000 (03:52 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 27 Aug 1999 03:52:44 +0000 (03:52 +0000)
* decl.c (store_parm_decls): Reset immediate_size_expand.
(finish_function): Likewise.

From-SVN: r28914

gcc/cp/ChangeLog
gcc/cp/decl.c

index 3885353460f47057dc1937eb9a89a006048374e1..0d1bec3a9e3aabcd8048d48d4399947fd5507246 100644 (file)
@@ -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.
index 8d929aded99ea2abc1b8f5bdaabf1fac20baafaf..f25400a4af070258bab40a6c79cc22a373d6ce1a 100644 (file)
@@ -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);
     }