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]

[0/4] Middle-end groundwork for GFortran TRANSFER intrinsic.


Paul Thomas and I have recently been working on a constant-folding implementation of the TRANSFER intrinsic in GFortran. For those unfamiliar with Fortran, the TRANSFER intrinsic is roughly equivalent to a pointer type cast, in that it takes the physical representation of a variable of one type, and interprets it as a variable of another type. The complication comes in the fact that the Fortran standard requires that this be calculable at compile time in some cases, and thus we need to have the ability to simulate target memory accesses on the host.

These patches set up the necessary groundwork for the implementation within the GCC middle-end. In particular, GCC and GFortran both have code to convert from MPFR to REAL_VALUE_TYPE representations, and from GMP to double_int representations. Parts 1, 2, and 4 consolidate those and export the relevant GCC functions where needed, and add the reverse-direction tree-to-GMP/MPFR conversion functions to GFortran using the existing GCC code. Also, the TRANSFER intrinsic needs access to the native_encode_expr and native_interpret_expr functions in fold-const.c, so Part 3 makes those non-static.

- Brooks


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