This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/43611] [4.5 Regression] ICE: SIGSEGV with -fipa-cp-clone -fkeep-inline-functions



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]