https://gcc.gnu.org/g:45ca1aea4b84bf9921bb62472e078cf9fb742230
commit 45ca1aea4b84bf9921bb62472e078cf9fb742230 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Fri Aug 22 17:00:12 2025 +0200 Correction régression libgomp threadprivate2, threadprivate3 Diff: --- gcc/fortran/trans-descriptor.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc index 0f39a6140748..941a093503fd 100644 --- a/gcc/fortran/trans-descriptor.cc +++ b/gcc/fortran/trans-descriptor.cc @@ -1532,7 +1532,8 @@ init_struct (stmtblock_t *block, tree data_ref, init_kind kind, { tree value = values.single; if (TREE_STATIC (data_ref) - || !modifiable_p (data_ref)) + && (block == nullptr + || !modifiable_p (data_ref))) DECL_INITIAL (data_ref) = value; else if (TREE_CODE (value) == CONSTRUCTOR && !(TREE_CONSTANT (value) @@ -1552,7 +1553,9 @@ init_struct (stmtblock_t *block, tree data_ref, init_kind kind, else gfc_add_modify (block, data_ref, value); } - else if (TREE_STATIC (data_ref)) + else if (TREE_STATIC (data_ref) + && (block == nullptr + || !modifiable_p (data_ref))) return init_struct (block, data_ref, build_constructor (type, values.multiple)); else