https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108868

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> (In reply to Jakub Jelinek from comment #4)
> > I think the reason why it doesn't work is clear, call_can_make_abnormal_goto
> > on the vfork call is false, because it is leaf (and that is how glibc
> > declares vfork BTW) and ctrl_altering flag is initialized by
> > gimple_call_initialize_ctrl_altering based on that or if it is noreturn etc.
> > (nothing applies).
> > So, I think as discussed in another PR, I think we really should make if not
> > call_can_make_abnormal_goto at least gimple_call_initialize_ctrl_altering be
> > true for
> > RETURNS_TWICE calls.
> 
> I think I'm going to revert r13-5965 since neither setjmp nor [v]fork alter
> control flow.  They receive additional control flow.

So we could just add GF_CALL_RETURNS_TWICE, there are still bits left.

> I'm not sure why we have abnormal edges into fork(), fork simply returns

We don't.  vfork isn't a builtin but we have handle it by name in
special_function_p.
fork is a builtin, but just
DEF_EXT_LIB_BUILTIN        (BUILT_IN_FORK, "fork", BT_FN_PID,
ATTR_NOTHROW_LIST)
and is a builtin just because of gcov wrappers.
And glibc don't declare returns_twice any of them, it just uses nothrow, leaf
attributes on vfork and just nothrow attribute on fork.

Reply via email to