Compiler produces bad code 
Author Message
 Compiler produces bad code

The following produced bad machine code:

HRESULT CMyApp::OnDocumentComplete(IDispatch *spHTML)
      if (gbActivateMe)
   catch(_com_error &e)
      return e.Error();
   catch (...)
      return E_FAIL;

   return S_OK;



gbActivateMe is a global and if it was set to false it
would still enter the if.  Examination of the assembly code
in the de{*filter*} showed that the compare was set to jump into
the if when gbActivateMe was false, and not jump to the appropriate
return statement.

Removing the try catch block relieved the symptoms.

Having just found this, I have some serious doubts as to the stability
of this version of the compiler.  I am in the process of moving a large
commercial app over to VC 7 from VC 6.

Should I bag it and go back to 6.0?


Sat, 22 Jan 2005 07:50:08 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Optimization produces bad FP code

2. Simple Code Produce "INTERNAL COMPILER ERROR"

3. Compiler produced IL code

4. Compiler producing smaller code than gcc ?

5. Need a C compiler to produce stand-alone code

6. Severe bug in VC5 compiler : Bad code generation

7. Incremental Build producing bad exe.

8. Browser accessible C compiler (produces downloadable MSDOS EXE files)

9. linking objects produced by Fortran compiler

10. /Gm option (minimal rebuild) produces INTERNAL COMPILER Error with boost::graph

11. Template invocation produces internal compiler error

12. ANSI C compilers that produce OMF


Powered by phpBB® Forum Software