[PATCH] pr 63325 - make fold ignore decl_with_vis.symtab_node
Jakub Jelinek
jakub@redhat.com
Thu Jan 22 11:56:00 GMT 2015
On Thu, Jan 22, 2015 at 06:02:06AM -0500, tbsaunde+gcc@tbsaunde.org wrote:
> From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
>
> Hi,
>
> fold calls symtab_node::get_create () which can change this field from NULL to
> point to a new object. It doesn't seem to really matter when the object gets
> created and I don't think it changes any properties of the tree object. So I
> think it makes sense to do here what we do for similar members and leave it out
> of the checksum.
>
> bootstrapped + regtested x86_64-linux-gnu, ok?
>
> Trev
>
> gcc/
>
> * fold-const.c (fold_checksum_tree): Don't include
> expr.decl_with_vis.symtab_node in the checksum.
Ok, thanks.
> --- a/gcc/fold-const.c
> +++ b/gcc/fold-const.c
> @@ -14065,11 +14065,12 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx,
> *slot = expr;
> code = TREE_CODE (expr);
> if (TREE_CODE_CLASS (code) == tcc_declaration
> - && DECL_ASSEMBLER_NAME_SET_P (expr))
> + && HAS_DECL_ASSEMBLER_NAME_P (expr))
> {
> - /* Allow DECL_ASSEMBLER_NAME to be modified. */
> + /* Allow DECL_ASSEMBLER_NAME and symtab_node to be modified. */
> memcpy ((char *) &buf, expr, tree_size (expr));
> SET_DECL_ASSEMBLER_NAME ((tree)&buf, NULL);
> + buf.decl_with_vis.symtab_node = NULL;
Wonder why we don't have an accessor macro for this in tree.h.
decl_with_vis is implementation detail.
Jakub
More information about the Gcc-patches
mailing list