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]

Re: [Fortran,Patch] PR 46638 Wrong results with TRANSFER to derived types


On 11/24/2010 07:25 AM, Tobias Burnus wrote:
The code for simplifying the TRANSFER to a derived type assumed that the
elements are all offset by the amount DECL_FIELD_OFFSET (in bytes). However,
that's only the case if each element has the size of DECL_OFFSET_ALIGN -- or
larger. On my system, that's chunks of 16 byte. Thus, for all components whose
size is smaller, the result will be wrong.

The trick is to add to DECL_FIELD_OFFSET additionally the bits of
DECL_FIELD_BIT_OFFSET -- that actually done for transferring the data from a
derived type.

[Instead of using the magical number "8" one could also use BITS_PER_UNIT (and
add #include "default.h").]

Build and regtested on x86-64-linux.
OK for the trunk and 4.4/4.5?


OK, thanks for quick fix



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