summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-05 06:51:02 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-05 06:51:02 +0000
commitce467a73f2e7790c29b4d5e6ba8f02f67ff1fbc2 (patch)
tree44b13ffdf8f48f0846c6fa756dcb798b1402864b /gcc/function.c
parent96d511a81ba4e3cf52343e99f8097fafb0050d4a (diff)
downloadgcc-ce467a73f2e7790c29b4d5e6ba8f02f67ff1fbc2.tar.gz
* c-tree.h (lang_decl): Add pending_sizes fields.
* c-decl.c (store_parm_decls): Save pending_sizes away for nested functions. (c_expand_body): Expand them. (lang_mark_tree): Mark lang_decl:pending_sizes. * function.c (expand_pending_sizes): New function, broken out from ... (expand_function_start): ... here. * tree.h (expand_pending_sizes): Declare it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42892 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 161173e8d69..64df1bd42e6 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6270,6 +6270,29 @@ expand_main_function ()
extern struct obstack permanent_obstack;
+/* The PENDING_SIZES represent the sizes of variable-sized types.
+ Create RTL for the various sizes now (using temporary variables),
+ so that we can refer to the sizes from the RTL we are generating
+ for the current function. The PENDING_SIZES are a TREE_LIST. The
+ TREE_VALUE of each node is a SAVE_EXPR. */
+
+void
+expand_pending_sizes (pending_sizes)
+ tree pending_sizes;
+{
+ tree tem;
+
+ /* Evaluate now the sizes of any types declared among the arguments. */
+ for (tem = pending_sizes; tem; tem = TREE_CHAIN (tem))
+ {
+ expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode,
+ EXPAND_MEMORY_USE_BAD);
+ /* Flush the queue in case this parameter declaration has
+ side-effects. */
+ emit_queue ();
+ }
+}
+
/* Start the RTL for a new function, and set variables used for
emitting RTL.
SUBR is the FUNCTION_DECL node.
@@ -6487,14 +6510,7 @@ expand_function_start (subr, parms_have_cleanups)
tail_recursion_reentry = emit_note (NULL, NOTE_INSN_DELETED);
/* Evaluate now the sizes of any types declared among the arguments. */
- for (tem = nreverse (get_pending_sizes ()); tem; tem = TREE_CHAIN (tem))
- {
- expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode,
- EXPAND_MEMORY_USE_BAD);
- /* Flush the queue in case this parameter declaration has
- side-effects. */
- emit_queue ();
- }
+ expand_pending_sizes (nreverse (get_pending_sizes ()));
/* Make sure there is a line number after the function entry setup code. */
force_next_line_note ();