aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Morin <morin-mikael@orange.fr>2025-08-05 14:58:01 +0200
committerMikael Morin <mikael@gcc.gnu.org>2025-08-05 22:35:07 +0200
commit8d2e44fa19959e8452d500f264f4c96e13ec3617 (patch)
tree8f0be5bc15bbfcc196c9c3feb88ea52bcca6ab50
parentacb0fa251abf55bfdd50e90b2c97ab084204ca6c (diff)
downloadgcc-8d2e44fa19959e8452d500f264f4c96e13ec3617.zip
gcc-8d2e44fa19959e8452d500f264f4c96e13ec3617.tar.gz
gcc-8d2e44fa19959e8452d500f264f4c96e13ec3617.tar.bz2
fortran: Remove premature initialization of a function result's span
Setting just the span in an otherwise uninitialized array descriptor to pass to a function that will use the descriptor for its result (thus do the initialization) doesn't seem to be useful. gcc/fortran/ChangeLog: * trans-array.cc (gfc_conv_expr_descriptor): Remove isolated initialization of the span field before passing to the function that will do the initialization.
-rw-r--r--gcc/fortran/trans-array.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 45980d6..f4a7a0c 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -8499,14 +8499,6 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
else
gcc_assert (se->ss == ss);
- if (!is_pointer_array (se->expr))
- {
- tmp = gfc_get_element_type (TREE_TYPE (se->expr));
- tmp = fold_convert (gfc_array_index_type,
- size_in_bytes (tmp));
- gfc_conv_descriptor_span_set (&se->pre, se->expr, tmp);
- }
-
se->expr = gfc_build_addr_expr (NULL_TREE, se->expr);
gfc_conv_expr (se, expr);