This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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] Disable use of -malign-double


On 2/1/07, François-Xavier Coudert <fxcoudert@gmail.com> wrote:
> (Note I agree with Andrew that no special action should be required,
> the documentation is quite clear)

I think it might not be clear from the point of view of a Fortran user
(who knows nothing about the compiler actually linking in a library
that the user never required).

Perhaps a section "GCC options that most probably won't work for your
Fortran code" could be added to the gfortran doc? There, we would
explain:
  * the reasons why options changing ABI can't be used directly for
Fortran programs, even if there's no library involved (because the
compiler links in a library)
  * a list of common such options
  * a hint about the way to work around that if you really need it
(ie, building the libraries, including libgfortran, with your
ABi-changing option)

How does that sound?

The problem is that -malign-double is advocated as a useful option outside of the gcc manual. In the manual it is clearly stated that it will break. So the solution is to stop advocating use of -malign-double or fix the wording of that advocation. But I support to amend the existing description

<quote>
@item -malign-double
@itemx -mno-align-double
@opindex malign-double
@opindex mno-align-double
Control whether GCC aligns @code{double}, @code{long double}, and
@code{long long} variables on a two word boundary or a one word
boundary.  Aligning @code{double} variables on a two word boundary will
produce code that runs somewhat faster on a @samp{Pentium} at the
expense of more memory.

On x86-64, @option{-malign-double} is enabled by default.

@strong{Warning:} if you use the @option{-malign-double} switch,
structures containing the above types will be aligned differently than
the published application binary interface specifications for the 386
and will not be binary compatible with structures in code compiled
without that switch.
</quote>

to explicitly mention libgfortran, libstdc++ and glibc such as via

-without that switch.
+without that switch such as libgfortran, libstdc++ or glibc.

Richard.


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