This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] pr 63325 - make fold ignore decl_with_vis.symtab_node


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.

diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b1cbfac..88aa20e 100644
--- 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;
       expr = (tree) &buf;
     }
   else if (TREE_CODE_CLASS (code) == tcc_type
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]