This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] [4/5] PR 45586: Use the right type to build array constructors.


With array constructors, there is the same type problem as with structure
constructor: we don't know whether we want the non-restricted or the
restricted variant.
Array constructors are translated from somewhere deep inside the scalarizer,
so we have to pass the information there down to gfc_conv_expr (which is now
able to handle it thanks to the previous patch).  A new flag is added to the
gfc_ss_info structure to store that information.  As most of the time the
restrict variant is needed, the flag is set to true by default.  A new function
is added (gfc_ss_set_restricted) to set it to false in the one (for now) case
it is useful.  As before, new flags have to be added to function prototypes
to transfer that flag's information.  The call graph is as follows (to be seen
with a fixed font):

gfc_add_loop_ss_code [set restricted]
  \
   +-> trans_array_constructor
         \
          +-> gfc_trans_array_constructor_value   <--+
                |\                                   |
                | +----------------------------------+
                |\
                | +-> gfc_trans_array_constructor_subarray
                 \       \
                  +-------+-> gfc_trans_array_ctor_element
                                 \
                                  +-> gfc_conv_expr [propagate restricted]

gfc_trans_array_ctor_element is changed to use gfc_trans_scalar_assign, which
is able to handle incompatible types thanks to patch number 1.

OK?

Attachment: pr45586-4.CL
Description: Text document

Attachment: pr45586_v7-4.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]