OSDN Git Service

2010-12-09 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Dec 2010 15:27:14 +0000 (15:27 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Dec 2010 15:27:14 +0000 (15:27 +0000)
* ipa-prop.c (compute_complex_ancestor_jump_func): Work also if the
zero is the first phi parameter.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167642 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-prop.c

index 7c380d3..839ffc6 100644 (file)
@@ -1,5 +1,10 @@
 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.
        * ipa-prop.c (ipa_modify_call_arguments): Use it.
        * tree-sra.c (splice_param_accesses): Test that all accesses have the
index 0e5a4b1..af5b261 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))