Commit 65355d53 by Richard Henderson Committed by Richard Henderson

c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call.

        * c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call.
        Use gimplify_and_add.
        * c-typeck.c (c_finish_if_stmt): Use NULL instead of empty stmt.
        * gimplify.c (build_and_jump, gimplify_exit_expr,
        gimplify_init_constructor, gimplify_save_expr, gimple_push_cleanup,
        gimplify_stmt, gimplify_expr): Likewise.
        (shortcut_cond_expr): Handle NULL arms of COND_EXPR.
        (gimplify_statement_list): Remove NULL entries.
        (gimplify_to_stmt_list): Handle NULL results.
        (gimplify_type_sizes): Add list_p argument.
        (gimplify_one_sizepos): Don't use internal pre/post queue.
        * tree-gimple.h (gimplify_type_sizes): Update.
ada/
        * trans.c (gnat_gimplify_stmt): Update gimplify_type_sizes call.

From-SVN: r83539
parent f241bf89
2004-06-23 Richard Henderson <rth@redhat.com>
* c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call.
Use gimplify_and_add.
* c-typeck.c (c_finish_if_stmt): Use NULL instead of empty stmt.
* gimplify.c (build_and_jump, gimplify_exit_expr,
gimplify_init_constructor, gimplify_save_expr, gimple_push_cleanup,
gimplify_stmt, gimplify_expr): Likewise.
(shortcut_cond_expr): Handle NULL arms of COND_EXPR.
(gimplify_statement_list): Remove NULL entries.
(gimplify_to_stmt_list): Handle NULL results.
(gimplify_type_sizes): Add list_p argument.
(gimplify_one_sizepos): Don't use internal pre/post queue.
* tree-gimple.h (gimplify_type_sizes): Update.
2004-06-22 Eric Christopher <echristo@redhat.com> 2004-06-22 Eric Christopher <echristo@redhat.com>
* config/rs6000/rs6000.md (*insvsi_internal5/6): New patterns. * config/rs6000/rs6000.md (*insvsi_internal5/6): New patterns.
......
2004-06-23 Richard Henderson <rth@redhat.com>
* trans.c (gnat_gimplify_stmt): Update gimplify_type_sizes call.
2004-06-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2004-06-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* decl.c (elaborate_expression, elaborate_expression_1): Arguments * decl.c (elaborate_expression, elaborate_expression_1): Arguments
......
...@@ -4280,11 +4280,11 @@ gnat_gimplify_stmt (tree *stmt_p) ...@@ -4280,11 +4280,11 @@ gnat_gimplify_stmt (tree *stmt_p)
{ {
tree var = DECL_STMT_VAR (stmt); tree var = DECL_STMT_VAR (stmt);
*stmt_p = NULL_TREE;
if (TREE_CODE (var) == TYPE_DECL) if (TREE_CODE (var) == TYPE_DECL)
*stmt_p = gimplify_type_sizes (TREE_TYPE (var)); gimplify_type_sizes (TREE_TYPE (var), stmt_p);
else if (TREE_CODE (var) == VAR_DECL) else if (TREE_CODE (var) == VAR_DECL)
{ {
*stmt_p = NULL_TREE;
gimplify_one_sizepos (&DECL_SIZE (var), stmt_p); gimplify_one_sizepos (&DECL_SIZE (var), stmt_p);
gimplify_one_sizepos (&DECL_SIZE_UNIT (var), stmt_p); gimplify_one_sizepos (&DECL_SIZE_UNIT (var), stmt_p);
...@@ -4302,12 +4302,7 @@ gnat_gimplify_stmt (tree *stmt_p) ...@@ -4302,12 +4302,7 @@ gnat_gimplify_stmt (tree *stmt_p)
NULL_TREE))), NULL_TREE))),
stmt_p); stmt_p);
} }
if (*stmt_p == NULL_TREE)
*stmt_p = alloc_stmt_list ();
} }
else
*stmt_p = alloc_stmt_list ();
return GS_ALL_DONE; return GS_ALL_DONE;
} }
......
...@@ -476,20 +476,18 @@ gimplify_decl_stmt (tree *stmt_p) ...@@ -476,20 +476,18 @@ gimplify_decl_stmt (tree *stmt_p)
tree stmt = *stmt_p; tree stmt = *stmt_p;
tree decl = DECL_STMT_DECL (stmt); tree decl = DECL_STMT_DECL (stmt);
*stmt_p = NULL_TREE;
if (TREE_TYPE (decl) == error_mark_node) if (TREE_TYPE (decl) == error_mark_node)
{ return GS_ERROR;
*stmt_p = NULL;
return GS_ERROR;
}
if (TREE_CODE (decl) == TYPE_DECL) if (TREE_CODE (decl) == TYPE_DECL)
*stmt_p = gimplify_type_sizes (TREE_TYPE (decl)); gimplify_type_sizes (TREE_TYPE (decl), stmt_p);
else if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl)) else if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
{ {
tree init = DECL_INITIAL (decl); tree init = DECL_INITIAL (decl);
*stmt_p = NULL_TREE;
gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p); gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p); gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
...@@ -508,8 +506,7 @@ gimplify_decl_stmt (tree *stmt_p) ...@@ -508,8 +506,7 @@ gimplify_decl_stmt (tree *stmt_p)
tree_cons (NULL_TREE, DECL_SIZE_UNIT (decl), tree_cons (NULL_TREE, DECL_SIZE_UNIT (decl),
NULL_TREE)))); NULL_TREE))));
gimplify_stmt (&alloc_stmt); gimplify_and_add (alloc_stmt, stmt_p);
append_to_statement_list(alloc_stmt, stmt_p);
DECL_DEFER_OUTPUT (decl) = 1; DECL_DEFER_OUTPUT (decl) = 1;
} }
...@@ -525,8 +522,7 @@ gimplify_decl_stmt (tree *stmt_p) ...@@ -525,8 +522,7 @@ gimplify_decl_stmt (tree *stmt_p)
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
init = build (MODIFY_EXPR, void_type_node, decl, init); init = build (MODIFY_EXPR, void_type_node, decl, init);
gimplify_stmt (&init); gimplify_and_add (init, stmt_p);
append_to_statement_list (init, stmt_p);
} }
else else
/* We must still examine initializers for static variables /* We must still examine initializers for static variables
...@@ -540,8 +536,6 @@ gimplify_decl_stmt (tree *stmt_p) ...@@ -540,8 +536,6 @@ gimplify_decl_stmt (tree *stmt_p)
if (DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == NULL_TREE) if (DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == NULL_TREE)
gimple_add_tmp_var (decl); gimple_add_tmp_var (decl);
} }
else
*stmt_p = alloc_stmt_list ();
return GS_ALL_DONE; return GS_ALL_DONE;
} }
......
...@@ -6570,9 +6570,6 @@ c_finish_if_stmt (int stmt_count) ...@@ -6570,9 +6570,6 @@ c_finish_if_stmt (int stmt_count)
{ {
if_elt *elt = &if_stack[--if_stack_pointer]; if_elt *elt = &if_stack[--if_stack_pointer];
if (COND_EXPR_ELSE (elt->if_stmt) == NULL)
COND_EXPR_ELSE (elt->if_stmt) = build_empty_stmt ();
if (elt->needs_warning) if (elt->needs_warning)
warning ("%Hsuggest explicit braces to avoid ambiguous `else'", warning ("%Hsuggest explicit braces to avoid ambiguous `else'",
EXPR_LOCUS (elt->if_stmt)); EXPR_LOCUS (elt->if_stmt));
......
...@@ -102,7 +102,7 @@ enum gimplify_status { ...@@ -102,7 +102,7 @@ enum gimplify_status {
extern enum gimplify_status gimplify_expr (tree *, tree *, tree *, extern enum gimplify_status gimplify_expr (tree *, tree *, tree *,
bool (*) (tree), fallback_t); bool (*) (tree), fallback_t);
extern tree gimplify_type_sizes (tree); extern void gimplify_type_sizes (tree, tree *);
extern void gimplify_one_sizepos (tree *, tree *); extern void gimplify_one_sizepos (tree *, tree *);
extern void gimplify_stmt (tree *); extern void gimplify_stmt (tree *);
extern void gimplify_to_stmt_list (tree *); extern void gimplify_to_stmt_list (tree *);
......
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