https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103416
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> --- Created attachment 51872 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51872&action=edit RFC Patch to avoid the pointless evaluation, see comment 4 (In reply to Tobias Burnus from comment #3) > * Why is the var generated in the parent scope of 'omp target' instead of > inside 'omp target'? The problem is a forced evaluation of the array bounds, which I regard as pointless if the variable is just a plain variable - no array ref, not struct ref no ... Cf. attachment. (The question is when 'force=true' is needed and whether the DECL_P check is the right one or whether more or less should be permitted.) This is indeed the same as issue as PR80330 (8...) * * * The libgomp: cuCtxSynchronize error: misaligned address is a regression – see comment 1 for a patch which fixes it. This is PR90030 (9...) * * * > * Why is 'map(to:' and not 'firstprivate' used? Because of: gfc_omp_predetermined_mapping (tree decl) { if (DECL_ARTIFICIAL (decl) && ! GFC_DECL_RESULT (decl) && ! (DECL_LANG_SPECIFIC (decl) && GFC_DECL_SAVED_DESCRIPTOR (decl))) return OMP_CLAUSE_DEFAULTMAP_TO; I wonder whether OMP_DEFAULTMAP_FIRSTPRIVATE wouldn't make more sense in this case – at least for gfc_omp_scalar_target_p ? Which is also related to PR80330 (8...)