> I'm experiencing a strange gfortran bug, i686-pc-mingw32 specific, > with options -march=pentium4 -mfpmath=sse -msse.
Some more input... the bug appears when SSE sqrtsd is called, but only if libgfortran contrusctors have been run: cat a.s .file "a.f90" .section .rdata,"dr" .align 8 LC0: .long 0 .long 1073741824 .text .globl _MAIN__ .def _MAIN__; .scl 2; .type 32; .endef _MAIN__: pushl %ebp movl %esp, %ebp subl $16, %esp movsd LC0, %xmm0 movsd %xmm0, -8(%ebp) sqrtsd -8(%ebp), %xmm0 movsd %xmm0, -8(%ebp) leave ret $ gcc a.s -lgfortranbegin -lgfortran && ./a.exe [popus up crash dialog] $ diff a.s a_nolibgfortran.s 8,10c8,10 < .globl _MAIN__ < .def _MAIN__; .scl 2; .type 32; .endef < _MAIN__: --- > .globl _main > .def _main; .scl 2; .type 32; .endef > _main: $ gcc a.s && ./a.exe [works ok] The problem appears to be inside the libgfortran constructor and functions called herein. I'll try to narrow it, but I don't really know what to look for... What kind of code can be expected to generate such bad behaviour? FX