The memory layout of a real*10 variable on an i386 processor requires 12 or 16 bytes per variable, depending on the flag -m128bit-long-double. The disk layout for unformatted (binary) writing occupies 10 bytes per variable. This has several disadvantages. It is different from I would naively expect (which does not mean much), and it is different from binary C I/O (which could also be ignored). However, it is likely also rather inefficient if large arrays are written to disk, because a single call to write() or fwrite() now has to be split up into one call per array element, so that the padding is removed. It is also questionable whether having a real*10 variable occupy 12 or 16 bytes in memory is what people expect; again, this could be ignored since the standard permits this. However, this is also very different from what other compilers do.
-- Summary: Memory and binary disk layout disagree for real*10 Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schnetter at aei dot mpg dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22519