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] [3/5] PR 45586: Use the right type to build structure constructors.


This patch makes the LTO failures go away.
It propagates the information that we want (non-)restrict types from
gfc_trans_assignment_1 (where we have access to the LHS) down to
gfc_conv_structure (where the type specialization happens).
The call graph is roughly as follows (to be seen with a fixed font):

gfc_trans_assignment_1 [set restricted]
  \
   +-> gfc_conv_expr     <------------------------------+-------+
         \                                               \       \ 
          +-> gfc_conv_structure [use restricted]  <----+-|-----+ |
                \                                        \|      \|
                 +-> gfc_conv_initializer ----------------+       +
                       \                                          |
                        +-> gfc_conv_array_initializer -----------+

To avoid polluting every function (and every caller) with a restricted flag
I have added it to gfc_se, which has already a good deal of request
specification flags.
Unfortunately, gfc_conv_initializer and gfc_conv_array_initializer don't have
a gfc_se arg, so they don't avoid the restricted argument.
To avoid changing all gfc_conv_initializer callers it is made a wrapper around
the function with the restricted argument.
I didn't do the same for gfc_conv_array_initializer as it has a single caller,
so the interface change is harmless/non-invasive.  As I had to update the
declaration I moved it from gfortran.h to trans-array.h by the way.

OK?

Attachment: pr45586-3.CL
Description: Text document

Attachment: pr45586_v7-3.patch
Description: Text document


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