error when the -malign-double flag is included in a Makefile
Andrew Thomas Pinski
pinskia@gmail.com
Sat Oct 25 19:51:00 GMT 2008
Sent from my iPhone
On Oct 25, 2008, at 12:38 PM, jdelia@intec.unl.edu.ar wrote:
> Hi gfortran developers,
>
> I found a running crash with a rather big code and the following
> codes included in the "error.tgz" file is a reduced version.
>
> From some further tests I found that the runnig crash is caused by
> the "-malign-double" flag only when it is used in a Makefile.
Please read the fine manual. This option will change the ABI so you
cannot use it with most code unless you compile every thing with it
including gcc and glibc.
Thanks,
Andrew Pinski
>
>
> On the other hand, when each module and main program are compiled by
> turn and linked manualy, there is not any crashing.
>
> Please, how can I do to fix this?
>
> Regards, Jorge.
>
> $ gfortran --version
> GNU Fortran (GCC) 4.4.0 20081021 (experimental) [trunk revision
> 141258]
> Copyright (C) 2008 Free Software Foundation, Inc.
>
> $ cat /proc/version
> Linux version 2.6.26.6-49.fc8
> (mockbuild@x86-2.fedora.phx.redhat.com) (gcc version 4.1.2 20070925
> (Red Hat 4.1.2-33)) #1 SMP
>
> ! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
> FIRST TEST. This is does not crash:
>
> $ export A1="-Wall -std=f2003 -fPIC -O3 -fargument-alias"
> $ export A2="-fno-second-underscore -mmmx -msse2 -msse"
> $ export A3="-funroll-loops -ftree-vectorize -foptimize-sibling-calls"
> $ export A4="-march=pentium4 -fomit-frame-pointer -malign-double"
>
> $ gfortran $A1 $A2 $A3 $A4 -c m1.f90
> $ gfortran $A1 $A2 $A3 $A4 -c m2.f90
> $ gfortran $A1 $A2 $A3 $A4 -c test.f90
> $ gfortran $A1 $A2 $A3 $A4 -o test.exe *.o
>
> $ test.exe e0012 0 yes (it is OK)
>
> ! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
> SECOND TEST. Here there is a run crashing
>
> $ make
> $ test.exe e0012 0 yes
> $ Segmentation fault (crash)
>
> ! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
> THIRD TEST. Makefile without the "-malign-double" flag.
>
> $ make
> $ test.exe e0012 0 yes (it is OK again)
>
> ! -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
> The Makefile has the following definitions (BTW, are OK?):
>
> A1 := -Wall -std=f2003 -fPIC -O3 -fargument-alias
> A2 := -fno-second-underscore -mmmx -msse2 -msse
> A3 := -funroll-loops -ftree-vectorize -foptimize-sibling-calls
> A4 := -march=pentium4 -fomit-frame-pointer -malign-double
> AA := $(A1) $(A2) $(A3) $(A4)
> ! #executable
> all: m1.o \
> m2.o \
> test.o
> gfor $(AA) -o test.exe *.o
> #module 1
> m1.o: m1.f90
> gfor -v -c $(AA)
> m1.mod: | m1.f90
> gfor -v -c $(AA) m1.f90
> #module 2
> m2.o: m2.f90 m2.mod
> gfor -v -c $(AA) $<
> m2.mod: | m2.f90 m1.mod
> gfor -v -c $(AA) m2.f90
> #main code
> test.o: test.f90 m1.mod m2.mod
> gfor -v -c $(AA) $<
> test.mod: | test.f90 m1.mod m2.mod
> gfor -v -c $(AA) test.f90
> #end
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> <error.tgz>
More information about the Fortran
mailing list