]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
jump.c (delete_related_insns): Keep (use (insn))s.
authorRichard Sandiford <rdsandiford@googlemail.com>
Sat, 18 Jan 2014 10:12:22 +0000 (10:12 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 18 Jan 2014 10:12:22 +0000 (10:12 +0000)
gcc/
* jump.c (delete_related_insns): Keep (use (insn))s.
* reorg.c (redundant_insn): Check for barriers too.

From-SVN: r206749

gcc/ChangeLog
gcc/jump.c
gcc/reorg.c

index 01ba1fd4470d7686dcba6ce32a1d998db2eaa818..51d6cc6e8e4c50bdcf8ca65d8b19a22a7172cd06 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * jump.c (delete_related_insns): Keep (use (insn))s.
+       * reorg.c (redundant_insn): Check for barriers too.
+
 2014-01-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (ix86_split_lea_for_addr): Fix a comment
index 40dfe6c250cda25171af884b57f03c8a72d9137d..e6dabd05c5c3cf6429cf82804f00eed4a2ed6f72 100644 (file)
@@ -1355,6 +1355,13 @@ delete_related_insns (rtx insn)
          /* Keep going past other deleted labels to delete what follows.  */
          else if (code == CODE_LABEL && INSN_DELETED_P (next))
            next = NEXT_INSN (next);
+         /* Keep the (use (insn))s created by dbr_schedule, which needs
+            them in order to track liveness relative to a previous
+            barrier.  */
+         else if (INSN_P (next)
+                  && GET_CODE (PATTERN (next)) == USE
+                  && INSN_P (XEXP (PATTERN (next), 0)))
+           next = NEXT_INSN (next);
          else if (code == BARRIER || INSN_P (next))
            /* Note: if this deletes a jump, it can cause more
               deletion of unreachable code, after a different label.
index de332323ae1c155883ebaf19f8cd064390058380..054304a188a3103b50e135cb8b1268a1977c7529 100644 (file)
@@ -1512,7 +1512,10 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
        trial && insns_to_search > 0;
        trial = PREV_INSN (trial))
     {
-      if (LABEL_P (trial))
+      /* (use (insn))s can come immediately after a barrier if the
+        label that used to precede them has been deleted as dead.
+        See delete_related_insns.  */
+      if (LABEL_P (trial) || BARRIER_P (trial))
        return 0;
 
       if (!INSN_P (trial))