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]

gfortran weirdness on Mac OS-X


Hi to everybody

I have been using the gfortran binaries by FX Coudert
for Intel Mac and OS-X 10.4.11 with satisfactory results
(i.e. some workaround needed but things were overall
working); starting with the October 17 package, however,
gfortran produce invalid assembler code ("operands given
don't match any known 386 instruction") on several parts
of the scientific software distribution I am working on
(www.quantum-espresso.org, www.pwscf.org)

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.

Paolo
---
Paolo Giannozzi, Dept of Physics, University of Udine
via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222




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