https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104132
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=100280
Resolution|--- |FIXED
--- Comment #4 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to myself from comment #1)
> The following fix fell out of me analyzing PR102330:
>
> --- gcc/omp-expand.cc
> +++ gcc/omp-expand.cc
> @@ -7776,7 +7776,9 @@ expand_oacc_for (struct omp_region *region, struct
> omp_for_data *fd)
>
> expr = build2 (plus_code, iter_type, b,
> fold_convert (plus_type, offset));
> - expr = force_gimple_operand_gsi (&gsi, expr, false, NULL_TREE,
> + expr = force_gimple_operand_gsi (&gsi, expr,
> + DECL_P (v) && TREE_ADDRESSABLE (v),
> + NULL_TREE,
> true, GSI_SAME_STMT);
> ass = gimple_build_assign (v, expr);
> gsi_insert_before (&gsi, ass, GSI_SAME_STMT);
> @@ -7966,7 +7968,9 @@ expand_oacc_for (struct omp_region *region, struct
> omp_for_data *fd)
> expr = fold_build2 (TRUNC_DIV_EXPR, diff_type, expr, s);
> expr = fold_build2 (MULT_EXPR, diff_type, expr, s);
> expr = build2 (plus_code, iter_type, b, fold_convert (plus_type,
> expr));
> - expr = force_gimple_operand_gsi (&gsi, expr, false, NULL_TREE,
> + expr = force_gimple_operand_gsi (&gsi, expr,
> + DECL_P (v) && TREE_ADDRESSABLE (v),
> + NULL_TREE,
> true, GSI_SAME_STMT);
> ass = gimple_build_assign (v, expr);
> gsi_insert_before (&gsi, ass, GSI_SAME_STMT);
>
> ... as used in a number of other similar places (when they're not using
> 'expand_omp_build_assign').
>
> That change seems correct, right? (Jakub?)
Such a change actually wasn't necessary, with the underlying problem being
fixed earlier in the pass pipeline.