* stmt.c (expand_decl): Expand upper bound of a dynamic array.
authorJason Merrill <jason@casey.cygnus.com>
Wed, 15 Dec 1999 19:56:41 +0000 (19:56 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 15 Dec 1999 19:56:41 +0000 (14:56 -0500)
From-SVN: r30962

gcc/ChangeLog
gcc/stmt.c

index 28698f21047f18eeac5e329f623ca6031d5df46f..5e8cfedadd0eec76eb21b9bd1d5650912d9f631c 100644 (file)
@@ -1,3 +1,7 @@
+1999-12-15  Jason Merrill  <jason@casey.cygnus.com>
+
+       * stmt.c (expand_decl): Expand upper bound of a dynamic array.
+
 1999-12-15  Jakub Jelinek  <jakub@redhat.com>
 
        * expr.c (emit_group_load): Use dst mode if src is VOIDmode.
index 8256646bab2af3424502d2fa9208982444136911..e94c1e8a87adb807b007848ab027a331204c6783 100644 (file)
@@ -3817,6 +3817,12 @@ expand_decl (decl)
          stack_block_stack = thisblock;
        }
 
+      /* In function-at-a-time mode, variable_size doesn't expand this,
+        so do it now.  */
+      if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
+       expand_expr (TYPE_MAX_VALUE (TYPE_DOMAIN (type)),
+                    const0_rtx, VOIDmode, 0);
+
       /* Compute the variable's size, in bytes.  */
       size = expand_expr (size_binop (CEIL_DIV_EXPR,
                                      DECL_SIZE (decl),