This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/43611] [4.5 Regression] ICE: SIGSEGV with -fipa-cp-clone -fkeep-inline-functions
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Apr 2010 17:11:09 -0000
- Subject: [Bug tree-optimization/43611] [4.5 Regression] ICE: SIGSEGV with -fipa-cp-clone -fkeep-inline-functions
- References: <bug-43611-14164@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2010-04-03 17:11 -------
Looking at the testcase the issue is obvious. We have marked the
instantiations as extern, and indeed the cgraph code dealing with
-fkeep-inline-functions honors this and does not preserve extern
inline bodies while the C++ FE does not consider this case.
Thus the following patch also solves this.
Index: cp/semantics.c
===================================================================
--- cp/semantics.c (revision 157953)
+++ cp/semantics.c (working copy)
@@ -3449,7 +3449,9 @@ expand_or_defer_fn_1 (tree fn)
this function as needed so that finish_file will make sure to
output it later. Similarly, all dllexport'd functions must
be emitted; there may be callers in other DLLs. */
- if ((flag_keep_inline_functions && DECL_DECLARED_INLINE_P (fn))
+ if ((flag_keep_inline_functions
+ && DECL_DECLARED_INLINE_P (fn)
+ && !DECL_EXTERNAL (fn))
|| lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn)))
mark_needed (fn);
}
I am going to bootstrap & test this more minimal variant.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2010-04-01 13:39:09 |2010-04-03 17:11:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43611