Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-24 Thread Jason Merrill
On 4/22/25 4:48 PM, Jason Merrill wrote: On 4/22/25 1:21 PM, Tobias Burnus wrote: Jason Merrill wrote: On 4/22/25 11:04 AM, Tobias Burnus wrote: 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

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Jason Merrill
On 4/22/25 1:21 PM, Tobias Burnus wrote: Jason Merrill wrote: On 4/22/25 11:04 AM, Tobias Burnus wrote: 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. This seems to

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Jakub Jelinek
On Tue, Apr 22, 2025 at 07:21:14PM +0200, Tobias Burnus wrote: > I currently do not see whether the code is needed in this case or not, but I > assume it is, if we want to support static initializers?!? > > In any case, it seems as if the condition 'if (flag_openmp)' additionally > requires '&& lo

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Tobias Burnus
Jason Merrill wrote: On 4/22/25 11:04 AM, Tobias Burnus wrote: 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. This seems to be because of:   if (module_global_init

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Jason Merrill
On 4/22/25 11:04 AM, Tobias Burnus wrote: 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

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Tobias Burnus
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

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Jakub Jelinek
On Tue, Apr 22, 2025 at 10:47:31AM -0400, Jason Merrill wrote: > On 4/21/25 6:46 AM, Nathaniel Shead wrote: > > I don't really know how OpenMP works, hopefully this makes sense. > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > And for 15 (I guess after release)? > > This is

Re: [PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-22 Thread Jason Merrill
On 4/21/25 6:46 AM, Nathaniel Shead wrote: I don't really know how OpenMP works, hopefully this makes sense. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? And for 15 (I guess after release)? This is OK with a FIXME; presumably if we want to support running static constructor

[PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-21 Thread Nathaniel Shead
I don't really know how OpenMP works, hopefully this makes sense. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? And for 15 (I guess after release)? -- >8 -- In r15-2799-gf1bfba3a9b3f31, a new kind of global constructor was added. Unfortunately this broke C++20 modules, as both