The ChipList, by Adrian Offerman; The Processor Portal

new
Processor Selector

Platform:
Segment:
View: show / edit

bookmark bookmark site
bookmark permalink
Fri 16 Oct 2009, 21:19

Incorrect padding added for SEQUENCE or BIND(C) type with UNION


On Fri 16 Oct 2009, at 21:19, Intel Software Network - Main Articles Feed wrote:

Incorrect padding added for SEQUENCE or BIND(C) type with UNION

Reference Number : DPD200138527


Version : 11.1


Product : Intel® Fortran Compiler


Operating System : All

Problem Description : If a derived type is declared containing a UNION, and the type is a SEQUENCE type or is interoperable (BIND(C)), and the UNION contains a misaligned field, the compiler incorrectly adds padding bytes before each misaligned field.

UNION is an extension to the Fortran standard, supported by Intel Fortran, that allows the declaration of overlapping sets of derived type components. A SEQUENCE type is a derived type containing the SEQUENCE keyword. The Fortran standard specifies that components of a SEQUENCE type may not be rearranged by the compiler; in Intel Fortran, SEQUENCE types do not, by default, have alignment padding added before misaligned components. (This can be overridden with the "align sequence" option.) Lastly, an interoperable derived type, declared with the BIND(C) specifier, is required to have its components laid out exactly as the companion C processor would do it - this may involve padding if the C processor would pad by default.

Consider the following declaration:

type :: mytype
sequence
integer(2) f1
union
map
integer(2) xa1
...
Filed under: Intel® Fortran Compiler for Linux* Knowledge BaseIntel® Fortran Compiler for Mac OS X* Knowledge BaseIntel® Visual Fortran C
Source: Intel Software Network - Main Articles Feed

ChipList news channel Last Months News


ChipList developers news channel Last Months Developers News


Page viewed 11195 times since Fri 16 Oct 2009, 21:41.