]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cprop.c
[Ada] Fix documentation for GNAT.Command_Line.Exit_From_Command_Line
[thirdparty/gcc.git] / gcc / cprop.c
index e315e53b695fedf562c628028ae8b79889b4f20a..65c0130cc07a1327ccae43a718d82485c4bd28b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Global constant/copy propagation for RTL.
-   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   Copyright (C) 1997-2019 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -839,7 +839,7 @@ find_avail_set (int regno, rtx_insn *insn, struct cprop_expr *set_ret[2])
        (set (reg X) (reg Y))
        (set (reg Y) (reg X))
 
-     This can not happen since the set of (reg Y) would have killed the
+     This cannot happen since the set of (reg Y) would have killed the
      set of (reg X) making it unavailable at the start of this block.  */
   while (1)
     {
@@ -972,7 +972,7 @@ cprop_jump (basic_block bb, rtx_insn *setcc, rtx_insn *jump, rtx from, rtx src)
   if (dump_file != NULL)
     {
       fprintf (dump_file,
-              "GLOBAL CONST-PROP: Replacing reg %d in jump_insn %d with"
+              "GLOBAL CONST-PROP: Replacing reg %d in jump_insn %d with "
               "constant ", REGNO (from), INSN_UID (jump));
       print_rtl (dump_file, src);
       fprintf (dump_file, "\n");
@@ -1161,7 +1161,7 @@ local_cprop_find_used_regs (rtx *xptr, void *data)
       return;
 
     case SUBREG:
-      if (df_read_modify_subreg_p (x))
+      if (read_modify_subreg_p (x))
        return;
       break;
 
@@ -1852,12 +1852,22 @@ one_cprop_pass (void)
                if (! NOTE_P (insn) && ! insn->deleted ())
                  mark_oprs_set (insn);
 
-               if (!was_uncond_trap && !seen_uncond_trap
+               if (!was_uncond_trap
                    && GET_CODE (PATTERN (insn)) == TRAP_IF
                    && XEXP (PATTERN (insn), 0) == const1_rtx)
                  {
-                   seen_uncond_trap = true;
-                   uncond_traps.safe_push (insn);
+                   /* If we have already seen an unconditional trap
+                      earlier, the rest of the bb is going to be removed
+                      as unreachable.  Just turn it into a note, so that
+                      RTL verification doesn't complain about it before
+                      it is finally removed.  */
+                   if (seen_uncond_trap)
+                     set_insn_deleted (insn);
+                   else
+                     {
+                       seen_uncond_trap = true;
+                       uncond_traps.safe_push (insn);
+                     }
                  }
              }
        }