summaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-09 20:24:11 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-09 20:24:11 +0000
commitcb344b0bfe796d9c23e050d6dc79abca9352f9dc (patch)
tree1544c1eda2afa69906ff167880adf1228b76c93d /gcc/ipa-cp.c
parentcc6541e2eaedd1eb236547a61734247c74398942 (diff)
downloadgcc-cb344b0bfe796d9c23e050d6dc79abca9352f9dc.tar.gz
2010-04-09 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (ipcp_lats_are_equal): Return true also if the two lattices are addresses of CONST_DECLs with the same initial value. (ipcp_print_all_lattices): Print values of CONST_DECLs. * ipa-prop.c (ipa_print_node_jump_functions): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158176 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index ce5051fe242..527c0c42530 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -227,10 +227,14 @@ ipcp_lats_are_equal (struct ipcp_lattice *lat1, struct ipcp_lattice *lat2)
if (lat1->type != lat2->type)
return false;
- if (operand_equal_p (lat1->constant, lat2->constant, 0))
- return true;
-
- return false;
+ if (TREE_CODE (lat1->constant) == ADDR_EXPR
+ && TREE_CODE (lat2->constant) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (lat1->constant, 0)) == CONST_DECL
+ && TREE_CODE (TREE_OPERAND (lat2->constant, 0)) == CONST_DECL)
+ return operand_equal_p (DECL_INITIAL (TREE_OPERAND (lat1->constant, 0)),
+ DECL_INITIAL (TREE_OPERAND (lat2->constant, 0)), 0);
+ else
+ return operand_equal_p (lat1->constant, lat2->constant, 0);
}
/* Compute Meet arithmetics:
@@ -386,8 +390,16 @@ ipcp_print_all_lattices (FILE * f)
fprintf (f, " param [%d]: ", i);
if (lat->type == IPA_CONST_VALUE)
{
+ tree cst = lat->constant;
fprintf (f, "type is CONST ");
- print_generic_expr (f, lat->constant, 0);
+ print_generic_expr (f, cst, 0);
+ if (TREE_CODE (cst) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (cst, 0)) == CONST_DECL)
+ {
+ fprintf (f, " -> ");
+ print_generic_expr (f, DECL_INITIAL (TREE_OPERAND (cst, 0)),
+ 0);
+ }
fprintf (f, "\n");
}
else if (lat->type == IPA_TOP)