gcc 2.95.2/Cygwin/x86 floating point code generation bug

Mathew Hendry scampi@dial.pipex.com
Mon Feb 21 14:42:00 GMT 2000


Hi, little bug report for you. Found this while tracking down some bugs in
the LAME MP3 encoder.

Bug details
-----------

Compiler: gcc 2.95.2, compiled for Cygwin B20.1, but also known to appear
under Linux

Example input file: test.c (attached)

Example compiler output: test.s (attached)

Command line: gcc -O -g test.c -S

Machine: Celeron 400 running Windows 2000 Final

Bug description
---------------

When compiling the attached source, gcc generates code that loads garbage
onto the FP stack.
Referring to the attached compiler output, lines 59 and 60 read

  flds -8(%ebp)
  fldl -16(%ebp)

Neither of these stack locations have been initialised with valid floating
point data. This frequently triggers "invalid operation" FP exceptions when
executing the code.

-- Mat.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.s
Type: text/x-asm
Size: 5052 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000221/a56cc29c/attachment.bin>


More information about the Gcc-bugs mailing list