compiler bug 
Author Message
 compiler bug

Hi,
  Just wanted to let the compiler team know of a code
generation bug I found. I'm afraid I wasn't easily able
to make a repro but hopefully the description of the
problem ought to be enough of a clue.

The problem is to do with casting from a double to an
unsigned long. It appears that sometimes the compiler
emits a fistp instruction instead of a call to _ftol2.
The fistp instruction causes an FPU exception for values
that are larger than the max signed long but smaller than
the max unsigned long. This problem happens in both debug
and release builds - in debug builds, the complexity of
the expression also appears to be a factor.

Other than this slightly esoteric case, I've found no
other code generaion bugs with the optimizer which is a
very refreshing change - good job :)
  Andrew



Fri, 28 Oct 2005 22:22:40 GMT  
 compiler bug

Quote:


>Subject: compiler bug
>Date: Mon, 12 May 2003 07:22:40 -0700
>Hi,
>  Just wanted to let the compiler team know of a code
>generation bug I found. I'm afraid I wasn't easily able
>to make a repro but hopefully the description of the
>problem ought to be enough of a clue.

>The problem is to do with casting from a double to an
>unsigned long. It appears that sometimes the compiler
>emits a fistp instruction instead of a call to _ftol2.
>The fistp instruction causes an FPU exception for values
>that are larger than the max signed long but smaller than
>the max unsigned long. This problem happens in both debug
>and release builds - in debug builds, the complexity of
>the expression also appears to be a factor.

>Other than this slightly esoteric case, I've found no
>other code generaion bugs with the optimizer which is a
>very refreshing change - good job :)
>  Andrew

Andrew,

Thank you very much for reporting this problem. We will certainly try to
determine why we generate FISTP in this case, but it would help if you can
provide a repro case for it. Thanks again,
--
Marko Radmilac, Visual C++ Compiler Team
This posting is provided AS IS with no warranties, and confers no rights.



Sat, 29 Oct 2005 02:16:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. please help: code bug or compiler bug?

2. midl compiler bug - msado15.idl

3. c# compiler bug (a real one this time)

4. VC++ 2003 compiler bug

5. MSVC compiler bug [?] - private constructor called illegaly

6. Compiler bug?

7. C++ compiler bug?

8. Compiler bug when mixing managed and unmanaged code

9. VC7 adds a new twist to an old C++ compiler bug

10. compiler bug: destructor for temporary in constructor initializer never called

11. Compiler bug: pointer conversions from relational operator

12. possible compiler bug?

 

 
Powered by phpBB® Forum Software