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.
+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:
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);
/* 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);