From 62c7e4b7485d26f3bbc3cf648ea86346955ac4c7 Mon Sep 17 00:00:00 2001
From: Jan Hubicka <hubicka@ucw.cz>
Date: Mon, 9 Feb 2015 21:24:55 +0100
Subject: [PATCH] ipa-polymorphic-call.c (ipa_polymorphic_call_context): Avoid
 ICE on getting VOID pointer.

	* ipa-polymorphic-call.c (ipa_polymorphic_call_context): Avoid ICE
	on getting VOID pointer.

From-SVN: r220545
---
 gcc/ChangeLog              | 5 +++++
 gcc/ipa-polymorphic-call.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 78c1af1e2e4a..e661a9d71682 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-08  Jan Hubicka  <hubicka@ucw.cz>
+
+	* ipa-polymorphic-call.c (ipa_polymorphic_call_context): Avoid ICE
+	on getting VOID pointer.
+
 2015-02-09  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/64979
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 5ad5e517fed7..aaa549e03d39 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -1078,7 +1078,7 @@ ipa_polymorphic_call_context::ipa_polymorphic_call_context (tree fndecl,
     base_type = TREE_TYPE (gimple_assign_rhs1
 			    (SSA_NAME_DEF_STMT (base_pointer)));
  
-  if (POINTER_TYPE_P (base_type))
+  if (base_type && POINTER_TYPE_P (base_type))
     combine_speculation_with (TYPE_MAIN_VARIANT (TREE_TYPE (base_type)),
 			      offset,
 			      true, NULL /* Do not change type here */);
-- 
GitLab