diff options
author | Dale Johannesen <dalej@apple.com> | 2004-12-23 16:21:31 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@gcc.gnu.org> | 2004-12-23 16:21:31 +0000 |
commit | d070d4fd52107c3d7814edc28bea7bdf4ea08eba (patch) | |
tree | 450452ff042e27165daa4c91e8633587b75a073f /gcc/tree.c | |
parent | 08167d1cdbfaf763a8bede8fd46c870356a921f5 (diff) | |
download | gcc-d070d4fd52107c3d7814edc28bea7bdf4ea08eba.tar.gz |
tree.c (iterative_hash_expr): Canonicalize builtins.
2004-12-23 Dale Johannesen <dalej@apple.com>
* tree.c (iterative_hash_expr): Canonicalize builtins.
From-SVN: r92553
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 572b8804d56..d81abb2df9d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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 |