aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-04-05 08:36:37 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-04-05 08:36:37 +0000
commit2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1 (patch)
tree26dcac04b2435d5bda5b7eba0accc7e71cccdde7 /gcc
parent44780b91eb61d1a4ae3a6f94300d1b97a1d06557 (diff)
downloadgcc-2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1.zip
gcc-2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1.tar.gz
gcc-2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1.tar.bz2
[nvptx] Fix neutering of bb with only cond jump
2018-04-05 Tom de Vries <tom@codesourcery.com> PR target/85204 * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only cond jump. * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test. From-SVN: r259125
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nvptx/nvptx.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6e299cb..517ac4e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-05 Tom de Vries <tom@codesourcery.com>
+
+ PR target/85204
+ * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only
+ cond jump.
+
2018-04-05 Shiva Chen <shiva0217@gmail.com>
Kito Cheng <kito.cheng@gmail.com>
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index b2b150f..a9a3053 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -4048,6 +4048,7 @@ nvptx_single (unsigned mask, basic_block from, basic_block to)
/* Insert the vector test inside the worker test. */
unsigned mode;
rtx_insn *before = tail;
+ rtx_insn *neuter_start = NULL;
for (mode = GOMP_DIM_WORKER; mode <= GOMP_DIM_VECTOR; mode++)
if (GOMP_DIM_MASK (mode) & skip_mask)
{
@@ -4065,7 +4066,10 @@ nvptx_single (unsigned mask, basic_block from, basic_block to)
br = gen_br_true (pred, label);
else
br = gen_br_true_uni (pred, label);
- emit_insn_before (br, head);
+ if (neuter_start)
+ neuter_start = emit_insn_after (br, neuter_start);
+ else
+ neuter_start = emit_insn_before (br, head);
LABEL_NUSES (label)++;
if (tail_branch)