From 4b557bcc0d0674011a45ad259f44b9830289bd1f Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 12 Jun 2019 14:56:18 +0000 Subject: [PATCH] [nvptx] Assert fork has at most one join in nvptx_find_par With the test-case of PR90009 we run into a SIGSEGV in nvptx_neuter_pars, because par->join_insn and par->join_block are NULL. Detect this problem earlier, by adding an assert in nvptx_find_par that asserts that a fork cannot be paired with more than one join. Build and tested on x86_64 with nvptx accelerator enabled. 2019-06-12 Tom de Vries PR tree-optimization/90009 * config/nvptx/nvptx.c (nvptx_find_par): Assert fork has at most join. From-SVN: r272189 --- gcc/ChangeLog | 5 +++++ gcc/config/nvptx/nvptx.c | 1 + 2 files changed, 6 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 214ded49f1a..a47cf26b507 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-12 Tom de Vries + + PR tree-optimization/90009 + * config/nvptx/nvptx.c (nvptx_find_par): Assert fork has at most join. + 2019-06-12 Martin Liska * ggc-common.c (ggc_prune_overhead_list): Do not sanitize diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 1986e79309a..76468f63586 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -3258,6 +3258,7 @@ nvptx_find_par (bb_insn_map_t *map, parallel *par, basic_block block) unsigned mask = UINTVAL (XVECEXP (PATTERN (end), 0, 0)); gcc_assert (par->mask == mask); + gcc_assert (par->join_block == NULL); par->join_block = block; par->join_insn = end; if (nvptx_needs_shared_bcast (mask)) -- 2.30.2