Sanity-checked by running the libgomp testsuite. I realize the #ifdef in internal-fn.c is not appropriate: it's there to make the patch smaller, I'll replace it with a target hook if otherwise this approach is ok.
FWIW, no objections from me regarding the approach. Bernd