https://gcc.gnu.org/g:266247f89ddc49979fb67bfd96d6471e39c79467
commit 266247f89ddc49979fb67bfd96d6471e39c79467 Author: Mikael Morin <[email protected]> Date: Sun Sep 20 17:26:00 2026 +0200 Essai correction ICE pr114021 Diff: --- gcc/fortran/trans-stmt.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc index f0067e876f8d..576ce8e003a2 100644 --- a/gcc/fortran/trans-stmt.cc +++ b/gcc/fortran/trans-stmt.cc @@ -6797,7 +6797,8 @@ gfc_trans_allocate (gfc_code * code, gfc_omp_namelist *omp_allocate) code->expr3->ts, false, true, false, false); - if (POINTER_TYPE_P (TREE_TYPE (se.expr)) + if (!VAR_P (se.expr) + && POINTER_TYPE_P (TREE_TYPE (se.expr)) && TREE_CODE (TREE_TYPE (TREE_TYPE (se.expr))) != ARRAY_TYPE) se.expr = build_fold_indirect_ref_loc (input_location, se.expr); temp_obj_created = temp_var_needed = !VAR_P (se.expr);
