tree.c (iterative_hash_expr): Canonicalize builtins.
authorDale Johannesen <dalej@apple.com>
Thu, 23 Dec 2004 16:21:31 +0000 (16:21 +0000)
committerDale Johannesen <dalej@gcc.gnu.org>
Thu, 23 Dec 2004 16:21:31 +0000 (16:21 +0000)
2004-12-23  Dale Johannesen  <dalej@apple.com>

        * tree.c (iterative_hash_expr):  Canonicalize builtins.

From-SVN: r92553

gcc/ChangeLog
gcc/tree.c

index 10de8a5f31e97580dae19901820a79260edf6d09..a5f9c5d49d77b0417d2a6c3c415259703aa7b918 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-23  Dale Johannesen  <dalej@apple.com>
+
+       * tree.c (iterative_hash_expr):  Canonicalize builtins.
+
 2004-12-23  Alexandre Oliva  <aoliva@redhat.com>
 
        PR target/16819
index 572b8804d56da374e8fb3ee407b585f8604d27f6..d81abb2df9d1f16a8b501406c7fc6aa4bb08ca30 100644 (file)
@@ -4130,12 +4130,24 @@ iterative_hash_expr (tree t, hashval_t val)
       for (; t; t = TREE_CHAIN (t))
        val = iterative_hash_expr (TREE_VALUE (t), val);
       return val;
+    case FUNCTION_DECL:
+      /* When referring to a built-in FUNCTION_DECL, use the
+        __builtin__ form.  Otherwise nodes that compare equal
+        according to operand_equal_p might get different
+        hash codes.  */
+      if (DECL_BUILT_IN (t))
+       {
+         val = iterative_hash_pointer (built_in_decls[DECL_FUNCTION_CODE (t)], 
+                                     val);
+         return val;
+       }
+      /* else FALL THROUGH */
     default:
       class = TREE_CODE_CLASS (code);
 
       if (class == tcc_declaration)
        {
-         /* Decls we can just compare by pointer.  */
+         /* Otherwise, we can just compare decls by pointer.  */
          val = iterative_hash_pointer (t, val);
        }
       else