public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Selective -O3 optimization of a C++ code mixed with inline assembly
@ 2002-10-06 19:31 Wasif Latif
  0 siblings, 0 replies; only message in thread
From: Wasif Latif @ 2002-10-06 19:31 UTC (permalink / raw)
  To: gcc-help

I am encountered with a very compute intensive C++
code. When I compile it -O3 level optimization, it
gives me a time saving of about 40% and works fine. To
do more optimization, I have converted its 3 functions
into inline assembly. This mixed C++ plus inline
assembly code works fine at optimization level -O0.
However when I compiles it -O3, it gives 2 types of
error.
1)It reports error in assembly instructions in
assembly which otherwise ran fine at -O0
level. This is due to improper addressing translation 
while accessing the local C variables.
2)If somehow I overcome these compile time errors at
optimization level -O3, the program gives run time
errors like "Segmentation Fault" and "Arithmetic 
Exception"

The solution which I thought for this thing is to
selectively compile the inline assembly functions with
no optimization while remaining C code with highest
optimization. Can somebody tell me is there Microsoft
Visual C++ #pragma optimization and #pragma
nooptimization like declations which I can put in my
C-code to do selective optimization while compilation.

Thanks in advance

Wasif


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-07  2:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 19:31 Selective -O3 optimization of a C++ code mixed with inline assembly Wasif Latif

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).