From 44a71f36580a4e0d05e3d787b4e54991ac26026a Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Mon, 23 May 2016 18:31:14 +0200 Subject: [PATCH] [PR 71234] Avoid valgrind warning in ipa-cp 2016-05-23 Martin Jambor 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 | 6 ++++++ gcc/ipa-cp.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d838407bc0b..f7a012c32bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-23 Martin Jambor + + 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 PR c/49859 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 8caa973e46c..4b7f6bbf31c 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -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; } -- 2.30.2