+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
&& 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))