This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] Allow building libgfortran as a DLL


Steve Kargl wrote:
> On Tue, Aug 04, 2009 at 02:51:19PM +0100, Dave Korn wrote:
>> Tim Prince wrote:
>>> Dave Korn wrote:
>>>
>>>>   I took a quick step through it in the debugger.  It's possibly an
>>>> excess-precision FP thing.  Can you point me at what code in the gfortran
>>>> startup is meant to set the FP precision and rounding (etc.) modes?
>>>>
>>> All these years I've been working with the apparent misconception that
>>> gnu compilers left these at hardware/OS default, with the possible
>>> exception of -ffast-math which should attempt to set abrupt underflow
>>> for SSE.
>>   That's the difference between a compiler and a language runtime support
>> library.  I don't know for a fact if fortran's runtime initialises the FPU but
>> the Ada runtime, for example, does.
>>
> 
> See set_fpu() in 
> 
> troutmask:sgk[206] ls config/fpu*
> config/fpu-387.h        config/fpu-generic.h    config/fpu-sysv.h
> config/fpu-aix.h        config/fpu-glibc.h
> 
> It only sets/unsets the mask for exceptions.  The precision, AFAIK, is
> determined by the OS.

  Well, I verified that the DLL's .ctors were being run correctly, and init()
was being called and calling set_fpu(), and that was all working right, and I
tried stepping through it and manually forcing the FPU to double precision
instead of extended precision mode and it didn't make any difference, so this is
almost certainly not any problem related to the DLL-ness of libgfortran and not
any problem with the patch, which I recommend for approval.

    cheers,
      DaveK


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