This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: crash: longjmp vs -fprofile-arcs
- From: Richard Henderson <rth at redhat dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Jan 2003 12:15:25 -0800
- Subject: Re: crash: longjmp vs -fprofile-arcs
- References: <BA319C01-098A-11D7-B9DC-000393D76DAA@apple.com>
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;
! }
}
}