]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cfganal.c (flow_call_edges_add): Don't crash on noreturn call.
authorRichard Henderson <rth@redhat.com>
Tue, 7 Jan 2003 20:14:51 +0000 (12:14 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 7 Jan 2003 20:14:51 +0000 (12:14 -0800)
From-SVN: r61007

gcc/ChangeLog
gcc/cfganal.c
gcc/testsuite/gcc.dg/20030107-1.c [new file with mode: 0644]

index ac0a80d0747ea65f51fb63fc8268c6be95e2c213..8acd3995591530aa9d25c76e0872631120edb1d9 100644 (file)
@@ -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
index 170ba447315aaa1258f8f032279f45a48706cb7d..a7878178fbd7fbb31266f9dd47830fced72199f0 100644 (file)
@@ -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 (file)
index 0000000..9264eba
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fprofile-arcs" } */
+
+extern void bar(void) __attribute__((noreturn));
+int foo (void) { bar(); }