Ask for help

John Fine johnsfine@verizon.net
Tue Mar 17 15:02:00 GMT 2009


If your meaning for the word "performance" is the usual meaning, the 
earlier response by Andrew Haley answers the whole question.

But the way you phrased the question makes me think you meant "behavior" 
when you wrote "performance".

-fno-strict-aliasing can give you correct behavior from a program that 
incorrectly uses a reinterpret_cast or similar operation. That should be 
considered a bug, and if there are few of those in your code, you should 
find and correct them.

Some old code has enough incorrect reinterpret_cast operations that 
correcting them is impractical and you need the -fno-strict-aliasing

I'm not sure what -DNDEBUG or -static might change in the behavior or 
performance of your code. I'm just guessing that -fno-strict-aliasing is 
the important difference.

Wei, Wanxia wrote:
> gcc -m32 -O3 -DNDEBUG -fno-strict-aliasing -static –lm
>
> gcc -m32 –O3 –lm
>
>   
...
>  the
> different performance of the two executables of my C program means there are bugs in
> this program?
>
>   



More information about the Gcc-help mailing list