[gcc(refs/users/mikael/heads/refactor_descriptor_v203.04)] Correction coarray_46

Mikael Morin via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:1326bbfc7b2b43a06a5865d354e22bfcb7d134be

commit 1326bbfc7b2b43a06a5865d354e22bfcb7d134be
Author: Mikael Morin <[email protected]>
Date:   Wed Jul 15 14:56:21 2026 +0200

    Correction coarray_46

Diff:
---
 gcc/fortran/trans-expr.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index f135c6358eeb..1bf8eeca7bfe 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -11853,6 +11853,10 @@ gfc_trans_scalar_assign (gfc_se *lse, gfc_se *rse, gfc_typespec ts,
       tree tmp_var = NULL_TREE;
       cond = NULL_TREE;
 
+      if (in_coarray
+	  && TREE_CODE (lse->expr) == NOP_EXPR)
+	lse->expr = TREE_OPERAND (lse->expr, 0);
+
       /* Are the rhs and the lhs the same?  */
       if (deep_copy)
 	{
@@ -11931,6 +11935,11 @@ gfc_trans_scalar_assign (gfc_se *lse, gfc_se *rse, gfc_typespec ts,
       gfc_add_block_to_block (&block, &rse->pre);
       gfc_add_block_to_block (&block, &lse->finalblock);
       gfc_add_block_to_block (&block, &lse->pre);
+
+      if (in_coarray
+	  && TREE_CODE (lse->expr) == NOP_EXPR)
+	lse->expr = TREE_OPERAND (lse->expr, 0);
+
       tmp = fold_build1_loc (input_location, VIEW_CONVERT_EXPR,
 			     TREE_TYPE (lse->expr), rse->expr);
       gfc_add_modify (&block, lse->expr, tmp);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.