[gcc(refs/users/mikael/heads/refactor_descriptor_v206.01)] fortran: array descriptor: Remove dead address taking [PR122521]

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

commit 3c9e8c8903eb4afd16199ae56d4611a957e83807
Author: Mikael Morin <[email protected]>
Date:   Tue Aug 18 14:11:55 2026 +0200

    fortran: array descriptor: Remove dead address taking [PR122521]
    
    The data component of class descriptors is a pointer.  So the code taking
    the address if the data reference has non-pointer type is dead.  Remove it.
    
    gcc/fortran/ChangeLog:
    
            * trans-descriptor.cc (gfc_set_descriptor_from_scalar_class): Remove
            dead address taking.

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 857cbeafae7d..6c3abd7a5a6f 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -917,10 +917,6 @@ gfc_set_descriptor_from_scalar_class (stmtblock_t *block, tree descr,
 						 gfc_expr_attr (scalar_expr));
   gfc_conv_descriptor_dtype_set (block, descr,
 				 gfc_get_dtype (type));
-
-  if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
-    tmp = gfc_build_addr_expr (NULL_TREE, tmp);
-
   gfc_conv_descriptor_data_set (block, descr, 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.