Advertisement

AHH - What have I done ?

Started by December 14, 2001 08:56 PM
5 comments, last by Yoshy 23 years, 2 months ago
Okay, I just want to confirm this bug in VC++6, I have a function ( FastCos ) that is defined like this:
      
__forceinline float __stdcall FastCos(float a) {
		__asm {
				fld		DWORD PTR [esp+4] 
				fcos
				ret 4
		}
}
  
Okay, so when I do 
      
 float a = FastCos(10);
      
the compiler doesn't even compile this it complains about an 'fatal error C1001: INTERNAL COMPILER ERROR' -- (The exact error is included below). BTW - This code compiles & run under Win32 Debug ! I just want to know if you guys are experiencing the same problem with this code or/and if you have suggestions...
(Heres the full error...)

--------------------Configuration: glTek - Win32 Release XP--------------------
Compiling...
Tek.cpp
C:\Documents and Settings\Philippe\Desktop\Development\OpenGL\glTek\Tek.cpp(142) : fatal error C1001: INTERNAL COMPILER ERROR
  (compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

glTek.exe - 1 error(s), 0 warning(s)
   
_____________________ Yoshy - From The Bobs Edited by - Yoshy on December 14, 2001 10:15:24 PM
_____________________
Hmm... compiles fine in my copy. Well, I actually get a warning that there is no return value, but no internal error, sorry.


Mike
"Unintentional death of one civilian by the US is a tragedy; intentional slaughter of a million by Saddam - a statistic." - Unknown
Advertisement
Perhaps you have a corrupted file within VC++, try reinstalling.

--------------------------

Those who dance are considered insane by those who cannot hear the music.
Those who dance are considered insane by those who cannot hear the music.
Compiled fine for me too, in Release and Debug mode.
quote:
Original post by terminate
Perhaps you have a corrupted file within VC++, try reinstalling.




Done that -- Do you have Service Pack 5 installed ?, I installed it ( and the platform sdk )...
_____________________
You''ll have some troubles with this function in MSVC.NET.. I used the same function but had to throw it out.. It compile fine but it gives some wierd error when you run it..

There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
Advertisement
A correct inline cos function would look like this.
  #pragma warning(disable : 4035)inline float FastCos(float a){	__asm	{		fld a		fcos		}}#pragma warning(default : 4035)  


float a = FastCos(10);

Compiles out nicely to...

00401002 mov dword ptr [esp],41200000h
0040100A fld dword ptr [esp]
0040100E fcos

MSVC will know that the return float is in st(0)

You can use the pragma statement to remove "warning C4035: ''FastCos'' : no return value"

This topic is closed to new replies.

Advertisement