https://gcc.gnu.org/g:976aae1e93fc5c29fac5cfcacc5ee64d8ca48222

commit 976aae1e93fc5c29fac5cfcacc5ee64d8ca48222
Author: Mikael Morin <[email protected]>
Date:   Sun Jul 19 14:59:52 2026 +0200

    Correction ajout non_lvalue

Diff:
---
 gcc/fortran/trans-descriptor.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 9db4d1c300a7..efe56074135a 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -108,8 +108,10 @@ gfc_conv_descriptor_data_get (tree desc)
 
   tree data = conv_descriptor_data (desc);
   tree target_type = GFC_TYPE_ARRAY_DATAPTR_TYPE (type);
-  tree t = fold_convert (target_type, data);
-  return non_lvalue_loc (input_location, t);
+  /* Return a conversion of a non_lvalue.  Doing it the other way around,
+     (non_lvalue of a correction), the non_lvalue is immediately removed.  */
+  tree t = non_lvalue_loc (input_location, data);
+  return fold_convert (target_type, t);
 }
 
 /* This provides WRITE access to the data field.  */

Reply via email to