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: gfortran weirdness on Mac OS-X


Paolo Giannozzi wrote:

> I know I should follow the official path for bug reports: when
> I was younger and smarter I managed once to submit a
> bugzilla report, but I don't think I can do it again, so here
> is all the information I managed to gather. A small (and
> rather meaningless) piece of code that produces the error:
> 
> subroutine iotk_open_write_x ( unit, file, dummy, attr)
>   implicit none
>   integer, parameter :: iotk_namlenx =  256
>   type iotk_dummytype
>     integer :: dummy
>   end type iotk_dummytype
>   integer,                intent(in)  :: unit
>   character(*), optional, intent(in)  :: file
>   type(iotk_dummytype), optional      :: dummy
>   character(*), optional, intent(in)  :: attr
>   character(iotk_namlenx) :: lroot
>   lroot = "Root"
> end subroutine iotk_open_write_x
> 
> $ gfortran -v -O3 -c boh.f90
> Using built-in specs.Target: i386-apple-darwin8.10.1
> Configured with: /tmp/gfortran-20071231/ibin/../gcc/configure
> --prefix=/usr/local/gfortran --enable-languages=c,fortran
> --with-gmp=/tmp/gfortran-20071231/gfortran_libs --enable-bootstrap
> Thread model: posix
> gcc version 4.3.0 20071231 (experimental) [trunk revision 131236] (GCC)
> COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-O3' '-c'
> '-mtune=generic'
>  /usr/local/gfortran/libexec/gcc/i386-apple-darwin8.10.1/4.3.0/f951
> boh.f90 -fPIC -quiet -dumpbase boh.f90 -mmacosx-version-min=10.4
> -mtune=generic -auxbase boh -O3 -version -fintrinsic-modules-path
> /usr/local/gfortran/lib/gcc/i386-apple-darwin8.10.1/4.3.0/finclude -o
> /var/tmp//ccLKJVXR.s
> GNU F95 (GCC) version 4.3.0 20071231 (experimental) [trunk revision
> 131236] (i386-apple-darwin8.10.1)
>         compiled by GNU C version 4.3.0 20071231 (experimental) [trunk
> revision 131236], GMP version 4.2.1, MPFR version 2.2.1.
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-v' '-O3' '-c'
> '-mtune=generic'
>  as -arch i386 -force_cpusubtype_ALL -o boh.o /var/tmp//ccLKJVXR.s
> /var/tmp//ccLKJVXR.s:12:operands given don't match any known 386
> instruction
> 
> This is what I get in the *.s file (no idea what it means):
> 
>         .text
>         .align 4,0x90
> ..globl _iotk_open_write_x_
> _iotk_open_write_x_:
>         pushl   %ebp
>         movl    $63, %ecx
>         movl    %esp, %ebp
>         movl    $538976288, %eax
>         pushl   %edi
>         leal    -260(%ebp), %edi
>         subl    $260, %esp
>         rep stosl        <=== apparently this is the offending command
>         addl    $260, %esp
>         popl    %edi
>         popl    %ebp
>         ret
>         .subsections_via_symbols
> 
> Without -O3 the problem disappears here (i.e. in the large chunk
> of code from which the small piece was extracted) but it appears
> again in another part, this time apparently due to a " rep movsl"
> instruction, so I do not think it is optimization-specific. Thank you
> in advance for any hint.

Your binutils has a bug which was fixed 21 months ago:
http://sources.redhat.com/ml/binutils/2006-03/msg00089.html
If you don't want to use a current OS-X distribution, you could download
 build and install binutils from any more recent source distribution.
While you are updating your software, get a browser which works with Google.


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