]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2009-02-06 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Feb 2009 09:06:39 +0000 (09:06 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 6 Feb 2009 09:06:39 +0000 (09:06 +0000)
PR middle-end/38977
* tree-cfg.c (need_fake_edge_p): Force a fake edge for
fork because we may expand it as __gcov_fork.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143982 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c

index 9b4a5431dbe5fb30b114946392fe6d8c4dc87ef3..849f101d6e41795c52bcb42bd38b52fedb33c18b 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-06  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/38977
+       * tree-cfg.c (need_fake_edge_p): Force a fake edge for
+       fork because we may expand it as __gcov_fork.
+
 2009-02-06  Nick Clifton  <nickc@redhat.com>
 
        * config/m32c/m32c.h (PCC_BITFIELD_TYPE_MATTERS): Define to
index 875d123244d07adb2a0ce6622307e13854606f8b..cb0058189156dec828b575d9bad7febd242a300f 100644 (file)
@@ -6444,9 +6444,14 @@ need_fake_edge_p (gimple t)
       && fndecl
       && DECL_BUILT_IN (fndecl)
       && (call_flags & ECF_NOTHROW)
-      && !(call_flags & ECF_NORETURN)
-      && !(call_flags & ECF_RETURNS_TWICE))
-   return false;
+      && !(call_flags & ECF_RETURNS_TWICE)
+      /* fork() doesn't really return twice, but the effect of
+         wrapping it in __gcov_fork() which calls __gcov_flush()
+        and clears the counters before forking has the same
+        effect as returning twice.  Force a fake edge.  */
+      && !(DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+          && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FORK))
+    return false;
 
   if (is_gimple_call (t)
       && !(call_flags & ECF_NORETURN))