[nvptx] Fix prevent_branch_around_nothing
authorTom de Vries <tom@codesourcery.com>
Tue, 20 Mar 2018 09:14:07 +0000 (09:14 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 20 Mar 2018 09:14:07 +0000 (09:14 +0000)
2018-03-20  Tom de Vries  <tom@codesourcery.com>

PR target/84954
* config/nvptx/nvptx.c (prevent_branch_around_nothing): Also update
seen_label if seen_label is already set.

From-SVN: r258674

gcc/ChangeLog
gcc/config/nvptx/nvptx.c

index f7829760592482237f84afddcde5991b53f0effd..460802d8b643027c7591c755a53268fa210b5fdb 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-20  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/84954
+       * config/nvptx/nvptx.c (prevent_branch_around_nothing): Also update
+       seen_label if seen_label is already set.
+
 2018-03-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/84945
index a6f444340fd04c09c50605b33ddb00a22e87cc02..7b0b182deb2283bdf1235ac3e7de7155d954cd24 100644 (file)
@@ -4419,14 +4419,15 @@ prevent_branch_around_nothing (void)
   rtx_insn *seen_label = NULL;
     for (rtx_insn *insn = get_insns (); insn; insn = NEXT_INSN (insn))
       {
-       if (seen_label == NULL)
+       if (INSN_P (insn) && condjump_p (insn))
          {
-           if (INSN_P (insn) && condjump_p (insn))
-             seen_label = label_ref_label (nvptx_condjump_label (insn, false));
-
+           seen_label = label_ref_label (nvptx_condjump_label (insn, false));
            continue;
          }
 
+       if (seen_label == NULL)
+         continue;
+
        if (NOTE_P (insn) || DEBUG_INSN_P (insn))
          continue;