diff options
author | Richard Guenther <rguenther@suse.de> | 2008-07-19 20:02:29 +0000 |
---|---|---|
committer | Andreas Tobler <andreast@gcc.gnu.org> | 2008-07-19 22:02:29 +0200 |
commit | bb9e419935d5ef9fd90d27ed818b91fb6d49c68a (patch) | |
tree | 86848acd2172e064f4a209b5b054324423da0eea /gcc/tree-ssa-sccvn.c | |
parent | 52e07aa164ec9029ed9ddfb236917fe2efab0de0 (diff) | |
download | gcc-bb9e419935d5ef9fd90d27ed818b91fb6d49c68a.zip gcc-bb9e419935d5ef9fd90d27ed818b91fb6d49c68a.tar.gz gcc-bb9e419935d5ef9fd90d27ed818b91fb6d49c68a.tar.bz2 |
re PR bootstrap/36864 (Yet another bootstrap failure on i686-apple-darwin9)
2008-07-19 Richard Guenther <rguenther@suse.de>
PR bootstrap/36864
* tree-ssa-sccvn.h (get_constant_value_id): Declare.
* tree-ssa-sccvn.c (get_constant_value_id): New function.
* tree-ssa-pre.c (get_expr_value_id): For newly created
constant value-ids make sure to add the expression to its
expression-set.
From-SVN: r137991
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 69945a5..48b5297 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -248,6 +248,24 @@ vn_constant_hash (const void *p1) return vc1->hashcode; } +/* Lookup a value id for CONSTANT and return it. If it does not + exist returns 0. */ + +unsigned int +get_constant_value_id (tree constant) +{ + void **slot; + struct vn_constant_s vc; + + vc.hashcode = iterative_hash_expr (constant, 0); + vc.constant = constant; + slot = htab_find_slot_with_hash (constant_to_value_id, &vc, + vc.hashcode, NO_INSERT); + if (slot) + return ((vn_constant_t)*slot)->value_id; + return 0; +} + /* Lookup a value id for CONSTANT, and if it does not exist, create a new one and return it. If it does exist, return it. */ |