* cfgbuild.c (control_flow_insn_p): Notice noreturn call
authorJan Hubicka <jh@suse.cz>
Thu, 27 May 2004 12:56:30 +0000 (14:56 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 27 May 2004 12:56:30 +0000 (12:56 +0000)
From-SVN: r82321

gcc/ChangeLog
gcc/cfgbuild.c

index c695171..6691fab 100644 (file)
@@ -1,3 +1,7 @@
+2004-05-27  Jan Hubicka  <jh@suse.cz>
+
+       * cfgbuild.c (control_flow_insn_p):  Notice noreturn call
+
 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
 
        * combine.c (gen_binary): Remove.
index 3e9a36c..e184479 100644 (file)
@@ -108,6 +108,12 @@ control_flow_insn_p (rtx insn)
              && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
 
     case CALL_INSN:
+      /* Noreturn and sibling call instructions terminate the basic blocks
+        (but only if they happen unconditionally).  */
+      if ((SIBLING_CALL_P (insn)
+          || find_reg_note (insn, REG_NORETURN, 0))
+         && GET_CODE (PATTERN (insn)) != COND_EXEC)
+       return true;
       /* Call insn may return to the nonlocal goto handler.  */
       return ((nonlocal_goto_handler_labels
               && (0 == (note = find_reg_note (insn, REG_EH_REGION,