TILE-Gx: Fix bundling when encountering consecutive barriers.
authorWalter Lee <walt@tilera.com>
Sat, 19 Nov 2016 02:34:17 +0000 (02:34 +0000)
committerWalter Lee <walt@gcc.gnu.org>
Sat, 19 Nov 2016 02:34:17 +0000 (02:34 +0000)
        * config/tilegx/tilegx.c (tilegx_gen_bundles): Preserve
          end-of-bundle marker for consecutive barriers.

From-SVN: r242617

gcc/ChangeLog
gcc/config/tilegx/tilegx.c

index 13b60c2e1e84c1830136737095898a55e8b6bb60..1efd5fa8223ed54597afa4a964907a96c2a29a99 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-18  Walter Lee  <walt@tilera.com>
+
+       * config/tilegx/tilegx.c (tilegx_gen_bundles): Preserve
+         end-of-bundle marker for consecutive barriers.
+
 2016-11-18  Walter Lee  <walt@tilera.com>
 
        * config/tilegx/tilegx.md (clzsi2): Fix for big-endian.
index 76a74551581f99c574f61761383e3d74a342b29b..0403e8eeb63eb1e6a214ebab3446e2bac961a713 100644 (file)
@@ -4469,8 +4469,7 @@ tilegx_gen_bundles (void)
       rtx_insn *end = NEXT_INSN (BB_END (bb));
 
       prev = NULL;
-      for (insn = next_insn_to_bundle (BB_HEAD (bb), end); insn;
-          prev = insn, insn = next)
+      for (insn = next_insn_to_bundle (BB_HEAD (bb), end); insn; insn = next)
        {
          next = next_insn_to_bundle (NEXT_INSN (insn), end);
 
@@ -4506,7 +4505,11 @@ tilegx_gen_bundles (void)
                PUT_MODE (prev, QImode);
              }
            delete_insn (insn);
+
+            // Note: prev remains the same for next iteration.
          }
+          else
+            prev = insn;
        }
     }
 }