On Tue, Oct 18, 2022 at 09:27:04PM +0200, Tobias Burnus wrote: > The cgraph_node::create_clone issue is exposed with -O2 for the existing > libgomp.fortran/reverse-offload-1.f90. > > omp-offload.cc > > PR middle-end/107236 > > gcc/ChangeLog: > * omp-expand.cc (expand_omp_target): Set calls_declare_variant_alt > in DECL_CONTEXT and not to cfun->decl. > * cgraphclones.cc (cgraph_node::create_clone): Copy also the > node's calls_declare_variant_alt value. > > gcc/testsuite/ChangeLog: > * gfortran.dg/gomp/target-device-ancestor-6.f90: New test.
LGTM, thanks. Jakub