------- Comment #5 from jamborm at gcc dot gnu dot org  2009-02-23 14:09 -------
I don't understand the comment above the assert at all (Honza probably
does) and so this might not  be the correct approach but the following
patch should just obviously work.   At least it does for this testcase
and I am about to bootstrap and regression test it:

2009-02-23  Martin Jambor  <mjam...@suse.cz>

        * tree-inline.c (tree_versionable_function_p): Return false for
        functions calling setjmp or alloca.

Index: tree-inline.c
===================================================================
--- tree-inline.c       (revision 144380)
+++ tree-inline.c       (working copy)
@@ -4174,12 +4174,17 @@ copy_static_chain (tree static_chain, co
 bool
 tree_versionable_function_p (tree fndecl)
 {
+  struct function *fn_cfun;
   if (fndecl == NULL_TREE)
     return false;
   /* ??? There are cases where a function is
      uninlinable but can be versioned.  */
   if (!tree_inlinable_function_p (fndecl))
     return false;
+
+  fn_cfun = DECL_STRUCT_FUNCTION (fndecl);
+  if (fn_cfun->calls_setjmp || fn_cfun->calls_alloca)
+    return false;

   return true;
 }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39259

Reply via email to