aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-06-11 13:59:56 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-06-11 13:59:56 -0400
commit76ffb3a0be0adcb96cfddc7cbd5bc1576386ee3d (patch)
treea999095aa85cb302d2638cc3776ee6d757984714
parentee3ac81d77130be7d1a9edd39507fe16d1a5514d (diff)
downloadgcc-76ffb3a0be0adcb96cfddc7cbd5bc1576386ee3d.zip
gcc-76ffb3a0be0adcb96cfddc7cbd5bc1576386ee3d.tar.gz
gcc-76ffb3a0be0adcb96cfddc7cbd5bc1576386ee3d.tar.bz2
(variable_size): Do nothing if SIZE is constant.
From-SVN: r9925
-rw-r--r--gcc/stor-layout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 745a0c7..782ac07 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);