diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-11-12 16:52:08 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-11-12 16:52:08 +0000 |
commit | d26f8097a31ff6a47d4b0861677ba44a8a25efec (patch) | |
tree | ca4319d8b6458e57f5d5a32ce72a5dfb816338ac /gcc/stor-layout.c | |
parent | 109cceda875779c29ee0ed68cf8ad0d4d5d44ce5 (diff) | |
download | gcc-d26f8097a31ff6a47d4b0861677ba44a8a25efec.zip gcc-d26f8097a31ff6a47d4b0861677ba44a8a25efec.tar.gz gcc-d26f8097a31ff6a47d4b0861677ba44a8a25efec.tar.bz2 |
tree.h (SAVE_EXPR_PERSISTENT_P): New macro.
* tree.h (SAVE_EXPR_PERSISTENT_P): New macro.
* tree.c (array_type_nelts): Don't handle SAVE_EXPRs specially.
(unsave_expr_now): Don't unsave SAVE_EXPR_PERSISTENT_P
expressions.
* stor-layout.c (variable_size): Set SAVE_EXPR_PERSISTENT_P on
variable-sized array bounds.
From-SVN: r30503
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 3663293..1433e8b 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -97,6 +97,17 @@ variable_size (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. */ + if (TREE_CODE (size) == SAVE_EXPR) + SAVE_EXPR_PERSISTENT_P (size) = 1; + if (global_bindings_p ()) { if (TREE_CONSTANT (size)) |