diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 20:14:51 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 20:14:51 +0000 |
commit | 2c3f453c0cd6327271b63336f4e2fd87687a0789 (patch) | |
tree | a0848d70667717ed572294aca719c0efc7f03d31 /gcc | |
parent | 1403447ddc31786720849deebab17352376e575a (diff) | |
download | gcc-2c3f453c0cd6327271b63336f4e2fd87687a0789.tar.gz |
* cfganal.c (flow_call_edges_add): Don't crash on noreturn call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cfganal.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/20030107-1.c | 5 |
3 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac0a80d0747..8acd3995591 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-01-07 Richard Henderson <rth@redhat.com> + + * cfganal.c (flow_call_edges_add): Don't crash on noreturn call. + 2003-01-07 Daniel Berlin <dberlin@dberlin.org> * cfg.c: Include alloc-pool.h diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 170ba447315..a7878178fbd 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -1,6 +1,6 @@ /* Control flow graph analysis code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -322,10 +322,11 @@ flow_call_edges_add (blocks) 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 (); + { + insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e); + commit_edge_insertions (); + break; + } } } diff --git a/gcc/testsuite/gcc.dg/20030107-1.c b/gcc/testsuite/gcc.dg/20030107-1.c new file mode 100644 index 00000000000..9264eba701e --- /dev/null +++ b/gcc/testsuite/gcc.dg/20030107-1.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-fprofile-arcs" } */ + +extern void bar(void) __attribute__((noreturn)); +int foo (void) { bar(); } |