From 9a97772f93d68e8bc8b7166f3f7b202bfdc995f3 Mon Sep 17 00:00:00 2001
From: Jan Hubicka <hubicka@ucw.cz>
Date: Wed, 24 Oct 2018 14:50:25 +0200
Subject: [PATCH] ipa-utils.h (type_with_linkage_p): No longer check for
 TYPE_STUB_DECL; it is wrong for forward declarations.

	* ipa-utils.h (type_with_linkage_p): No longer check for TYPE_STUB_DECL;
	it is wrong for forward declarations.

From-SVN: r265460
---
 gcc/ChangeLog   | 5 +++++
 gcc/ipa-utils.h | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 300ab6cd4d2d..582d65a9c4a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+	* ipa-utils.h (type_with_linkage_p): No longer check for TYPE_STUB_DECL;
+	it is wrong for forward declarations.
+
 2018-10-24  Ilya Leoshkevich  <iii@linux.ibm.com>
 
 	* config/s390/s390.c (s390_check_qrst_address): Add the missing
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index 98f2a75cd814..7d663ec6b0ee 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -193,10 +193,10 @@ type_with_linkage_p (const_tree t)
   if (DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (t)))
     return true;
 
-  /* If free lang data was not run check if indeed the type looks like C++
-     type with linkage.  */
-  if (in_lto_p || !TYPE_STUB_DECL (t))
+  if (in_lto_p)
     return false;
+  /* We used to check for TYPE_STUB_DECL but that is set to NULL for forward
+     declarations.  */
 
   if (!RECORD_OR_UNION_TYPE_P (t) && TREE_CODE (t) != ENUMERAL_TYPE)
     return false;
-- 
GitLab