https://gcc.gnu.org/g:e8c29de4679eea7935841e2a9553a70bacc8e49c
commit e8c29de4679eea7935841e2a9553a70bacc8e49c Author: Mikael Morin <mik...@gcc.gnu.org> Date: Tue Jul 1 22:20:34 2025 +0200 Ajout locations setters Diff: --- gcc/fortran/trans-descriptor.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc index c1b4f3b5e019..e22dcbd8a03b 100644 --- a/gcc/fortran/trans-descriptor.cc +++ b/gcc/fortran/trans-descriptor.cc @@ -217,10 +217,10 @@ gfc_conv_descriptor_data_get (tree desc) tree type = TREE_TYPE (desc); gcc_assert (TREE_CODE (type) != REFERENCE_TYPE); + location_t loc = input_location; tree field = get_descriptor_data (desc); tree target_type = GFC_TYPE_ARRAY_DATAPTR_TYPE (TREE_TYPE (desc)); - tree t = fold_convert (target_type, field); - return non_lvalue_loc (input_location, t); + return non_lvalue_loc (loc, fold_convert_loc (loc, target_type, field)); } /* This provides WRITE access to the data field. @@ -234,8 +234,10 @@ gfc_conv_descriptor_data_get (tree desc) void gfc_conv_descriptor_data_set (stmtblock_t *block, tree desc, tree value) { + location_t loc = input_location; tree field = get_descriptor_data (desc); - gfc_add_modify (block, field, fold_convert (TREE_TYPE (field), value)); + gfc_add_modify_loc (loc, block, field, + fold_convert_loc (loc, TREE_TYPE (field), value)); } @@ -254,8 +256,10 @@ gfc_conv_descriptor_offset_get (tree desc) void gfc_conv_descriptor_offset_set (stmtblock_t *block, tree desc, tree value) { + location_t loc = input_location; tree t = get_descriptor_offset (desc); - gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value)); + gfc_add_modify_loc (loc, block, t, + fold_convert_loc (loc, TREE_TYPE (t), value)); } @@ -296,8 +300,10 @@ gfc_conv_descriptor_span_get (tree desc) void gfc_conv_descriptor_span_set (stmtblock_t *block, tree desc, tree value) { + location_t loc = input_location; tree t = gfc_conv_descriptor_span (desc); - gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value)); + gfc_add_modify_loc (loc, block, t, + fold_convert_loc (loc, TREE_TYPE (t), value)); } @@ -544,8 +550,10 @@ void gfc_conv_descriptor_stride_set (stmtblock_t *block, tree desc, tree dim, tree value) { + location_t loc = input_location; tree t = get_descriptor_stride (desc, dim); - gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value)); + gfc_add_modify_loc (loc, block, t, + fold_convert_loc (loc, TREE_TYPE (t), value)); } static tree @@ -564,8 +572,10 @@ void gfc_conv_descriptor_lbound_set (stmtblock_t *block, tree desc, tree dim, tree value) { + location_t loc = input_location; tree t = get_descriptor_lbound (desc, dim); - gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value)); + gfc_add_modify_loc (loc, block, t, + fold_convert_loc (loc, TREE_TYPE (t), value)); } static tree @@ -584,8 +594,10 @@ void gfc_conv_descriptor_ubound_set (stmtblock_t *block, tree desc, tree dim, tree value) { + location_t loc = input_location; tree t = get_descriptor_ubound (desc, dim); - gfc_add_modify (block, t, fold_convert (TREE_TYPE (t), value)); + gfc_add_modify_loc (loc, block, t, + fold_convert_loc (loc, TREE_TYPE (t), value)); }