[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Refactoring gfc_get_scalar_to_descriptor_type
Mikael Morin
mikael@gcc.gnu.org
Sat Sep 6 14:54:13 GMT 2025
https://gcc.gnu.org/g:94d5fa0b04041270b0ae1ae20a9a293c714c7749
commit 94d5fa0b04041270b0ae1ae20a9a293c714c7749
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Thu Aug 7 14:05:20 2025 +0200
Refactoring gfc_get_scalar_to_descriptor_type
Correction gfc_get_scalar_to_descriptor_type
Correction gfc_get_scalar_to_descriptor_type
Diff:
---
gcc/fortran/trans-expr.cc | 6 +++---
gcc/fortran/trans-types.cc | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 185554fcfe4e..f7bb11dbf52f 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -96,7 +96,7 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar, symbol_attribute attr)
{
tree desc, type, etype;
- type = gfc_get_scalar_to_descriptor_type (scalar, attr);
+ type = gfc_get_scalar_to_descriptor_type (TREE_TYPE (scalar), attr);
etype = TREE_TYPE (scalar);
desc = gfc_create_var (type, "desc");
DECL_ARTIFICIAL (desc) = 1;
@@ -903,7 +903,7 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym,
if (fsym->ts.u.derived->components->as)
{
tree type;
- type = gfc_get_scalar_to_descriptor_type (parmse->expr,
+ type = gfc_get_scalar_to_descriptor_type (TREE_TYPE (parmse->expr),
gfc_expr_attr (e));
gfc_conv_descriptor_dtype_set (&parmse->pre, ctree,
gfc_get_dtype (type));
@@ -1312,7 +1312,7 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
{
if (e->rank == 0)
{
- tree type = gfc_get_scalar_to_descriptor_type (parmse->expr,
+ tree type = gfc_get_scalar_to_descriptor_type (TREE_TYPE (parmse->expr),
gfc_expr_attr (e));
gfc_conv_descriptor_dtype_set (&block, ctree,
gfc_get_dtype (type));
diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index e0eed7da7fe3..cc9ddeb463fe 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -2167,7 +2167,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
arrays. */
tree
-gfc_get_scalar_to_descriptor_type (tree scalar, symbol_attribute attr)
+gfc_get_scalar_to_descriptor_type (tree scalar_type, symbol_attribute attr)
{
enum gfc_array_kind akind;
@@ -2178,9 +2178,9 @@ gfc_get_scalar_to_descriptor_type (tree scalar, symbol_attribute attr)
else
akind = GFC_ARRAY_ASSUMED_SHAPE_CONT;
- if (POINTER_TYPE_P (TREE_TYPE (scalar)))
- scalar = TREE_TYPE (scalar);
- return gfc_get_array_type_bounds (TREE_TYPE (scalar), 0, 0, NULL, NULL, 1,
+ if (POINTER_TYPE_P (scalar_type))
+ scalar_type = TREE_TYPE (scalar_type);
+ return gfc_get_array_type_bounds (scalar_type, 0, 0, NULL, NULL, 1,
akind, !(attr.pointer || attr.target));
}
More information about the Gcc-cvs
mailing list