diff options
author | Kwok Cheung Yeung <kcy@codesourcery.com> | 2022-04-14 21:21:11 +0100 |
---|---|---|
committer | Kwok Cheung Yeung <kcy@codesourcery.com> | 2022-06-28 13:55:30 -0700 |
commit | 0ad06e951e9ae93ad039325e58a569e56b3c610d (patch) | |
tree | 5b025f3ef75adf8750dc1912b59ae2b3019b329f /gcc | |
parent | 00e6d2d70c212728f9bd3c1517bbef93376eee4a (diff) | |
download | gcc-0ad06e951e9ae93ad039325e58a569e56b3c610d.zip gcc-0ad06e951e9ae93ad039325e58a569e56b3c610d.tar.gz gcc-0ad06e951e9ae93ad039325e58a569e56b3c610d.tar.bz2 |
Fix ICE in OpenACC kernel testcases
This is due to sequences like this occurring:
<bb 11> :
.data_dep.8_27 = .UNIQUE (OACC_TAIL_MARK, .data_dep.8_16, 2);
<bb 12> :
.data_dep.8_29 = .UNIQUE (OACC_JOIN, .data_dep.8_27, -1);
...
<bb 15> :
.UNIQUE (OACC_TAIL_MARK, .data_dep.8_33);
The final tail mark has no LHS, causing code that assumes its presence to
segfault. The LHS and the assignment appear to have been removed as dead
code by the cddce1 stage.
Fixed by checking for the presence of the LHS before using it.
2022-04-14 Kwok Cheung Yeung <kcy@codesourcery.com>
gcc/
* graphite-oacc.cc (find_oacc_tail_marks): Check that data_dep is
non-NULL before testing it.
(reduction_use_in_outer_loop_p): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog.omp | 6 | ||||
-rw-r--r-- | gcc/graphite-oacc.cc | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index eba4871..1a9d3c5 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,9 @@ +2022-04-14 Kwok Cheung Yeung <kcy@codesourcery.com> + + * graphite-oacc.cc (find_oacc_tail_marks): Check that data_dep is + non-NULL before testing it. + (reduction_use_in_outer_loop_p): Likewise. + 2022-05-12 Jakub Jelinek <jakub@redhat.com> Backport from mainline: diff --git a/gcc/graphite-oacc.cc b/gcc/graphite-oacc.cc index 6ba5d0f..3ca1359 100644 --- a/gcc/graphite-oacc.cc +++ b/gcc/graphite-oacc.cc @@ -253,7 +253,7 @@ find_oacc_tail_marks (loop_p loop) tree data_dep = gimple_call_lhs (top_tail_mark); gimple *stmt = top_tail_mark; - while (has_single_use (data_dep)) + while (data_dep && has_single_use (data_dep)) { use_operand_p use_p; single_imm_use (data_dep, &use_p, &stmt); @@ -313,7 +313,7 @@ reduction_use_in_outer_loop_p (gcall *call) /* The IFN_GOACC_REDUCTION_CALLS are linked in a chain through immediate uses. Move to the end of this chain. */ gimple *stmt = call; - while (has_single_use (data_dep)) + while (data_dep && has_single_use (data_dep)) { use_operand_p use_p; single_imm_use (data_dep, &use_p, &stmt); |