ipa-prop.c (compute_complex_ancestor_jump_func): Work also if the zero is the first...
authorMartin Jambor <mjambor@suse.cz>
Thu, 9 Dec 2010 15:27:14 +0000 (16:27 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Thu, 9 Dec 2010 15:27:14 +0000 (16:27 +0100)
2010-12-09  Martin Jambor  <mjambor@suse.cz>

* ipa-prop.c (compute_complex_ancestor_jump_func): Work also if the
zero is the first phi parameter.

From-SVN: r167642

gcc/ChangeLog
gcc/ipa-prop.c

index 7c380d35f032e3900796e866b9b37d73fe94c5fb..839ffc6a16174fc6133ef802154b582c40d1e531 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-09  Martin Jambor  <mjambor@suse.cz>
+
+       * ipa-prop.c (compute_complex_ancestor_jump_func): Work also if the
+       zero is the first phi parameter.
+
 2010-12-09  Martin Jambor  <mjambor@suse.cz>
 
        * ipa-prop.h (struct ipa_parm_adjustment): New field alias_ptr_type.
index 0e5a4b19d18062036d4d59f5fa5c9ddae57edab1..af5b2617dbcb4b1885d55f0f1f9cf89a19a98d7b 100644 (file)
@@ -460,11 +460,15 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info,
   tree tmp, parm, expr;
   int index, i;
 
-  if (gimple_phi_num_args (phi) != 2
-      || !integer_zerop (PHI_ARG_DEF (phi, 1)))
+  if (gimple_phi_num_args (phi) != 2)
     return;
 
-  tmp = PHI_ARG_DEF (phi, 0);
+  if (integer_zerop (PHI_ARG_DEF (phi, 1)))
+    tmp = PHI_ARG_DEF (phi, 0);
+  else if (integer_zerop (PHI_ARG_DEF (phi, 0)))
+    tmp = PHI_ARG_DEF (phi, 1);
+  else
+    return;
   if (TREE_CODE (tmp) != SSA_NAME
       || SSA_NAME_IS_DEFAULT_DEF (tmp)
       || !POINTER_TYPE_P (TREE_TYPE (tmp))