]> git.ipfire.org Git - thirdparty/gcc.git/commit
[openacc, parloops] Fix SIGSEGV in oacc_entry_exit_ok_1
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 07:47:15 +0000 (07:47 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 07:47:15 +0000 (07:47 +0000)
commit41d384c50571635a2dbbbb9d297f12ce91fb5797
tree5b821801cb9880bae3a5f827f3b288ea8c4f4615
parent965f4339a5831769b7cc997cb4306616d3b6ad89
[openacc, parloops] Fix SIGSEGV in oacc_entry_exit_ok_1

When compiling the test-case with r268755, we run into a SIGSEGV in
oacc_entry_exit_ok_1 when trying to dereference a NULL red:
...
                      struct reduction_info *red;
                      red = reduction_phi (reduction_list, use_stmt);
                      tree val = PHI_RESULT (red->keep_res);
...

Fix this by handling ref == NULL.

Bootstrapped and reg-tested on x86_64.
Build and reg-tested on x86_64 with nvptx accelerator.

2019-06-16  Tom de Vries  <tdevries@suse.de>

PR tree-optimization/89376
* tree-parloops.c (oacc_entry_exit_ok_1): Handle red == NULL.

* testsuite/libgomp.oacc-c-c++-common/pr89376.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272338 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-parloops.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.oacc-c-c++-common/pr89376.c [new file with mode: 0644]