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/tree.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/tree.c')
-rw-r--r-- | gcc/tree.c | 28 |
1 files changed, 3 insertions, 25 deletions
@@ -2236,10 +2236,7 @@ int_size_in_bytes (type) } /* Return, as a tree node, the number of elements for TYPE (which is an - ARRAY_TYPE) minus one. This counts only elements of the top array. - - Don't let any SAVE_EXPRs escape; if we are called as part of a cleanup - action, they would get unsaved. */ + ARRAY_TYPE) minus one. This counts only elements of the top array. */ tree array_type_nelts (type) @@ -2256,26 +2253,6 @@ array_type_nelts (type) min = TYPE_MIN_VALUE (index_type); max = TYPE_MAX_VALUE (index_type); - if (! TREE_CONSTANT (min)) - { - STRIP_NOPS (min); - if (TREE_CODE (min) == SAVE_EXPR && SAVE_EXPR_RTL (min)) - min = build (RTL_EXPR, TREE_TYPE (TYPE_MIN_VALUE (index_type)), 0, - SAVE_EXPR_RTL (min)); - else - min = TYPE_MIN_VALUE (index_type); - } - - if (! TREE_CONSTANT (max)) - { - STRIP_NOPS (max); - if (TREE_CODE (max) == SAVE_EXPR && SAVE_EXPR_RTL (max)) - max = build (RTL_EXPR, TREE_TYPE (TYPE_MAX_VALUE (index_type)), 0, - SAVE_EXPR_RTL (max)); - else - max = TYPE_MAX_VALUE (index_type); - } - return (integer_zerop (min) ? max : fold (build (MINUS_EXPR, TREE_TYPE (max), max, min))); @@ -2465,7 +2442,8 @@ unsave_expr_now (expr) switch (code) { case SAVE_EXPR: - SAVE_EXPR_RTL (expr) = 0; + if (!SAVE_EXPR_PERSISTENT_P (expr)) + SAVE_EXPR_RTL (expr) = 0; break; case TARGET_EXPR: |