gcc/ChangeLog: * omp-low.c (lower_oacc_reductions): Only create a reference if variable has pointer type. --- gcc/omp-low.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index ae5cdfc5e260..2b8b848ec03a 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -7639,9 +7639,10 @@ lower_oacc_reductions (location_t loc, tree clauses, tree level, bool inner, if (omp_privatize_by_reference (orig)) { - outgoing = build_simple_mem_ref (outgoing); + if (POINTER_TYPE_P (TREE_TYPE (outgoing))) + outgoing = build_simple_mem_ref (outgoing); - if (!TREE_CONSTANT (incoming)) + if (POINTER_TYPE_P (TREE_TYPE (incoming))) incoming = build_simple_mem_ref (incoming); } -- 2.33.0 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955