Commit 8c56bb83 by Richard Henderson Committed by Richard Henderson

c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside non-constant size check.

	* c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside
	non-constant size check.  Gimplify the type too.  Tidy building
	BUILT_IN_STACK_ALLOC call

From-SVN: r83582
parent d522060b
2004-06-23 Richard Henderson <rth@redhat.com>
* c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside
non-constant size check. Gimplify the type too. Tidy building
BUILT_IN_STACK_ALLOC call
2004-06-23 Roger Sayle <roger@eyesopen.com> 2004-06-23 Roger Sayle <roger@eyesopen.com>
* c-common.c (expand_unordered_cmp): Delete. * c-common.c (expand_unordered_cmp): Delete.
......
...@@ -488,25 +488,25 @@ gimplify_decl_stmt (tree *stmt_p) ...@@ -488,25 +488,25 @@ gimplify_decl_stmt (tree *stmt_p)
{ {
tree init = DECL_INITIAL (decl); tree init = DECL_INITIAL (decl);
gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
if (!TREE_CONSTANT (DECL_SIZE (decl))) if (!TREE_CONSTANT (DECL_SIZE (decl)))
{ {
/* This is a variable-sized decl. Simplify its size and mark it /* This is a variable-sized decl. Simplify its size and mark it
for deferred expansion. Note that mudflap depends on the format for deferred expansion. Note that mudflap depends on the format
of the emitted code: see mx_register_decls(). */ of the emitted code: see mx_register_decls(). */
tree pt_type = build_pointer_type (TREE_TYPE (decl)); tree t, args;
tree alloc_stmt
= (build_function_call_expr gimplify_type_sizes (TREE_TYPE (decl), stmt_p);
(implicit_built_in_decls[BUILT_IN_STACK_ALLOC], gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
tree_cons (NULL_TREE, gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
build1 (ADDR_EXPR, pt_type, decl),
tree_cons (NULL_TREE, DECL_SIZE_UNIT (decl), args = tree_cons (NULL, DECL_SIZE_UNIT (decl), NULL);
NULL_TREE)))); t = build_fold_addr_expr (decl);
args = tree_cons (NULL, t, args);
t = implicit_built_in_decls[BUILT_IN_STACK_ALLOC];
t = build_function_call_expr (t, args);
gimplify_and_add (alloc_stmt, stmt_p); gimplify_and_add (t, stmt_p);
DECL_DEFER_OUTPUT (decl) = 1; DECL_DEFER_OUTPUT (decl) = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment