http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57067
Bug #: 57067 Summary: Missing control flow edges for setjmp/longjmp Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: kreb...@gcc.gnu.org The fix for PR56982 adds abnormal control flow edges from function calls to a setjmp call in the same function. Unfortunately these edges do not survive until RTL so that the RTL passes might still do the wrong thing. The edges are removed in gimple_expand_cfg: /* At the moment not all abnormal edges match the RTL representation. It is safe to remove them here as find_many_sub_basic_blocks will rediscover them. In the future we should get this fixed properly. */ if ((e->flags & EDGE_ABNORMAL) && !(e->flags & EDGE_SIBCALL)) remove_edge (e); else ei_next (&ei); find_many_sub_basic_blocks needs a fix to add them back as well. I don't have a testcase for GCC head. The testcase I have fails only with GCC 4.4: http://gcc.gnu.org/ml/gcc/2013-04/msg00237.html In this case the RTL scheduler pass generates broken code due to the missing control flow info. I think this could potentially happen with GCC head as well.