From aa8df486e8b539609f9fcd6579a3dba6fa3f4267 Mon Sep 17 00:00:00 2001 From: Walter Lee Date: Sat, 19 Nov 2016 02:34:17 +0000 Subject: [PATCH] TILE-Gx: Fix bundling when encountering consecutive barriers. * config/tilegx/tilegx.c (tilegx_gen_bundles): Preserve end-of-bundle marker for consecutive barriers. From-SVN: r242617 --- gcc/ChangeLog | 5 +++++ gcc/config/tilegx/tilegx.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 13b60c2e1e8..1efd5fa8223 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-18 Walter Lee + + * config/tilegx/tilegx.c (tilegx_gen_bundles): Preserve + end-of-bundle marker for consecutive barriers. + 2016-11-18 Walter Lee * config/tilegx/tilegx.md (clzsi2): Fix for big-endian. diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 76a74551581..0403e8eeb63 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -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; } } } -- 2.30.2