Jason Merrill wrote:
This is OK with a FIXME; presumably if we want to support running static constructors on the offload target we will eventually want to support that in modules as well.
Well, the code that added support for static constructors on the offload target exposed the issue. Thus, GCC already supports this (but not in combination of modules). The current patch is surely useful as it avoids issues even when there is actually no constructor on the offload side. The question is why does this code trigger at all, given that there is OpenMP but no offload code at all? And how to fix it in case there is offload code and modules are used. Tobias PS The current testcases are for static constructors on the offload side are: * libgomp.c++/static-aggr-constructor-destructor-{1,2,3}.C * g++.dg/gomp/pr119370.C