This is the mail archive of the gcc-bugs@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]

[Bug fortran/68649] [6 Regression] note: code may be misoptimized unless -fno-strict-aliasing is used


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

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Further reduced test

 REAL*8 :: a8(16),b8(4,4), c8(16), d8(4,4)
 c8=RESHAPE(b8,(/16/))
 d8=RESHAPE(a8,(/4,4/))
END

> Notice the difference in size of the records.

How do they relate to the array sizes?

From https://gcc.gnu.org/onlinedocs/gfortran/RESHAPE.html#RESHAPE

Description:
Reshapes SOURCE to correspond to SHAPE. If necessary, the new array may be
padded with elements from PAD or permuted as defined by ORDER. 

> In libgfortran there is 
> void
> reshape_r8 (gfc_array_r8 * const restrict ret, 
>         gfc_array_r8 * const restrict source, 
>         shape_type * const restrict shape,
>         gfc_array_r8 * const restrict pad, 
>         shape_type * const restrict order)
>
> ideally the fortran-fe produced declaration of reshape_r8 should be just one per
> unit and interoperable with the declaration above that is pointer to:
> #define GFC_ARRAY_DESCRIPTOR(r, type) \
> struct {\
>   type *base_addr;\
>   size_t offset;\
>   index_type dtype;\
>   descriptor_dimension dim[r];\
> }

Are you meaning that fortran-fe should produce one reshape_r8xx per shape of
source?

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