diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-04-28 19:11:50 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-04-28 19:11:50 +0000 |
commit | 8478130d94af3313c5c8a8c3e1d5a8033e949750 (patch) | |
tree | 1d892ec6e17c326d149f09c6e7cf245a89024974 /gcc/gimplify.c | |
parent | 331c7fcdd09ca68e53bd5e64cd4b1cdc04416aa2 (diff) | |
download | gcc-8478130d94af3313c5c8a8c3e1d5a8033e949750.zip gcc-8478130d94af3313c5c8a8c3e1d5a8033e949750.tar.gz gcc-8478130d94af3313c5c8a8c3e1d5a8033e949750.tar.bz2 |
Uniquization of constants at the Tree level
Uniquization of constants at the Tree level
* tree.h (DECL_IN_CONSTANT_POOL): New macro
(tree_decl_with_vis): Add in_constant_pool bit, move shadowed_for_var_p
bit to the end.
(tree_output_constant_def): Declare.
* gimplify.c (gimplify_init_constructor): When using block copy,
uniquize the constant constructor on the RHS.
* lto-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Deal
with DECL_IN_CONSTANT_POOL flag.
* lto-streamer-out.c (pack_ts_decl_with_vis_value_fields): Likewise.
* varasm.c (make_decl_rtl): Deal with variables belonging to the
global constant pool.
(assemble_variable): Deal with symbols belonging to the tree constant
pool.
(get_constant_section): Add ALIGN parameter and simplify.
(build_constant_desc): Build a VAR_DECL and attach it to the symbol.
(assemble_constant_contents): Use the expression of the VAR_DECL.
(output_constant_def_contents): Use the alignment of the VAR_DECL.
(tree_output_constant_def): New global function.
(mark_constant): Use the expression of the VAR_DECL.
(place_block_symbol): Use the alignment of the VAR_DECL and the size
of its expression.
(output_object_block): Likewise and assemble the expression.
ada/
* gcc-interface/trans.c (gnat_gimplify_expr) <ADDR_EXPR>: Uniquize
constant constructors before taking their address.
From-SVN: r158838
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 2f4e120..68148a6 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3758,25 +3758,11 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, && num_nonzero_elements > 1 && !can_move_by_pieces (size, align)) { - tree new_tree; - if (notify_temp_creation) return GS_ERROR; - new_tree = create_tmp_var_raw (type, "C"); - - gimple_add_tmp_var (new_tree); - TREE_STATIC (new_tree) = 1; - TREE_READONLY (new_tree) = 1; - DECL_INITIAL (new_tree) = ctor; - if (align > DECL_ALIGN (new_tree)) - { - DECL_ALIGN (new_tree) = align; - DECL_USER_ALIGN (new_tree) = 1; - } - walk_tree (&DECL_INITIAL (new_tree), force_labels_r, NULL, NULL); - - TREE_OPERAND (*expr_p, 1) = new_tree; + walk_tree (&ctor, force_labels_r, NULL, NULL); + TREE_OPERAND (*expr_p, 1) = tree_output_constant_def (ctor); /* This is no longer an assignment of a CONSTRUCTOR, but we still may have processing to do on the LHS. So |