Web lists-archives.com

Re: x86_64: floating-point environment (i.e. fenv.h). BUG.

On 2018-08-01 13:49, Houder wrote:
On 2018-08-01 13:00, Corinna Vinschen wrote:
On Aug  1 12:22, Houder wrote:
Hi Corinna,

Short version of my report (as there is more to say about the implementation
"fenv") in Cygwin; this time I restrict myself to a bug in fegetenv() ).

(Note to myself: attach STC)

I am reporting a bug in fegetenv() in winsup/cygwin/fenv.cc. There is no
in repairing this bug, as "fenv" is hardly ever (never?) used by anyone.

fegetenv() should be modified as follows:

  __asm__ volatile ("fnstenv %0" : "=m" (envp->_fpu) : );
  if (use_sse)
    __asm__ volatile ("stmxcsr %0" : "=m" (envp->_sse_mxcsr) : );
  return 0

// Henri: copying glibc ...
  __asm__ volatile ("fnstenv %0\n"
                    "fldenv %0" : "=m" (envp->_fpu) : );
  if (use_sse)
    __asm__ volatile ("stmxcsr %0" : "=m" (envp->_sse_mxcsr) : );
  return 0;

Since you know how to fix things, please just send patches to
the cygwin-patches ML.

Ah ... Agreed. However, as I am not set up for building (anymore), this
will take some time ... (not even git is installed).

(yes, I did verify the above modification (and more), however I did that
 "locally" (basically, I included winsup/cygwin/fenv.cc in my  STC) ).


As requested by you, I made an attempt. See cygwin-patches.



Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple