[gcc(refs/users/mikael/heads/refactor_descriptor_v203.04)] fortran: array descriptor: Remove access to the attribute field [PR122521]

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

commit 929aa82b2b129d132aeea559cb5042c8b4c0437a
Author: Mikael Morin <[email protected]>
Date:   Sat Jul 11 12:02:41 2026 +0200

    fortran: array descriptor: Remove access to the attribute field [PR122521]
    
    Regression tested on aarch64-unknown-linux-gnu.  OK for master?
    
    -- >8 --
    
    The attribute field is not used, this removes the single function giving
    direct access to it.
    
            PR fortran/122521
    
    gcc/fortran/ChangeLog:
    
            * trans-descriptor.cc (gfc_conv_descriptor_attribute): Remove
            function.
            * trans-descriptor.h (gfc_conv_descriptor_attribute): Remove
            declaration.

Diff:
---
 gcc/fortran/trans-descriptor.cc | 16 ----------------
 gcc/fortran/trans-descriptor.h  |  1 -
 2 files changed, 17 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 0373fcc7a77c..2b67776de4a6 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -317,22 +317,6 @@ gfc_conv_descriptor_elem_len_set (stmtblock_t *block, tree desc, tree value)
 }
 
 
-tree
-gfc_conv_descriptor_attribute (tree desc)
-{
-  tree tmp;
-  tree dtype;
-
-  dtype = conv_descriptor_dtype (desc);
-  tmp = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (dtype)),
-			   GFC_DTYPE_ATTRIBUTE);
-  gcc_assert (tmp!= NULL_TREE
-	      && TREE_TYPE (tmp) == short_integer_type_node);
-  return fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (tmp),
-			  dtype, tmp, NULL_TREE);
-}
-
-
 /* Return a reference to the type discriminator field of the array descriptor
    DESC.  */
 
diff --git a/gcc/fortran/trans-descriptor.h b/gcc/fortran/trans-descriptor.h
index 27fb6c8ad793..5daeb349f26d 100644
--- a/gcc/fortran/trans-descriptor.h
+++ b/gcc/fortran/trans-descriptor.h
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 #define GFC_TRANS_DESCRIPTOR_H
 
 
-tree gfc_conv_descriptor_attribute (tree);
 tree gfc_get_descriptor_dimension (tree);
 tree gfc_conv_descriptor_dimension (tree, tree);
 tree gfc_conv_descriptor_token (tree);
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.