[patch] Uniquization of constants at the Tree level

H.J. Lu hjl.tools@gmail.com
Thu Apr 29 13:53:00 GMT 2010


On Tue, Apr 27, 2010 at 3:15 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Just claim an unused bit from tree_decl_with_vis, like
>> in_constant_pool (similar to in_text_section).
>
> OK, I've put it right after in_text_section (and moved the C++ only flag to
> the end).  This works fine, including inter-unit uniquization, but we have
> apparently no way to test it automatically.
>
> Lightly tested on i586-suse-linux.  OK for mainline after full testing?
>
>
> 2010-04-27  Eric Botcazou  <ebotcazou@adacore.com>
>
>        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 global
>        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.
>
>
> 2010-04-27  Eric Botcazou  <ebotcazou@adacore.com>
>
>        * gcc.dg/const-uniq-1.c: New test.
>        * gcc.dg/lto/const-uniq_[01].c: Likewise.
>
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43937

-- 
H.J.



More information about the Gcc-patches mailing list