]> gcc.gnu.org Git - gcc.git/commitdiff
ipa-cp.c (ipcp_lats_are_equal): Return true also if the two lattices are addresses...
authorMartin Jambor <mjambor@suse.cz>
Fri, 9 Apr 2010 20:24:11 +0000 (22:24 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 9 Apr 2010 20:24:11 +0000 (22:24 +0200)
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.

From-SVN: r158176

gcc/ChangeLog
gcc/ipa-cp.c
gcc/ipa-prop.c

index dd63a97edd2ee0e9e84c8f291dcb89bbd41c6898..1c57d045fb1108a72a374d8ca89833eb58357cae 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2010-04-09  Eric Botcazou  <ebotcazou@adacore.com>
             Bernd Schmidt  <bernd.schmidt@codesourcery.com>
 
index ce5051fe24215ca447168a777fd8718ee7e6e4c1..527c0c42530bc542e2346e9b64dbac3acfccb90d 100644 (file)
@@ -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)
index 82a78a3b60e95a708a09d462db53e2c7f22ea175..c6d58b1d4526592429aea6974ea386ec1876ace5 100644 (file)
@@ -291,6 +291,13 @@ ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node)
              tree val = jump_func->value.constant;
              fprintf (f, "CONST: ");
              print_generic_expr (f, val, 0);
+             if (TREE_CODE (val) == ADDR_EXPR
+                 && TREE_CODE (TREE_OPERAND (val, 0)) == CONST_DECL)
+               {
+                 fprintf (f, " -> ");
+                 print_generic_expr (f, DECL_INITIAL (TREE_OPERAND (val, 0)),
+                                                      0);
+               }
              fprintf (f, "\n");
            }
          else if (type == IPA_JF_CONST_MEMBER_PTR)
This page took 0.077203 seconds and 5 git commands to generate.