[Bug libfortran/77278] Use LTO for libgfortran

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 4 07:32:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77278

--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
In libgfortran, we have

#define GFC_ARRAY_DESCRIPTOR(type) \
struct {\
  type *base_addr;\
  size_t offset;\
  dtype_type dtype;\
  index_type span;\
  descriptor_dimension dim[];\
}

and then later

typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_4) gfc_array_i4;

so the array descriptors expected by the libgfotran routines
have a flexible array members.

If, in the front end, we have the equivalent of (the type name
isn't exactly what the front end generates)

typedef struct {
  GFC_INTEGER_4 *base_addr;\
  size_t offset;\
  dtype_type dtype;\
  index_type span;\
  descriptor_dimension dim[3];\
} _array03_integer_4_descriptor;

_array03_integer_4_descriptor my_descriptor;

and a pointer type that corresponds to what the library
expects, we should then be able to call

    minloc_... ((gfc_array_i4 *) &my_descriptor, ..)

right?

I think this should probably be restricted to calling the
library, I would feel nervous touching use code with this.


More information about the Gcc-bugs mailing list