crash: longjmp vs -fprofile-arcs
Richard Henderson
rth@redhat.com
Tue Jan 7 20:15:00 GMT 2003
On Fri, Dec 06, 2002 at 06:22:26PM -0800, Dale Johannesen wrote:
> #include <setjmp.h>
> int foo (jmp_buf buf) { longjmp(buf, 1); }
>
> now what? cc -fprofile-arcs lj.c
> lj.c: In function `foo':
> lj.c:2: internal error: Bus error
> Please submit a full bug report, blah blah
Fixed thus.
r~
* cfganal.c (flow_call_edges_add): Don't crash on noreturn call.
Index: cfganal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.31
diff -c -p -d -r1.31 cfganal.c
*** cfganal.c 16 Dec 2002 18:19:06 -0000 1.31
--- cfganal.c 7 Jan 2003 19:59:47 -0000
*************** flow_call_edges_add (blocks)
*** 322,331 ****
for (e = bb->succ; e; e = e->succ_next)
if (e->dest == EXIT_BLOCK_PTR)
! break;
!
! insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e);
! commit_edge_insertions ();
}
}
--- 322,332 ----
for (e = bb->succ; e; e = e->succ_next)
if (e->dest == EXIT_BLOCK_PTR)
! {
! insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e);
! commit_edge_insertions ();
! break;
! }
}
}
More information about the Gcc-patches
mailing list