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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137991
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2008-07-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36877
switch (expr->kind)
{
case CONSTANT:
- return get_or_alloc_constant_value_id (PRE_EXPR_CONSTANT (expr));
+ {
+ unsigned int id;
+ id = get_constant_value_id (PRE_EXPR_CONSTANT (expr));
+ if (id == 0)
+ {
+ id = get_or_alloc_constant_value_id (PRE_EXPR_CONSTANT (expr));
+ add_to_value (id, expr);
+ }
+ return id;
+ }
case NAME:
return VN_INFO (PRE_EXPR_NAME (expr))->value_id;
case NARY:
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. */
int vn_reference_eq (const void *, const void *);
unsigned int get_max_value_id (void);
unsigned int get_next_value_id (void);
+unsigned int get_constant_value_id (tree);
unsigned int get_or_alloc_constant_value_id (tree);
bool value_id_constant_p (unsigned int);
VEC (tree, gc) *shared_vuses_from_stmt (tree);