aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadbackward.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-06-15 07:06:19 +0000
committerTom de Vries <vries@gcc.gnu.org>2019-06-15 07:06:19 +0000
commit120a01d160cd47b4276507dc8f6c1ab571a9c006 (patch)
tree00e3daa8ac952df48b317271c3370dac780e62c7 /gcc/tree-ssa-threadbackward.c
parent2789efe3ee85f85ec83139fab6930cf2175be06a (diff)
downloadgcc-120a01d160cd47b4276507dc8f6c1ab571a9c006.zip
gcc-120a01d160cd47b4276507dc8f6c1ab571a9c006.tar.gz
gcc-120a01d160cd47b4276507dc8f6c1ab571a9c006.tar.bz2
[openacc] Disable pass_thread_jumps for IFN_UNIQUE
If we compile the openacc testcase with -fopenacc -O2, we run into a SIGSEGV or assert. The root cause for this is that pass_thread_jumps breaks the invariant that OACC_FORK and OACC_JOIN mark the start and end of a single-entry-single-exit region. Fix this by bailing out when encountering an IFN_UNIQUE in thread_jumps::profitable_jump_thread_path. Bootstrapped and reg-tested on x86_64. Build and reg-tested libgomp on x86_64 with nvptx accelerator. 2019-06-15 Tom de Vries <tdevries@suse.de> PR tree-optimization/90009 * tree-ssa-threadbackward.c (thread_jumps::profitable_jump_thread_path): Return NULL if bb contains IFN_UNIQUE. * testsuite/libgomp.oacc-c-c++-common/pr90009.c: New test. From-SVN: r272321
Diffstat (limited to 'gcc/tree-ssa-threadbackward.c')
-rw-r--r--gcc/tree-ssa-threadbackward.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c
index 81dc05d..1ff870a 100644
--- a/gcc/tree-ssa-threadbackward.c
+++ b/gcc/tree-ssa-threadbackward.c
@@ -261,6 +261,11 @@ thread_jumps::profitable_jump_thread_path (basic_block bbi, tree name,
gsi_next_nondebug (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
+ if (gimple_call_internal_p (stmt, IFN_UNIQUE))
+ {
+ m_path.pop ();
+ return NULL;
+ }
/* Do not count empty statements and labels. */
if (gimple_code (stmt) != GIMPLE_NOP
&& !(gimple_code (stmt) == GIMPLE_ASSIGN