[PR 71234] Avoid valgrind warning in ipa-cp
authorMartin Jambor <mjambor@suse.cz>
Mon, 23 May 2016 16:31:14 +0000 (18:31 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Mon, 23 May 2016 16:31:14 +0000 (18:31 +0200)
2016-05-23  Martin Jambor  <mjambor@suse.cz>

PR ipa/71234
* ipa-cp.c (ipa_get_indirect_edge_target_1): Only check value of
from_global_constant if t is not NULL.

From-SVN: r236598

gcc/ChangeLog
gcc/ipa-cp.c

index d838407bc0b4e3864360493e22b167541ed387ae..f7a012c32bd5e2748c98a9ed9077969f8b6077f8 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-23  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/71234
+       * ipa-cp.c (ipa_get_indirect_edge_target_1): Only check value of
+       from_global_constant if t is not NULL.
+
 2016-05-23  Marek Polacek  <polacek@redhat.com>
 
        PR c/49859
index 8caa973e46c7fe44a2e99c5d1b9bf618e81a986c..4b7f6bbf31c66229372b0445280dbcc5d44e0703 100644 (file)
@@ -2027,7 +2027,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
                                              ie->indirect_info->offset,
                                              ie->indirect_info->by_ref,
                                              &from_global_constant);
-             if (!from_global_constant
+             if (t
+                 && !from_global_constant
                  && !ie->indirect_info->guaranteed_unmodified)
                t = NULL_TREE;
            }