[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:cab495d5ddcfcb5cbe9f62c5d408fd37885814ba

commit cab495d5ddcfcb5cbe9f62c5d408fd37885814ba
Author: Mikael Morin <[email protected]>
Date:   Thu Aug 20 11:39:05 2026 +0200

    fortran: array descriptor: Remove dead address taking [PR122521]
    
    TODO: FAIL: class_optional_2
    
    -- >8 --
    
    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.
    
    Revert "Sauvegarde récupération type déclaré à partir de classe"
    
    This reverts commit c8a708aa00ec3c3262c5b4e3abbe41670d6d94a2.
    
    Retour en arrière partiel
    
    Revert partiel "fortran: array descriptor: Remove dead address taking [PR122521]"
    
    This reverts commit 633757e5a6d9188dd487bda3402f7f3f354d99be.

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index aee8611982d3..a70b926c2585 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -938,8 +938,6 @@ gfc_set_descriptor_from_scalar_class (stmtblock_t *block, tree descr,
   tree tmp = scalar;
   if (is_class_container_type (TREE_TYPE (tmp)))
     tmp = gfc_class_data_get (tmp);
-  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.