]> gcc.gnu.org Git - gcc.git/commitdiff
emit-rtl.c (try_split): Copy NORETURN, SETJMP, ALWAYS_RETURN and NON_LOCAL_GOTO notes.
authorRichard Henderson <rth@redhat.com>
Wed, 19 Sep 2001 18:27:49 +0000 (11:27 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 19 Sep 2001 18:27:49 +0000 (11:27 -0700)
        * emit-rtl.c (try_split): Copy NORETURN, SETJMP, ALWAYS_RETURN
        and NON_LOCAL_GOTO notes.

From-SVN: r45691

gcc/ChangeLog
gcc/emit-rtl.c

index 1ce093610ce9152b3a15d316f972f66008721130..7dd1da4ac727567f82af8abec63935848c699b98 100644 (file)
@@ -2,6 +2,9 @@
 
        * cfgbuild.c (find_sub_basic_blocks): Handle insns that can throw.
 
+       * emit-rtl.c (try_split): Copy NORETURN, SETJMP, ALWAYS_RETURN
+       and NON_LOCAL_GOTO notes.
+
 2001-09-18  Catherine Moore  <clm@redhat.com>
 
        * config/stormy16/stormy16.h (DEFAULT_PCC_STRUCT_RETURN): 
index 82bff928711d47bce45e2f29e16d63a48d81943d..4c487978da662ba626433324f656ad2941954a7c 100644 (file)
@@ -2513,7 +2513,6 @@ try_split (pat, trial, last)
       if (GET_CODE (seq) == SEQUENCE)
        {
          int i, njumps = 0;
-         rtx eh_note;
 
          /* Avoid infinite loop if any insn of the result matches
             the original pattern.  */
@@ -2546,6 +2545,7 @@ try_split (pat, trial, last)
                                           REG_NOTES (insn));
                  }
              }
+
          /* If we are splitting a CALL_INSN, look for the CALL_INSN
             in SEQ and copy our CALL_INSN_FUNCTION_USAGE to it.  */
          if (GET_CODE (trial) == CALL_INSN)
@@ -2554,18 +2554,55 @@ try_split (pat, trial, last)
                CALL_INSN_FUNCTION_USAGE (XVECEXP (seq, 0, i))
                  = CALL_INSN_FUNCTION_USAGE (trial);
 
-         /* Copy EH notes.  */
-         if ((eh_note = find_reg_note (trial, REG_EH_REGION, NULL_RTX)))
-           for (i = 0; i < XVECLEN (seq, 0); i++)
-             {
-               rtx insn = XVECEXP (seq, 0, i);
-               if (GET_CODE (insn) == CALL_INSN
-                   || (flag_non_call_exceptions
-                       && may_trap_p (PATTERN (insn))))
-                 REG_NOTES (insn)
-                   = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (eh_note, 0),
-                                        REG_NOTES (insn));
-             }
+         /* Copy notes, particularly those related to the CFG.  */
+         for (note = REG_NOTES (trial); note ; note = XEXP (note, 1))
+           {
+             switch (REG_NOTE_KIND (note))
+               {
+               case REG_EH_REGION:
+                 for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+                   {
+                     rtx insn = XVECEXP (seq, 0, i);
+                     if (GET_CODE (insn) == CALL_INSN
+                         || (flag_non_call_exceptions
+                             && may_trap_p (PATTERN (insn))))
+                       REG_NOTES (insn)
+                         = gen_rtx_EXPR_LIST (REG_EH_REGION,
+                                              XEXP (note, 0),
+                                              REG_NOTES (insn));
+                   }
+                 break;
+
+               case REG_NORETURN:
+               case REG_SETJMP:
+               case REG_ALWAYS_RETURN:
+                 for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+                   {
+                     rtx insn = XVECEXP (seq, 0, i);
+                     if (GET_CODE (insn) == CALL_INSN)
+                       REG_NOTES (insn)
+                         = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
+                                              XEXP (note, 0),
+                                              REG_NOTES (insn));
+                   }
+                 break;
+
+               case REG_NON_LOCAL_GOTO:
+                 for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+                   {
+                     rtx insn = XVECEXP (seq, 0, i);
+                     if (GET_CODE (insn) == JUMP_INSN)
+                       REG_NOTES (insn)
+                         = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
+                                              XEXP (note, 0),
+                                              REG_NOTES (insn));
+                   }
+                 break;
+
+               default:
+                 break;
+               }
+           }
 
          /* If there are LABELS inside the split insns increment the
             usage count so we don't delete the label.  */
This page took 0.074113 seconds and 5 git commands to generate.