diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-06-11 17:59:56 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-06-11 17:59:56 +0000 |
commit | 09138ab19994400effe91909dfa73c3b509230ea (patch) | |
tree | a999095aa85cb302d2638cc3776ee6d757984714 /gcc/stor-layout.c | |
parent | 99f986f67f1bf1b37ec6e901951e6a95fc1033cc (diff) | |
download | gcc-09138ab19994400effe91909dfa73c3b509230ea.tar.gz |
(variable_size): Do nothing if SIZE is constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 745a0c7b999..782ac07a7b9 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -80,7 +80,7 @@ get_pending_sizes () return chain; } -/* Given a size SIZE that isn't constant, return a SAVE_EXPR +/* Given a size SIZE that may not be a constant, return a SAVE_EXPR to serve as the actual size-expression for a type or decl. */ tree @@ -90,7 +90,8 @@ variable_size (size) /* If the language-processor is to take responsibility for variable-sized items (e.g., languages which have elaboration procedures like Ada), just return SIZE unchanged. Likewise for self-referential sizes. */ - if (global_bindings_p () < 0 || contains_placeholder_p (size)) + if (TREE_CONSTANT (size) + || global_bindings_p () < 0 || contains_placeholder_p (size)) return size; size = save_expr (size); |